Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop #3954

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

develop #3954

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,42 @@
<title>Calendar</title>
<link
rel="stylesheet"
href="styles/index.scss"
href="styles/main.scss"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The href attribute is pointing to a .scss file. Browsers cannot directly interpret SCSS files; they need to be compiled into CSS first. Please compile your SCSS file to a CSS file and update this link to point to the resulting CSS file.

/>
</head>
<body>
<h1>Calendar</h1>
<section class="calendar calendar--start-day-sun calendar--month-length-31">
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
</section>
</body>
</html>
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

70 changes: 70 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
body {
margin: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}

.calendar {
padding: 10px;
display: flex;
flex-wrap: wrap;
gap: 1px;
width: 706px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider defining a SCSS variable for the width value 706px to improve maintainability and readability. This will make it easier to update the value in the future if needed.


// .calendar__item

&__day {
box-sizing: border-box;
list-style: none;
height: 100px;
width: 100px;
Comment on lines +22 to +23

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The height and width values 100px are repeated. Consider defining SCSS variables for these values to improve maintainability and readability.

background-color: #eee;
border: 1px solid black;
display: flex;
align-items: center;
justify-content: center;

&:hover {
background-color: #ffbfcb;
transform: translateY(-20px);
animation: move 0.5s;
}
}

@for $number from 1 through 31 {
& :nth-child(#{$number})::before {
content: '#{$number}';
font-family: Arial, Helvetica, sans-serif;
font-size: 30px;
}
}

$days: ('mon' 0, 'tue' 1, 'wed' 2, 'thu' 3, 'fri' 4, 'sat' 5, 'sun' 6);

@each $day, $dayCount in $days {
&--start-day-#{$day} :first-child {
margin-left: 101px * $dayCount;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The margin-left calculation uses a hardcoded value 101px. Consider defining a SCSS variable for this value to improve maintainability and readability.

}
}

@for $number from 28 through 31 {
&--month-length-#{$number} :nth-child(n + #{$number + 1}) {
display: none;
}
}

@keyframes move {
from {
background-color: #eee;
transform: translate(0);
}

to {
background-color: #ffbfcb;
transform: translate(0, -20px);
}
}
}
Loading