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

calendar #3984

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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://olga-wukelan.github.io/layout_calendar/)
- [TEST REPORT LINK](https://olga-wukelan.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
39 changes: 36 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Calendar</title>
<link
rel="stylesheet"
href="styles/index.scss"
href="../src/main.scss"
Comment on lines 10 to +12

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 (../src/main.scss). Browsers cannot directly interpret SCSS files. You need to compile the SCSS into a CSS file and link to that CSS file instead.

/>
</head>

<body>
<h1>Calendar</h1>
<div class="calendar calendar--month-length-31 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>
</div>
</body>
</html>
11 changes: 11 additions & 0 deletions src/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import './styles/calendar';

body {
display: flex;
justify-content: center;
font-family: Arial, sans-serif;
margin: 0;
font-size: 30px;
align-items: center;
height: 100vh;
}
57 changes: 57 additions & 0 deletions src/styles/calendar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
$width-cube: 100px;
$height-cube: 100px;
$colums-in-the-row: (7 * $width-cube);
$max-days: 31;
$days-of-week: (
mon: 1,
tue: 2,
wed: 3,
thu: 4,
fri: 5,
sat: 6,
sun: 7,
);

@for $i from 1 through $max-days {
.calendar {
display: flex;
flex-wrap: wrap;
gap: 1px;
max-width: ($colums-in-the-row + 10px);

&__day {
display: flex;
box-sizing: border-box;
background-color: #eee;
justify-content: center;
align-items: center;
border: 1px solid #000;
width: $width-cube;
height: $height-cube;
font-size: 30px;
transition: all 0.5s ease;

&:nth-child(#{$i})::before {
content: '#{$i}';
}

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

@each $day, $value in $days-of-week {
.calendar--start-day-#{$day} :first-of-type {
margin-left: ($width-cube + 1px) * ($value - 1);
}
}

@for $i from 28 through $max-days {
.calendar--month-length-#{$i} :nth-child(n + #{$i + 1}) {
display: none;
}
}
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

Loading