-
Notifications
You must be signed in to change notification settings - Fork 5k
add markup #5446
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
base: master
Are you sure you want to change the base?
add markup #5446
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,10 +9,42 @@ | |
| <title>Calendar</title> | ||
| <link | ||
| rel="stylesheet" | ||
| href="styles/index.scss" | ||
| href="styles/main.scss" | ||
| /> | ||
| </head> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <body> | ||
| <h1>Calendar</h1> | ||
| <div 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The requirement says "limit its width to exactly 7 columns + 10px paddings" and to use variables for these calculations. Here your
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i use additional paddings and do not add this padings to width There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The calendar width is currently computed as This is the same issue noted in the previous review and remains blocking until fixed. |
||
| <div class="calendar__day"></div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You define the basic dimensions and styles of the day cell, but you don’t add any hover effects (pointer cursor, pink |
||
| <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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| <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> | ||
| </body> | ||
| </html> | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| @import './variables'; | ||
|
|
||
| body { | ||
| margin: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100vh; | ||
| } | ||
|
|
||
| .calendar { | ||
| display: flex; | ||
| gap: $gap; | ||
| flex-wrap: wrap; | ||
|
|
||
| box-sizing: border-box; | ||
|
|
||
| padding: $day-padding; | ||
|
|
||
| width: $columns * $day-size + calc(7 - 1) * $gap + (2 * $day-padding); | ||
|
|
||
| font-family: Arial, Helvetica, sans-serif; | ||
| font-size: 30px; | ||
|
|
||
| &__day { | ||
| height: $day-size; | ||
| width: $day-size; | ||
|
|
||
| padding: $day-padding; | ||
|
|
||
| box-sizing: border-box; | ||
| border: $border; | ||
| background-color: $day-background-color; | ||
|
|
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| transition-duration: 0.5s; | ||
|
|
||
| &:hover { | ||
| cursor: pointer; | ||
| background-color: $hover-day-color; | ||
| transform: translateY(-20px); | ||
| } | ||
| } | ||
|
|
||
| @each $margin, $day in $start-days { | ||
| &--start-day-#{$day} &__day:first-child { | ||
| margin-left: $margin; | ||
| } | ||
| } | ||
|
|
||
| @for $day from 1 through $days-in-month { | ||
| & &__day:nth-child(#{$day}) { | ||
| &::before { | ||
| content: '#{$day}'; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @for $length from 28 through 31 { | ||
| &--month-length-#{$length} &__day:nth-child(n + #{$length + 1}) { | ||
| display: none; | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| $gap: 1px; | ||
| $border: 1px solid black; | ||
| $day-background-color: #eee; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The calendar container is not centered horizontally and vertically in the viewport as required; you need additional layout styles (e.g. on |
||
| $day-size: 100px; | ||
| $columns: 7; | ||
| $day-padding: 10px; | ||
| $days-in-month: 31; | ||
| $hover-day-color: #ffbfcb; | ||
| $start-days: ( | ||
| 0 'mon', | ||
| ($day-size + $gap) 'tue', | ||
| (($day-size + $gap) * 2) 'wed', | ||
| (($day-size + $gap) * 3) 'thu', | ||
| (($day-size + $gap) * 4) 'fri', | ||
| (($day-size + $gap) * 5) 'sat', | ||
| (($day-size + $gap) * 6) 'sun' | ||
| ); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
width: $colums * $day-size + 6 * $gap;does not implement the spec: it doesn’t include the 10px paddings on both sides and$columsis a misspelling; revise this to use correctly named variables and include padding in the width calculation per the task requirements.