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 #3935

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

Develop #3935

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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ 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://kwagfn.github.io/layout_calendar/)
- [TEST REPORT LINK](https://kwagfn.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.

- [ ] Changing 'month-lengh' and 'start-day' modifier in the code element
- [x] Changing 'month-lengh' and 'start-day' modifier in the code element
reflects in changing calendar layout
- [ ] Each day has no modifiers, only class (eg. calendar__day)
- [ ] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [ ] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
- [x] Each day has no modifiers, only class (eg. calendar__day)
- [x] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [x] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
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 main.scss, which is incorrect. It should point to the compiled CSS file, typically main.css, after the SCSS is processed. Ensure that your build process compiles SCSS to CSS and update the link accordingly.

/>
</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>
<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>
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

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

$calendar-day-width: 100px;

.calendar {
width: $calendar-day-width * 7 + 6px;
display: flex;
flex-wrap: wrap;
gap: 1px;

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

@each $day, $i in $days {
&--start-day-#{$day} {
.calendar__day:nth-child(1) {
margin-left: (
$calendar-day-width * ($i) + ($calendar-day-width * ($i) / 100)
Comment on lines +30 to +31

Choose a reason for hiding this comment

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

The margin-left calculation for the first day of the week seems to be adding an extra percentage-based margin. Verify if this is intentional and aligns with your design intentions. If not, consider adjusting the calculation.

);
}
}
}

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

&__day {
box-sizing: border-box;

width: $calendar-day-width;
height: $calendar-day-width;

background-color: #eee;
border: 1px solid black;

align-content: center;
text-align: center;

font-family: Arial, sans-serif;
font-size: 30px;

cursor: pointer;

transition: all 500ms ease;

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

@for $i from 1 through 31 {
&:nth-child(#{$i}):before {
content: '#{$i}';
}
}
}
}
Loading