-
Notifications
You must be signed in to change notification settings - Fork 5k
Test BackStopJS zaliczony #5447
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?
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 |
|---|---|---|
|
|
@@ -13,6 +13,38 @@ | |
| /> | ||
| </head> | ||
| <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> | ||
| <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. This still uses a hardcoded
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. Yes, it is, but it's only once in whole file, the task has nothing to do with it. It says:
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. Counting Callendar width with padding is stupidity and wrong in SCSS / CSS planing.. |
||
| <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> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| @use './main.scss'; | ||
|
|
||
| body { | ||
| margin: 0; | ||
|
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.
|
||
| display: flex; | ||
|
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. This violates checklist item #1: "Changing 'month-lengh' and 'start-day' modifier in the code element reflects in changing calendar layout" and the description requirement "Use flex with |
||
| justify-content: center; | ||
| align-items: center; | ||
|
Comment on lines
+6
to
+7
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.
|
||
| height: 100vh; | ||
|
Comment on lines
+7
to
+8
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. This still conflicts with checklist item #1 and #4: start-day alignment must use the same variable-based layout logic (including padding/gap) and avoid implicit repeated px-based offsets. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| $day-size: 100px; | ||
| $day-border-width: 1px; | ||
| $calendar-gap-width: 1px; | ||
| $calendar-column-number: 7; | ||
| $calendar-padding: 10px; | ||
| $calendar-grid-width: $day-size * $calendar-column-number; | ||
| $calendar-gaps: ($calendar-column-number - 1) * $calendar-gap-width; | ||
| $calendar-width: $calendar-grid-width + $calendar-gaps + 2 * $calendar-padding; | ||
|
|
||
| @function get-correction($n) { | ||
| @return ($n - 1) * ($day-size + $calendar-gap-width); | ||
| } | ||
|
|
||
| $days-margin: ( | ||
| 'mon': 0, | ||
| 'tue': get-correction(2), | ||
|
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 task requires the main styles to be written in |
||
| 'wed': get-correction(3), | ||
| 'thu': get-correction(4), | ||
| 'fri': get-correction(5), | ||
| 'sat': get-correction(6), | ||
| 'sun': get-correction(7), | ||
| ); | ||
|
|
||
| .calendar { | ||
| width: $calendar-width; | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: $calendar-gap-width; | ||
| padding: $calendar-padding; | ||
| box-sizing: border-box; | ||
|
|
||
| &__day { | ||
| width: $day-size; | ||
| min-width: $day-size; | ||
| height: $day-size; | ||
| border: $day-border-width solid black; | ||
| background-color: #eee; | ||
| font-size: 30px; | ||
| font-family: Arial, sans-serif; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| box-sizing: border-box; | ||
| transition: | ||
| transform 0.5s, | ||
| background-color 0.5s; | ||
|
|
||
| &:hover { | ||
| cursor: pointer; | ||
| background-color: #ffbfcb; | ||
| transform: translateY(-20px); | ||
| } | ||
| } | ||
|
|
||
| @for $i from 1 through 31 { | ||
| &__day:nth-child(#{$i})::before { | ||
| content: '#{$i}'; | ||
| } | ||
| } | ||
|
|
||
| @each $name, $margin in $days-margin { | ||
| &--start-day-#{$name} { | ||
| .calendar__day:first-child { | ||
| margin-left: #{$margin}; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @for $i from 28 through 31 { | ||
| &--month-length-#{$i} { | ||
| .calendar__day:nth-child(n + #{$i + 1}) { | ||
| display: none; | ||
| } | ||
| } | ||
| } | ||
| } | ||
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.
padding: 10px;repeats a hardcoded px value instead of using a named variable and is not reflected in$calendar-width. This breaks the requirement to avoid repeated magicpxvalues and to make all calculations clear with variables (checklist item #4). Consider creating$calendar-paddingand using it both here and in the width formula.