Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yevhen-baiev committed Feb 5, 2024
1 parent a209a9a commit ceaa8be
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 3 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Create a working stopwatch with minute and second hands using **only CSS animati
## 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://yevhen-baiev.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 @@ -9,6 +9,10 @@
<link rel="stylesheet" href="./styles/main.scss">
</head>
<body>
<h1>Stop watch</h1>
<div class="stopwatch">
<div class="stopwatch__minute-hand"></div>
<div class="stopwatch__second-hand"></div>
<div class="stopwatch__axis"></div>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions src/styles/blocks/body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
body {
margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
36 changes: 36 additions & 0 deletions src/styles/blocks/clock.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.stopwatch {
position: relative;
height: $clock-size;
width: $clock-size;
display: flex;
justify-content: center;
align-items: center;
border: 1vmin dotted black;
border-radius: 50%;

&__minute-hand {
position: absolute;
height: 20vmin;
width: 3vmin;
background-color: $minute-hand-color;
transform-origin: 50% 100%;
animation: rotate 600s linear infinite;
}

&__second-hand {
position: absolute;
height: 38vmin;
width: 1.5vmin;
background-color: $second-hand-color;
animation: rotate 10s linear infinite;
transform-origin: 50% 100%;
}

&__axis {
border-radius: 50%;
width: 5vmin;
height: 5vmin;
background-color: $axis-color;
z-index: 1;
}
}
5 changes: 4 additions & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// put code here
@import './utils/valiables';
@import './utils/keyframes';
@import './blocks/body';
@import './blocks/clock';
9 changes: 9 additions & 0 deletions src/styles/utils/keyframes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@keyframes rotate {
from {
transform: translateY(-50%) rotate(0deg);
}

to {
transform: translateY(-50%) rotate(360deg);
}
}
4 changes: 4 additions & 0 deletions src/styles/utils/valiables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$clock-size: 80vmin;
$second-hand-color: #2c8000;
$minute-hand-color: #0700ff;
$axis-color: orange;

0 comments on commit ceaa8be

Please sign in to comment.