Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task solution #3596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://IvanRyabukha.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
15 changes: 12 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!doctype html>
<html lang="en">
<html

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <html> tag is incorrectly self-closed. HTML tags like <html> should not be self-closed. Remove the self-closing slash to correct this.

lang="en"
class="stopwatch stopwatch--speed-up"
>
<head>
<meta charset="UTF-8" />
<meta
Expand All @@ -16,7 +19,13 @@
href="./styles/index.scss"
/>
</head>
<body>
<h1>Stop watch</h1>
<body class="stopwatch__body">
<div class="stopwatch__watch">
<div class="stopwatch__minute"></div>

<div class="stopwatch__second"></div>

<div class="stopwatch__center"></div>
</div>
</body>
</html>
78 changes: 76 additions & 2 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
body {
margin: 0;
@keyframes move-hand {
0% {
transform: rotate(0);
}

100% {
transform: rotate(360deg);
}
}

.stopwatch {
&__body {
margin: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}

&__watch {
position: relative;
width: 80vmin;
height: 80vmin;

border: 1vmin dotted #000;
border-radius: 50%;
}

&__minute {
position: absolute;
bottom: 40vmin;
left: 40vmin - 1.5vmin;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation left: 40vmin - 1.5vmin; might not work as expected because CSS does not support arithmetic operations directly. Consider using a preprocessor function or adjust the value manually.

height: 20vmin;
width: 3vmin;

transform-origin: bottom center;
background-color: #0700ff;
animation: move-hand 3600s steps(60) infinite;
}

&__second {
position: absolute;
bottom: 40vmin;
left: 40vmin - 0.75vmin;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment, the calculation left: 40vmin - 0.75vmin; might not work as expected. Consider using a preprocessor function or adjust the value manually.

height: 38vmin;
width: 1.5vmin;

transform-origin: bottom center;
background-color: #2c8000;
animation: move-hand 60s linear infinite;
}

&__center {
position: absolute;
top: 40vmin - 2.5vmin;
left: 40vmin - 2.5vmin;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation top: 40vmin - 2.5vmin; might not work as expected. Consider using a preprocessor function or adjust the value manually.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation left: 40vmin - 2.5vmin; might not work as expected. Consider using a preprocessor function or adjust the value manually.

height: 5vmin;
width: 5vmin;

border-radius: 50%;
background-color: #f6a603;
}

&--speed-up {
.stopwatch__second {
animation: move-hand 10s linear infinite;
}

.stopwatch__minute {
animation: move-hand 600s steps(60) infinite;
}
}
}
Loading