From 4be12e025dfb58ac41022666ea93b817c09a14af Mon Sep 17 00:00:00 2001 From: Anastasi Bielikova Date: Tue, 14 Jul 2026 14:01:49 +0300 Subject: [PATCH 1/2] add --- .github/workflows/test.yml-template | 29 ++++++++++++++ package-lock.json | 9 +++-- package.json | 2 +- readme.md | 2 +- src/index.html | 6 ++- src/styles/_stopwatch.scss | 60 +++++++++++++++++++++++++++++ src/styles/index.scss | 11 ++++++ 7 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test.yml-template create mode 100644 src/styles/_stopwatch.scss diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 0000000000..8b5743ecb4 --- /dev/null +++ b/.github/workflows/test.yml-template @@ -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 diff --git a/package-lock.json b/package-lock.json index 211b7ce4a6..2bddd01d6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,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", @@ -1230,10 +1230,11 @@ "dev": true }, "node_modules/@mate-academy/scripts": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.6.tgz", - "integrity": "sha512-b4om/whj4G9emyi84ORE3FRZzCRwRIesr8tJHXa8EvJdOaAPDpzcJ8A0sFfMsWH9NUOVmOwkBtOXDu5eZZ00Ig==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-2.1.3.tgz", + "integrity": "sha512-a07wHTj/1QUK2Aac5zHad+sGw4rIvcNl5lJmJpAD7OxeSbnCdyI6RXUHwXhjF5MaVo9YHrJ0xVahyERS2IIyBQ==", "dev": true, + "license": "MIT", "dependencies": { "@octokit/rest": "^17.11.2", "@types/get-port": "^4.2.0", diff --git a/package.json b/package.json index 5b13ea0068..3a8364c46a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/readme.md b/readme.md index b55608052f..a60030b4d6 100644 --- a/readme.md +++ b/readme.md @@ -32,7 +32,7 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ## Checklist ❗️ Replace `` with your GitHub username and copy the links to the `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_stop-watch/) +- [DEMO LINK](https://miabellaa.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. diff --git a/src/index.html b/src/index.html index 272a196488..e8b0626350 100644 --- a/src/index.html +++ b/src/index.html @@ -17,6 +17,10 @@ /> -

Stop watch

+
+
+
+
+
diff --git a/src/styles/_stopwatch.scss b/src/styles/_stopwatch.scss new file mode 100644 index 0000000000..a356fa2250 --- /dev/null +++ b/src/styles/_stopwatch.scss @@ -0,0 +1,60 @@ +.stopwatch { + height: 80vmin; + width: 80vmin; + border: 1vmin dotted #000; + border-radius: 50%; + position: relative; + + &__hand { + position: absolute; + bottom: 50%; + left: 50%; + transform: translateX(-50%); + transform-origin: bottom center; + + &--seconds { + height: 38vmin; + width: 1.5vmin; + background-color: #2c8000; + animation: tick-tock 60s linear infinite; + } + + &--minutes { + height: 20vmin; + width: 3vmin; + background-color: #0700ff; + animation: tick-tock 3600s steps(60) infinite; + } + } + + &--speed-up { + .stopwatch__hand--seconds { + animation-duration: 10s; + } + + .stopwatch__hand--minutes { + animation-duration: 600s; + } + } + + &__center { + height: 5vmin; + width: 5vmin; + background-color: #f6a603; + border-radius: 50%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10; + } +} + +@keyframes tick-tock { + from { + transform: translateX(-50%) rotate(0deg); + } + to { + transform: translateX(-50%) rotate(360deg); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..830909cebb 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,14 @@ +@import 'stopwatch'; + +html, body { + height: 100%; margin: 0; } + +body { + margin: 0; + display: flex; + justify-content: center; + align-items: center; +} From a18befcc9424ebce7d4ff5041d17d8bf0459145b Mon Sep 17 00:00:00 2001 From: Anastasi Bielikova Date: Tue, 14 Jul 2026 14:35:13 +0300 Subject: [PATCH 2/2] fix --- src/index.html | 2 +- src/styles/_stopwatch.scss | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index e8b0626350..8090fa6e13 100644 --- a/src/index.html +++ b/src/index.html @@ -17,7 +17,7 @@ /> -
+
diff --git a/src/styles/_stopwatch.scss b/src/styles/_stopwatch.scss index a356fa2250..b597d9580d 100644 --- a/src/styles/_stopwatch.scss +++ b/src/styles/_stopwatch.scss @@ -8,13 +8,14 @@ &__hand { position: absolute; bottom: 50%; - left: 50%; - transform: translateX(-50%); transform-origin: bottom center; + will-change: transform; + transform: rotate(0deg); &--seconds { height: 38vmin; width: 1.5vmin; + left: calc(50% - 0.75vmin); background-color: #2c8000; animation: tick-tock 60s linear infinite; } @@ -22,6 +23,7 @@ &--minutes { height: 20vmin; width: 3vmin; + left: calc(50% - 1.5vmin); background-color: #0700ff; animation: tick-tock 3600s steps(60) infinite; } @@ -52,9 +54,9 @@ @keyframes tick-tock { from { - transform: translateX(-50%) rotate(0deg); + transform: rotate(0deg); } to { - transform: translateX(-50%) rotate(360deg); + transform: rotate(360deg); } }