diff --git a/src/index.html b/src/index.html index 272a196488..61f10c2515 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..ddb5bcd652 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,70 @@ +@import './variables'; + +@keyframes rotate-full { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} + body { margin: 0; + height: 100vh; + width: 100vw; + display: flex; + justify-content: center; + align-items: center; +} + +.stopwatch { + display: flex; + justify-content: center; + align-items: center; + height: $watch-size; + width: $watch-size; + border-style: dotted; + border-width: $dot-size; + border-radius: 50%; + border-color: $dot-color; + position: relative; + + &--speed-up { + --minute-duration: 10s; + } + + &__center { + position: absolute; + height: $center-diametr; + width: $center-diametr; + background-color: $center-color; + border-radius: 50%; + z-index: 1; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + + &__minutes-hand, + &__seconds-hand { + position: absolute; + bottom: 50%; + transform-origin: bottom; + } + + &__minutes-hand { + height: $minutes-length; + width: $minutes-width; + background-color: $minutes-color; + animation: rotate-full calc(var(--minute-duration) * 60) steps(60) infinite; + } + + &__seconds-hand { + height: $seconds-length; + width: $seconds-width; + background-color: $seconds-color; + animation: rotate-full var(--minute-duration) linear infinite; + } } diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..b619608eb7 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,15 @@ +$watch-size: 80vmin; +$dot-size: 1vmin; +$dot-color: #000; +$minutes-length: 20vmin; +$minutes-width: 3vmin; +$minutes-color: #0700ff; +$seconds-length: 38vmin; +$seconds-width: 1.5vmin; +$seconds-color: #2c8000; +$center-diametr: 5vmin; +$center-color: #f6a603; + +:root { + --minute-duration: 60s; +}