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..7a0602a337 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://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. diff --git a/src/index.html b/src/index.html index 272a196488..f0f32f9e23 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,8 @@ - + - -

Stop watch

+ +
+
+
+
+
diff --git a/src/styles/animation.scss b/src/styles/animation.scss new file mode 100644 index 0000000000..8416cc366a --- /dev/null +++ b/src/styles/animation.scss @@ -0,0 +1,9 @@ +@keyframes rotate { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..31dfaf2a46 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import './variables'; +@import './animation'; +@import './page'; +@import './stopwatch'; diff --git a/src/styles/page.scss b/src/styles/page.scss new file mode 100644 index 0000000000..dd6fd0f1c0 --- /dev/null +++ b/src/styles/page.scss @@ -0,0 +1,7 @@ +.page__body { + margin: 0; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; +} diff --git a/src/styles/stopwatch.scss b/src/styles/stopwatch.scss new file mode 100644 index 0000000000..99f977820e --- /dev/null +++ b/src/styles/stopwatch.scss @@ -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; +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..1ed5c86a57 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,5 @@ +$stopwatchDiameter: 80vmin; +$borderColor: #000; +$minutesHandColor: #0700ff; +$secondsHandColor: #2c8000; +$centerColor: #f6a603;