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

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

Develop #4023

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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
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://Roksolana14>.github.io/layout_calendar/)
- [TEST REPORT LINK](https://Roksolana14.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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
Expand Down
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"
/>
</head>
<body>
<h1>Calendar</h1>
<ul class="calendar calendar--start-day-sun calendar--month-length-31">
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
<li class="calendar__day"></li>
</ul>
</body>
</html>
8 changes: 8 additions & 0 deletions src/styles/includes/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$size: 700px;
$columns: 7;
$calendar-day: ($size / $columns);
$col-gap: 1px;
$calendar-width: $size + ($col-gap * ($columns - 1));
$days: 'mon' 0, 'tue' 1, 'wed' 2, 'thu' 3, 'fri' 4, 'sat' 5, 'sun' 6;
$start-day: 'sun';
$month-length: 31;
52 changes: 52 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.calendar {
display: flex;
flex-wrap: wrap;
list-style: none;
gap: $col-gap;
width: $calendar-width;
padding: 10px;

&__day {
width: $calendar-day;
height: $calendar-day;
background-color: #eee;
box-sizing: border-box;
border: 1px solid black;
display: flex;
justify-content: center;
align-items: center;
transition: transform 0.5s;

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

@for $row from 1 through $month-length {
&:nth-child(#{$row})::before {
content: '#{$row}';
font-family: Arial, Helvetica, sans-serif;
font-size: 30px;
color: black;
}
}
}
}

@each $day, $i in $days {
.calendar--start-day-#{$day} :first-child {
margin-left: $calendar-day * $i + $i;
Comment on lines +46 to +47

Choose a reason for hiding this comment

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

The calculation for margin-left might be incorrect. The expression $calendar-day * $i + $i should likely be $calendar-day * $i + $col-gap * $i to account for the gap between columns. Ensure that the gap is considered in the calculation.

}
}

@for $i from 28 through $month-length {
.calendar--month-length-#{$i} :nth-child(n + #{$i + 1}) {
display: none;
}
}
2 changes: 2 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './includes/variables';
@import './index';
Loading