From 962c59eb968e1add2e8b863b0d0d71dcda3959ae Mon Sep 17 00:00:00 2001 From: Daryna Date: Fri, 3 Jul 2026 20:53:15 +0300 Subject: [PATCH 1/2] add task solution --- readme.md | 2 +- src/index.html | 6 +++- src/styles/index.scss | 68 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index b55608052f..bcbd2fd0b5 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://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. diff --git a/src/index.html b/src/index.html index 272a196488..908f31b47d 100644 --- a/src/index.html +++ b/src/index.html @@ -17,6 +17,10 @@ /> -

Stop watch

+
+
+
+
+
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..6e44573269 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,71 @@ 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%); + 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; + } + + &--speed-up { + .stopwatch__hand--seconds { + animation-duration: 10s; + } + + .stopwatch__hand--minutes { + animation-duration: 600s; + } + } +} + +@keyframes rotate { + from { + transform: translateX(-50%) rotate(0deg); + } + + to { + transform: translateX(-50%) rotate(360deg); + } } From d5bd47f23c419c5e37884175ed7bd5b797890d9c Mon Sep 17 00:00:00 2001 From: Daryna Date: Fri, 3 Jul 2026 21:20:47 +0300 Subject: [PATCH 2/2] fix stopwatch animation and BEM modifier --- .github/workflows/test.yml-template | 29 +++++++++++++++++++++++++++++ package-lock.json | 9 +++++---- package.json | 2 +- src/styles/index.scss | 14 ++++++-------- 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/test.yml-template 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/src/styles/index.scss b/src/styles/index.scss index 6e44573269..f64cf85394 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -48,16 +48,14 @@ body { animation: rotate 60s linear infinite; } +} - &--speed-up { - .stopwatch__hand--seconds { - animation-duration: 10s; - } +.stopwatch--speed-up .stopwatch__hand--seconds { + animation-duration: 10s; +} - .stopwatch__hand--minutes { - animation-duration: 600s; - } - } +.stopwatch--speed-up .stopwatch__hand--minutes { + animation-duration: 600s; } @keyframes rotate {