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
170 changes: 5 additions & 165 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://SylwiaLeung.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
8 changes: 7 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
/>
</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.

This violates checklist item #1: Keyframes implemented using from/to + transform with rotate property, because you are using transform: rotateZ(0deg); instead of transform: rotate(0deg);. You should switch to rotate(...) to match the exact requirement.

<div class="stopwatch__minutes"></div>

<div class="stopwatch__seconds"></div>

<div class="stopwatch__center"></div>
</div>
</body>
</html>
80 changes: 80 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
@function toseconds($min) {
@return $min * 60s;
}

@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}

@mixin time-animation($name, $duration, $ease, $count) {
animation-name: $name;
animation-duration: $duration;
animation-timing-function: $ease;
animation-iteration-count: $count;
}

@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

body {
@include flex-center;

margin: 0;
min-height: 100vh;
}

.stopwatch {
@include flex-center;

width: 80vmin;
aspect-ratio: 1;
border: 1vmin dotted #000;
border-radius: 50%;

&__center {
position: relative;
width: 5vmin;
aspect-ratio: 1;
border-radius: 50%;
background-color: #f6a603;
}

&__minutes {
@include time-animation(rotation, toseconds(60), steps(60), infinite);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates the MEDIUM requirement from the task description: the minutes-hand animation duration should be expressed as 60min, not via toseconds(60); update this include to use a literal 60min to align with the wording and potential tests.


position: absolute;
z-index: -2;
bottom: 50%;
height: 20vmin;
width: 3vmin;
background-color: #0700ff;
transform-origin: 50% 100%;
}

&__seconds {
@include time-animation(rotation, 60s, linear, infinite);

position: absolute;
z-index: -1;
bottom: 50%;
height: 38vmin;
width: 1.5vmin;
background-color: #2c8000;
transform-origin: 50% 100%;
}

&--speed-up {
.stopwatch__minutes {
animation-duration: toseconds(10);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates the MEDIUM requirement from the task description: the speed-up minutes-hand duration should be 10min, not toseconds(10); consider replacing the helper here with a literal 10min value.

}

.stopwatch__seconds {
animation-duration: 10s;
}
}
}
Loading