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://fedorova-daryna.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
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">
<div class="stopwatch__hand stopwatch__hand--minutes"></div>
<div class="stopwatch__hand stopwatch__hand--seconds"></div>
<div class="stopwatch__center"></div>
</div>
</body>
</html>
66 changes: 66 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
body {
margin: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

.stopwatch {
width: 80vmin;
height: 80vmin;
border: 1vmin dotted #000;
border-radius: 50%;
position: relative;

&__center {
position: absolute;
width: 5vmin;
height: 5vmin;
background-color: #f6a603;
border-radius: 50%;

top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

&__hand {
position: absolute;
left: 50%;
bottom: 50%;
transform: translateX(-50%);
Comment on lines +28 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In @keyframes rotate you set transform: translateX(-50%) rotate(...), but .stopwatch__hand already has a transform: translateX(-50%); since transform is a single composite property, the keyframe values completely override the base transform. This means the hands’ centering/position is driven only by the keyframes and not the base rule. To keep the hands correctly centered at the top while rotating, ensure the transform used in animation consistently includes both translation and rotation from the start, and avoid conflicting base vs. animated transform definitions.

transform-origin: center bottom;
}

&__hand--minutes {
width: 3vmin;
height: 20vmin;
background-color: #0700ff;

animation: rotate 3600s steps(60) infinite;
}

&__hand--seconds {
width: 1.5vmin;
height: 38vmin;
background-color: #2c8000;

animation: rotate 60s linear infinite;
}
}

.stopwatch--speed-up .stopwatch__hand--seconds {
animation-duration: 10s;
}

.stopwatch--speed-up .stopwatch__hand--minutes {
animation-duration: 600s;
}

@keyframes rotate {
from {
transform: translateX(-50%) rotate(0deg);
}

to {
transform: translateX(-50%) rotate(360deg);
}
}
Loading