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

Open
wants to merge 2 commits 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
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://maponomarenko.github.io/layout_calendar/)
- [TEST REPORT LINK](https://maponomarenko.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
9 changes: 5 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
38 changes: 36 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,41 @@
href="styles/index.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 linking to a SCSS file (styles/index.scss). Browsers cannot directly interpret SCSS files. You need to compile the SCSS into a CSS file and link to the resulting CSS file instead.

/>

Choose a reason for hiding this comment

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

The href attribute is linking to an SCSS file (styles/index.scss). Browsers cannot interpret SCSS files directly. You need to compile your SCSS into a CSS file and link to that CSS file instead.

</head>
<body>
<h1>Calendar</h1>
<body class="page">

<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>
55 changes: 55 additions & 0 deletions src/styles/blocks/calendar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.page {
margin: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
}

.calendar {
display: flex;
flex-wrap: wrap;
width: $calendar-width;

Choose a reason for hiding this comment

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

Ensure that the variable $calendar-width is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $calendar-width is used here but is not defined in this file. Ensure that it is defined or imported from another file.

padding: 0;
margin: auto;
gap: $gap;

Choose a reason for hiding this comment

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

Ensure that the variable $gap is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $gap is used here but is not defined in this file. Ensure that it is defined or imported from another file.


&__day {
box-sizing: border-box;
width: $day-size;

Choose a reason for hiding this comment

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

Ensure that the variable $day-size is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $day-size is used here but is not defined in this file. Ensure that it is defined or imported from another file.

height: $day-size;
background-color: $day-color;

Choose a reason for hiding this comment

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

Ensure that the variable $day-color is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $day-color is used here but is not defined in this file. Ensure that it is defined or imported from another file.

border: $day-border;

Choose a reason for hiding this comment

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

Ensure that the variable $day-border is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $day-border is used here but is not defined in this file. Ensure that it is defined or imported from another file.

display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
font-size: $font-size;

Choose a reason for hiding this comment

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

Ensure that the variable $font-size is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $font-size is used here but is not defined in this file. Ensure that it is defined or imported from another file.

position: relative;

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

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

@each $day, $number in $weekdays {

Choose a reason for hiding this comment

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

Ensure that the variable $weekdays is defined. If it's not defined in this file, it should be imported from another SCSS file.

Choose a reason for hiding this comment

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

The variable $weekdays is used here but is not defined in this file. Ensure that it is defined or imported from another file.

&__start-day--#{$day}> :first-child {
margin-left: (($number - 1) * $day-size) + ($number - 1) * $gap;

}
}

@for $length from 28 through 31 {
&__month-length--#{$length}> :nth-child(n + #{$length + 1}) {
display: none;
}
}
}
15 changes: 15 additions & 0 deletions src/styles/blocks/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$day-size: 100px;
$day-color: #eee;
$day-border: 1px solid #000;
$font-size: 30px;
$gap: 1px;
$calendar-width: 7 * $day-size + 6 * $gap;
$weekdays: (
'mon' 1,
'tue' 2,
'wed' 3,
'thu' 4,
'fri' 5,
'sat' 6,
'sun' 7
);
5 changes: 2 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
body {
margin: 0;
}
@import './blocks/variables';
@import './blocks/calendar';
Loading