Skip to content

Commit

Permalink
add first solution
Browse files Browse the repository at this point in the history
  • Loading branch information
BabaYoga23 committed Jan 8, 2025
1 parent 7d23622 commit 2187289
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs
## Checklist

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:
- [DEMO LINK](https://<your_account>.github.io/layout_stop-watch/)
- [DEMO LINK](https://BabaYoga23.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.

Expand Down
13 changes: 11 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
href="./styles/index.scss"
/>
</head>
<body>
<h1>Stop watch</h1>
<body class="page">
<div class="stopwatch">
<div class="stopwatch__circle">
<div
class="stopwatch__minutes-hand stopwatch__minutes-hand--speed-up"
></div>
<div
class="stopwatch__seconds-hand stopwatch__seconds-hand--speed-up"
></div>
</div>
</div>
</body>
</html>
77 changes: 76 additions & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
body {
$stopwatch-size: 80vmin;
$stopwatch-circle-size: 5vmin;
$minutes-hand-height: 20vmin;
$minutes-hand-width: 3vmin;
$seconds-hand-height: 38vmin;
$seconds-hand-width: 1.5vmin;
$start-hand-position: $stopwatch-circle-size / 2;

%flex-centering {
display: flex;
justify-content: center;
align-items: center;
}

.page {
@extend %flex-centering;

margin: 0;
height: 100vh;
}

.stopwatch {
@extend %flex-centering;

width: $stopwatch-size;
height: $stopwatch-size;
border: 1vmin dotted #000;
border-radius: 50%;

&__circle {
@extend %flex-centering;

height: $stopwatch-circle-size;
width: $stopwatch-circle-size;
background-color: #f6a603;
border-radius: 50%;
position: relative;
}

&__minutes-hand {
width: $minutes-hand-width;
height: $minutes-hand-height;
background-color: #0700ff;
position: absolute;
bottom: $start-hand-position;
z-index: -2;
animation: spin 3600s steps(60, jump-none) infinite;
transform-origin: bottom;

&--speed-up {
animation-duration: 600s;
}
}

&__seconds-hand {
width: $seconds-hand-width;
height: $seconds-hand-height;
background-color: #2c8000;
position: absolute;
bottom: $start-hand-position;
z-index: -1;
animation: spin 60s linear infinite;
transform-origin: bottom;

&--speed-up {
animation-duration: 10s;
}
}
}

@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

0 comments on commit 2187289

Please sign in to comment.