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

add changes in README.md, src folder #3874

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -33,8 +33,8 @@ On hovering over a cell:

❗️ 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://TargoniyAnatoliy.github.io/ma-layout_calendar/)
- [TEST REPORT LINK](https://TargoniyAnatoliy.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
66 changes: 64 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,69 @@
href="styles/index.scss"
/>
</head>
<body>
<h1>Calendar</h1>
<body class="page">
<aside 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>

Choose a reason for hiding this comment

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

I think that all the empty lines are redundant)

Suggested change
<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>

Copy link
Author

Choose a reason for hiding this comment

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

I made empty lines because AI Buddy recommended

<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>
</aside>
</body>
</html>
55 changes: 55 additions & 0 deletions src/styles/_calendar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.calendar {
box-sizing: border-box;
padding: $padding;
width: ($padding * 2) + ($gap * 6) + ($size * 7);

Choose a reason for hiding this comment

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

what do these variables refer to?
I can't figure it out from their name.
Change the variable names

Suggested change
width: ($padding * 2) + ($gap * 6) + ($size * 7);
width: ($.....* 2) + ($....* 6) + ($.....* 7);

display: flex;
align-items: center;
gap: $gap;
flex-wrap: wrap;

&__day {
box-sizing: border-box;

Choose a reason for hiding this comment

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

maybe this will be a better solution in this case?
this property will work for the entire project

* {
  box-sizing: border-box;
}

Copy link
Author

Choose a reason for hiding this comment

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

the instructions recommend avoiding this selector so as not to decrease performance

width: $size;
height: $size;
background-color: $main-bg;
border: $border;
position: relative;
transition: all 0.5s;

&::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
top: 0;
display: flex;
align-items: center;
justify-content: center;
}

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

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

@each $day, $margin in (mon: 0, tue: 1, wed: 2, thu: 3, fri: 4, sat: 5, sun: 6)

Choose a reason for hiding this comment

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

create a variable for it

Suggested change
@each $day, $margin in (mon: 0, tue: 1, wed: 2, thu: 3, fri: 4, sat: 5, sun: 6)
@each $day, $margin in $weekDays

{
.calendar--start-day-#{$day} .calendar__day:nth-child(1) {
margin-left: ($size + $gap) * $margin;
}
}

@for $days from 28 through 31 {
.calendar--month-length-#{$days} .calendar__day:nth-child(n + #{$days + 1}) {
display: none;
}
}
13 changes: 13 additions & 0 deletions src/styles/_page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;

font: {
family: $font;
size: $font-size;
}
TargoniyAnatoliy marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

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

The use of nested properties for the 'font' shorthand is incorrect. According to CSS syntax, 'font' should be a single shorthand property, not a nested block. You should use 'font-family' and 'font-size' separately or use the 'font' shorthand correctly.

}
9 changes: 9 additions & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$main-bg: #eee;
$hover-bg: #ffbfcb;
$size: 100px;
$font: Arial, sans-serif;
$font-size: 30px;
$hover-offset: 20px;
$gap: 1px;
$padding: 10px;
$border: 1px solid black;

Choose a reason for hiding this comment

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

u don't need a variables for it. don't create normal variables for fonts. moreover - u use it only once

Suggested change
$font: Arial, sans-serif;
$font-size: 30px;
$hover-offset: 20px;
$gap: 1px;
$padding: 10px;
$border: 1px solid black;
$gap: 1px;
$padding: 10px;

6 changes: 3 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
body {
margin: 0;
}
@import 'variables';
@import 'page';
@import 'calendar';
Loading