Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
berezandiana committed Dec 24, 2024
1 parent 7d23622 commit 2fc3292
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 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://berezandiana.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
6 changes: 5 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
/>
</head>
<body>
<h1>Stop watch</h1>
<div class="stopwatch stopwatch--speed-up">
<div class="stopwatch__minutes-hand"></div>
<div class="stopwatch__seconds-hand"></div>
<div class="stopwatch__center"></div>
</div>
</body>
</html>
65 changes: 65 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
@keyframes rotate-seconds {
from {
transform: translate(-50%, -100%) rotate(0deg);
}
to {
transform: translate(-50%, -100%) rotate(360deg);
}
}

body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.stopwatch {
position: relative;
height: 80vmin;
width: 80vmin;
border: 1vmin dotted #000;
border-radius: 50%;

&__minutes-hand {
height: 20vmin;
width: 3vmin;
background-color: #0700ff;
position: absolute;
left: 50%;
top: 50%;

transform-origin: 50% 100%;
animation: rotate-seconds 3600ms steps(60) infinite;
}

&__seconds-hand {
height: 38vmin;
width: 1.5vmin;
background-color: #2c8000;
position: absolute;
left: 50%;
top: 50%;

transform-origin: 50% 100%;
animation: rotate-seconds 60s linear infinite;
}

&__center {
position: absolute;
height: 5vmin;
width: 5vmin;
border-radius: 50%;
background-color: #f6a603;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

.stopwatch--speed-up {
.stopwatch__seconds-hand {
animation-duration: 10s;
}
.stopwatch__minutes-hand {
animation-duration: 600s;
}
}

0 comments on commit 2fc3292

Please sign in to comment.