Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Fridrif27 committed Oct 20, 2024
1 parent 1a6cc6c commit d854999
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In addition to the basic functionality create a BEM modifier called `speed-up` f
## Checklist

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:
- [DEMO LINK](https://<your_account>.github.io/layout_stop-watch/)
- [DEMO LINK](https://Fridrif27.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
8 changes: 6 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
href="./styles/index.scss"
/>
</head>
<body>
<h1>Stop watch</h1>
<body class="page">
<div class="stopwatch stopwatch--speed-up">
<span class="stopwatch__minute-hand"></span>
<span class="stopwatch__second-hand"></span>
<span class="stopwatch__center"></span>
</div>
</body>
</html>
83 changes: 82 additions & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
body {
.page {
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;

--border-color: #000;
--minute-hand: #0700ff;
--second-hand: #2c8000;
--center-color: #f6a603;
}

.stopwatch {
width: 80vmin;
height: 80vmin;
border: 1vmin dotted var(--border-color);
border-radius: 50%;
margin: 0;
position: relative;
display: flex;
align-items: center;
justify-content: center;

&__center {
display: block;
width: 5vmin;
height: 5vmin;
background-color: var(--center-color);
border-radius: 50%;
position: absolute;
}

&__minute-hand {
display: block;
width: 3vmin;
height: 20vmin;
background-color: var(--minute-hand);
position: absolute;
bottom: 50%;

transform-origin: bottom;
animation: move;
animation-iteration-count: infinite;
animation-delay: 0s;
animation-timing-function: steps(60, end);
animation-duration: 3600s;
}

&__second-hand {
display: block;
width: 1.5vmin;
height: 38vmin;
background-color: var(--second-hand);
position: absolute;
bottom: 50%;

transform-origin: bottom;
animation: move;
animation-iteration-count: infinite;
animation-delay: 0s;
animation-timing-function: linear;
animation-duration: 60s;
}
}

.stopwatch--speed-up {
.stopwatch__minute-hand {
animation-duration: 600s;
}
.stopwatch__second-hand {
animation-duration: 10s;
}
}

@keyframes move {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

0 comments on commit d854999

Please sign in to comment.