Skip to content
Open

Develop #4218

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
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs
## Checklist

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:
- [DEMO LINK](https://<your_account>.github.io/layout_stop-watch/)
- [DEMO LINK](https://SHNELIA.github.io/layout_stop-watch/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

- [ ] Keyframes implemented using from/to + transform with rotate property
- [ ] Stopwatch is centered and has the correct arrows size
- [ ] All `Typical Mistakes` from the `BEM` lesson theory are checked.
- [ ] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
- [x] Keyframes implemented using from/to + transform with rotate property
- [x] Stopwatch is centered and has the correct arrows size
- [x] All `Typical Mistakes` from the `BEM` lesson theory are checked.
- [x] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
6 changes: 5 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
/>
</head>
<body>
<h1>Stop watch</h1>
<div class="stopwatch stopwatch--speed-up">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The HTML includes the required element with class stopwatch and the stopwatch--speed-up modifier which tests expect. However, many visual and animation requirements are missing because corresponding CSS/SCSS is not provided. Implement styles for: center the stopwatch (vertically and horizontally); set its size to 80vmin by 80vmin; add a 1vmin dotted round border with color #000; create minute and second hands with the exact lengths, widths and colors (minute: 20vmin length and 3vmin width, color #0700ff; second: 38vmin length and 1.5vmin width, color #2c8000); ensure the starting position of hands is at the top; add the center circle of diameter 5vmin and color #f6a603; animate infinitely; seconds hand must use a linear animation of 60s per full circle; minutes hand must use steps(60) over 60min; create rules for the stopwatch--speed-up modifier to change durations to 10s and 10min. Without these styles the task requirements are not met.

<div class="stopwatch__hand stopwatch__hand--minute"></div>
<div class="stopwatch__hand stopwatch__hand--second"></div>
Comment on lines +21 to +22

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You need to define .stopwatch__hand--second and .stopwatch__hand--minute with the exact sizes and colors from the task: seconds length 38vmin, width 1.5vmin, color #2c8000; minutes length 20vmin, width 3vmin, color #0700ff. Also set appropriate transform-origin so the hands start from the center and point to the top initially (rotate(0deg) should correspond to top).

<div class="stopwatch__center"></div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The center element .stopwatch__center is missing styling: define it as a circle with diameter 5vmin and background color #f6a603, positioned at the center of the stopwatch.

</div>
Comment on lines +20 to +24

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The HTML includes the required stopwatch block and the stopwatch--speed-up modifier — this satisfies the requirement to have an element with class stopwatch and the modifier present for tests. No change required here.

Comment on lines +20 to +24

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Implement the .stopwatch--speed-up modifier to override the animation durations: seconds should be 10s and minutes 10min when the modifier is present (e.g. via more specific rules or CSS variables). The modifier exists in HTML but its CSS behavior is missing.

</body>
</html>
8 changes: 8 additions & 0 deletions src/styles/animations.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@keyframes rotate {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires keyframes implemented using from/to + transform with rotate property (checklist item). Your keyframes use percentage syntax (0%/100%) instead of from/to. Also the keyframes include translateX which mixes positioning with rotation — the requirement expects rotate in transform for the keyframes. Please replace the @Keyframes with from/to and ensure transform contains rotate only (e.g. from { transform: rotate(0deg); } to { transform: rotate(360deg); }).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only the animations.scss file is provided but it doesn't satisfy the 'from/to' keyframes constraint and it's insufficient alone. Ensure you add/adjust CSS rules for .stopwatch, .stopwatch__hand--second, .stopwatch__hand--minute, .stopwatch__center, and the modifier .stopwatch--speed-up to change animation durations as specified in the description.

from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
Comment on lines +1 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The keyframes in animations.scss are correctly written using from/to and transform: rotate(...), matching the checklist item: "Keyframes implemented using from/to + transform with rotate property."

Comment on lines +1 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure the seconds hand animation uses a linear timing function and duration 60s (and infinite). The minutes hand must use animation-timing-function: steps(60) (or animation: ... steps(60)) and duration: 60min (and infinite). Also implement overrides in .stopwatch--speed-up to set seconds to 10s and minutes to 10min.

}
}
8 changes: 8 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@import './variables';
@import './animations';
@import './stopwatch';

body {
margin: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
55 changes: 55 additions & 0 deletions src/styles/stopwatch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.stopwatch {
position: relative;
width: 80vmin;
height: 80vmin;
border: 1vmin dotted $border-color;
border-radius: 50%;

&__center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 5vmin;
height: 5vmin;
background-color: $center-color;
border-radius: 50%;
z-index: 10;
}

&__hand {
position: absolute;
bottom: 50%;
left: 50%;
transform-origin: 50% 100%;
transform: translateX(-50%) rotate(0deg);

&--minute {
width: 3vmin;
height: 20vmin;
background-color: $minute-hand-color;
margin-left: -1.5vmin;
animation: rotate 60s steps(60) infinite;
}

&--second {
width: 1.5vmin;
height: 38vmin;
background-color: $second-hand-color;
margin-left: -0.75vmin;
animation: rotate 60s linear infinite;
}
}

&--speed-up {
.stopwatch__hand {
&--minute {
animation-duration: 600s;
}

&--second {
animation-duration: 10s;
}
}
}
}
4 changes: 4 additions & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$border-color: #000;
$center-color: #f6a603;
$minute-hand-color: #0700ff;
$second-hand-color: #2c8000;
Loading