Skip to content
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
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": "^2.1.3",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ 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://znaumova.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.

Expand Down
13 changes: 10 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!doctype html>

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). You do have a @keyframes rotate using from/to and rotate, but alone it's not enough — the stylesheet must apply separate animations to seconds and minutes hands with the required timing functions and durations. Currently there is no CSS targeting .stopwatch, .stopwatch__hand--seconds, .stopwatch__hand--minutes, or .stopwatch__center-circle, so the animations and styles are missing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requirement: "Minutes hand animation: steps animation with 60 steps; duration 60min for a full circle." There is no animation defined for the minutes hand using animation-timing-function: steps(60) (or animation: ... steps(60)), nor the 60min duration. This must be added, and adjusted to 10min with .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.

File structure: index.scss imports variables, animation, page, and stopwatch. The animation.scss contains the rotate keyframes only. You must implement the rest of the required styles in stopwatch.scss (and variables if used). Without those files' contents, the task requirements are not met.

<html lang="en">
<html
lang="en"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requirement: "The starting position of the hands should be at the top." In your keyframes you animate rotate(0deg) to rotate(360deg), but you must ensure the initial transform of the hand elements points to top (12 o'clock). Currently there is no base transform: rotate(-90deg) (or equivalent) applied to the hands, so by default rotate(0deg) will point to 3 o'clock — this violates the starting position requirement.

class="page"
>
<head>
<meta charset="UTF-8" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requirement: "Seconds hand animation: even speed, without acceleration/deceleration; duration 60s for a full circle." Your keyframes are defined, but there is no animation property on the seconds hand element to set animation-timing-function: linear and animation-duration: 60s (and infinite). Add this for .stopwatch__hand--seconds and change to 10s when .stopwatch--speed-up is present.

<meta
Expand All @@ -16,7 +19,11 @@
href="./styles/index.scss"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Technical constraint: "Use only CSS animations for the stopwatch." Currently there is no JavaScript, which is fine, but ensure all behavior (including speed-up modifier effects) are accomplished purely via CSS. At the moment the CSS files provided don't implement the required behavior.

/>
</head>
<body>
<h1>Stop watch</h1>
<body class="page__body">
<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 .stopwatch stopwatch--speed-up which is required, but the implementation must also support the base case (60s / 60min) and the modifier must change durations to 10s / 10min. There is no CSS present to change animation durations based on .stopwatch--speed-up modifier — those rules are missing from the stylesheets.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requirement: "Stopwatch must have a size of 80vmin x 80vmin, centered vertically and horizontally, and have a 1vmin dotted round border with #000 color." There is no CSS defining the .stopwatch block layout, size, centering, or border — these are missing and must be implemented in stopwatch.scss or similar.

<div class="stopwatch__hand stopwatch__hand--minutes"></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.

Requirement: "Minutes hand should have length 20vmin, width 3vmin, color #0700ff; Seconds hand length 38vmin, width 1.5vmin, color #2c8000; center circle diameter 5vmin color #f6a603." There is no CSS implementing these measurements or colors for .stopwatch__hand--minutes, .stopwatch__hand--seconds, or .stopwatch__center-circle.

<div class="stopwatch__hand stopwatch__hand--seconds"></div>
<div class="stopwatch__center-circle"></div>
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions src/styles/animation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@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 animation keyframes file is present but there is only a single generic @Keyframes rotate. You need two animation usages: one for seconds using linear timing and 60s (and 10s in speed-up), and one for minutes using steps(60) and 60min (and 10min in speed-up). Ensure you apply the same keyframes (rotate from 0 to 360) but different animation properties on .stopwatch__hand--seconds and .stopwatch__hand--minutes. Right now only the keyframes are declared; the elements don't have animation declarations anywhere.

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 project is missing the variables file import content (variables.scss) in the listed files — index.scss imports './variables' but that file's content wasn't provided. Ensure variables are defined and verify there's no typo like $secondsHAndColor vs $secondsHandColor (previous review noted such typo). If that typo exists in variables.scss it will break color usage. Double-check variable names and correct any capitalization mistakes.

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

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 use the required from/to with transform rotate (this satisfies the checklist item about keyframes structure), but starting rotation of 0deg points to the right (3 o'clock). The task requires the hands to start at the top (12 o'clock). You should offset the initial orientation so rotate(0deg) corresponds to top — for example by rotating the hand elements by -90deg (apply transform: rotate(-90deg) to .stopwatch__hand or set keyframes/from accordingly).

}

to {
transform: rotate(360deg);
}
}
7 changes: 4 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
body {
margin: 0;
}
@import './variables';
@import './animation';
@import './page';
Comment on lines +1 to +3

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 currently animate from rotate(0deg) to rotate(360deg). Because rotate(0deg) points the hands to the right (3 o'clock), this violates the requirement: "The starting position of the hands should be at the top." Adjust the initial transform (for example by offsetting hand elements with transform: rotate(-90deg) or change keyframes to start from rotate(-90deg)).

@import './stopwatch';
Comment on lines +1 to +4

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 project is missing the SCSS that defines the stopwatch block and its elements (size 80vmin, centered on the page, 1vmin dotted border #000, hands lengths/widths/colors, center circle 5vmin orange, infinite animations with appropriate durations and step() for minutes). Implement these rules in src/styles/stopwatch.scss (or whichever file is imported) so all Core Functional Requirements are met.

Comment on lines +1 to +4

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 animation for the seconds hand must run with an even (linear) speed and take 60s per full circle; the minutes hand must use steps(60) and take 60min per full circle. Also create the BEM modifier .stopwatch--speed-up to change durations to 10s and 10min respectively. These animation rules are not present in the provided styles; please add them.

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

&__center-circle {
position: absolute;
height: 5vmin;
width: 5vmin;
background-color: $centerColor;
border-radius: 100%;
}

&__hand {
position: absolute;
transform-origin: bottom center;
bottom: 50%;
transform: rotate(-90deg);

&--minutes {
height: 20vmin;
width: 3vmin;
background-color: $minutesHandColor;
animation: rotate 3600s steps(60) infinite;
}

&--seconds {
height: 38vmin;
width: 1.5vmin;
background-color: $secondsHandColor;
animation: rotate 60s linear infinite;
}
}
}

.stopwatch--speed-up .stopwatch__hand--minutes {
animation: rotate 600s steps(60) infinite;
}

.stopwatch--speed-up .stopwatch__hand--seconds {
animation: rotate 10s linear infinite;
animation-delay: 0s;
}
5 changes: 5 additions & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$stopwatchDiameter: 80vmin;
$borderColor: #000;
$minutesHandColor: #0700ff;
$secondsHandColor: #2c8000;
$centerColor: #f6a603;
Loading