diff --git a/readme.md b/readme.md index b55608052f..d970569079 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://karolina0372.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..3d2273c0e9 100644 --- a/src/index.html +++ b/src/index.html @@ -17,6 +17,9 @@ /> -

Stop watch

+
+
+
+
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..778b3c55c1 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,76 @@ +@mixin hand($width, $height, $bg-color) { + position: absolute; + left: 50%; + top: 50%; + width: $width; + height: $height; + background-color: $bg-color; +} + body { margin: 0; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +} + +.stopwatch { + position: relative; + width: 80vmin; + height: 80vmin; + border: 1vmin dotted #000; + border-radius: 50%; + + &__seconds { + @include hand(38vmin, 1.5vmin, #2c8000); + + transform-origin: 0 50%; + transform: translateY(-50%) rotate(-90deg); + animation: rotate 60s linear infinite; + } + + &__minutes { + @include hand(20vmin, 3vmin, #0700ff); + + transform-origin: 0 50%; + transform: translateY(-50%) rotate(-90deg); + animation: rotate 3600s steps(60) infinite; + } + + &::before { + content: ''; + position: absolute; + left: 50%; + top: 50%; + width: 5vmin; + height: 5vmin; + background-color: #f6a603; + border-radius: 50%; + transform: translate(-50%, -50%); + z-index: 1; + } + + &--speed-up { + .stopwatch__seconds { + animation-duration: 10s; + } + + .stopwatch__minutes { + animation-duration: 600s; + } + } +} + +@keyframes rotate { + from { + transform-origin: left center; + transform: translateY(-50%) rotate(-90deg); + } + + to { + transform-origin: left center; + transform: translateY(-50%) rotate(270deg); + } }