Skip to content

Add task solution#5213

Open
damian-k-dev wants to merge 3 commits intomate-academy:masterfrom
damian-k-dev:develop
Open

Add task solution#5213
damian-k-dev wants to merge 3 commits intomate-academy:masterfrom
damian-k-dev:develop

Conversation

@damian-k-dev
Copy link

  • DEMO LINK

  • TEST REPORT LINK

  • 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 ❗️

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great job on this calendar! Your use of BEM and SCSS features is well-executed. However, a few adjustments are needed to meet all the project's requirements.

Here are the key issues to address:

  • Animation Duration: The hover animation for the transform property is set to 2s, but the requirement is 0.5s for all transitions.
  • Sass Calculation Error: The margin-left calculation for the starting day adds a unitless number to a pixel value (($index * $field-size) + $index), which will cause the Sass compilation to fail. Please ensure the units are compatible, for example, by adding the gap width explicitly: ($index * 1px).
  • Layout and Sizing: The calendar has a fixed height, which prevents it from adapting to months with fewer weeks. The height should be determined by the content. Additionally, the total width calculation is missing the required 10px of padding on the container.
  • File Naming: The task requires the stylesheet to be named main.scss, but it's currently index.scss. Please rename the file and update the <link> in your HTML.

Once these points are addressed, your solution will be in great shape. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 4 to 5
$calendar-size: 706px;
$field-size: calc(($calendar-size - 6px) / 7);

Choose a reason for hiding this comment

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

The calculation here is a bit indirect. The primary requirement is that each day is a 100px square. It would be clearer to define the size of a day first (e.g., $field-size: 100px;), and then calculate the total calendar width based on that. This makes the code's intent more obvious and easier to maintain.


.calendar {
width: $calendar-size;
height: $calendar-size;

Choose a reason for hiding this comment

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

You've set a fixed height for the calendar, making it a square. This doesn't adapt to the content, which can have a varying number of rows (e.g., 5 or 6) depending on the month's start day. A fixed height can create unnecessary empty space inside the calendar block. The height should be determined by its content.

background-color: $grey;
transition:
background-color 0.5s,
transform 2s;

Choose a reason for hiding this comment

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

The task requires all hover animations to have a duration of 0.5s. The transform animation is currently set to 2s.

@each $day, $index in $days {
&--start-day-#{$day} {
.calendar__day:first-child {
margin-left: ($index * $field-size) + $index;

Choose a reason for hiding this comment

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

This calculation will likely fail during Sass compilation. You are trying to add a unitless number ($index) to a pixel value ($index * $field-size), which is not allowed. To fix this, you need to ensure the units are compatible. You should add the total width of the gaps, which can be calculated as $index * 1px.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent work addressing the previous feedback! Your solution is nearly perfect, but I'm requesting one change to meet a core requirement. The task specifies that all hover animations must have a duration of 0.5s, but the transform property's transition is still set to 2s in src/styles/main.scss. Please update this value to match the requirement. As a minor suggestion, consider creating a variable for the 1px value used for gaps and borders to improve maintainability. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

$grey: #eee;
$pink: #ffbfcb;
$calendar-size: 706px;
$field-size: calc(($calendar-size - 6px) / 7);

Choose a reason for hiding this comment

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

According to the requirement 'Don't use hardcoded px values if they are used several times', it would be better to create a variable for the 1px gap/border size, for example: $gap: 1px;.

You could then use this variable to calculate the 6px value here (e.g., 6 * $gap), for the gap property on line 28, the border on line 33, and in the margin-left calculation on line 69. This improves maintainability.

background-color: $grey;
transition:
background-color 0.5s,
transform 2s;

Choose a reason for hiding this comment

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

The requirement states that all hover changes should be animated with a duration of 0.5s. The transform property still has a duration of 2s. Please ensure all transitions have the same 0.5s duration to meet the requirement.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent work on this revision! You've successfully addressed the feedback from the previous review by correcting the animation duration. Your solution now meets all the requirements perfectly. The SCSS is clean, well-structured, and makes great use of variables, loops, and the BEM methodology. This is a fantastic submission, and I am approving it. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants