Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_calendar/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_calendar/report/html_report/)
- [DEMO LINK](https://AdrJeeN.github.io/layout_calendar/)
- [TEST REPORT LINK](https://AdrJeeN.github.io/layout_calendar/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
36 changes: 35 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,40 @@
/>
</head>
<body>
<h1>Calendar</h1>
<main
class="calendar calendar--start-sun calendar--month-length-31 calendar--start-day-sun"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have class="calendar calendar--start-sun calendar--month-length-31 calendar--start-day-sun", but only calendar--start-day-* modifiers are defined in your SCSS and the description only mentions start-day modifier. The extra calendar--start-sun does nothing and doesn’t follow the specified modifier naming; remove it and rely on calendar--start-day-sun.

>
<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>
</main>
</body>
</html>
85 changes: 85 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
$square-size: 100px;
$border-weight: 1px;
$gap: 1px;
$padding: 10px;
$columns: 7;
$square-color: #eee;
$square-color-hover: #ffbfcb;
$font-family: Arial, Helvetica, sans-serif;
$font-size: 30px;
$transirtion-duration: 0.5s;

body {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task description requires: Write styles in src/styles/main.scss instead of src/style.css. Your HTML currently links to styles/index.scss, and the styles are in index.scss. This violates that requirement; move the styles to main.scss and update the href to point to styles/main.scss.

margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have class="calendar calendar--start-sun calendar--month-length-31 calendar--start-day-sun", but only calendar--start-day-sun is defined in SCSS. The extra calendar--start-sun modifier is unused and not part of the specified modifier set, which can conflict with checklist item #3 about typical BEM mistakes. Consider removing it and keep only calendar--start-day-sun (and calendar--month-length-31).

overflow: hidden;
}

.calendar {
max-width: calc((($square-size) * $columns) + (($columns - 1) * $gap));
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
gap: $gap;
margin: auto;
padding: $padding;

&__day {
position: relative;
height: $square-size;
width: $square-size;
border: $border-weight solid black;
background-color: $square-color;
font-size: $font-size;
font-family: $font-family;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition:
transform $transirtion-duration,
background-color $transirtion-duration;

&::before {
content: counter(day);
counter-increment: day;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

&:hover {
background-color: $square-color-hover;
transform: translateY(-20px);
}
}

&--start-day-sun {
.calendar__day:first-child {
margin-left: 0;
}
}

@each $day,
$margin in (mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6, sun: 7)
{
&--start-day-#{$day} {
.calendar__day:first-child {
margin-left: (($square-size + $gap) * ($margin - 1));
}
}
}

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

counter-reset: day;
}
Loading