-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 #3496
base: master
Are you sure you want to change the base?
add task solution #3496
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,75 @@ | ||
@import './utils/variables'; | ||
@import './utils/mixins'; | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
.page { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.stopwatch { | ||
$duration: 60s; | ||
|
||
width: $watch-size; | ||
height: $watch-size; | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variables |
||
border: 1vmin dotted #000; | ||
border-radius: 50%; | ||
position: relative; | ||
|
||
&__minute { | ||
width: $minute-w; | ||
height: $minute-h; | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variables |
||
background-color: #0700ff; | ||
position: absolute; | ||
top: #{$watch-size / 2 - $minute-h}; | ||
left: #{($watch-size - $minute-w) / 2}; | ||
|
||
@include watch-animation( | ||
$duration * 60, | ||
(0.5 * $minute-w) $minute-h, | ||
steps(60, end) | ||
); | ||
Comment on lines
+32
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mixin |
||
|
||
.stopwatch--speed-up & { | ||
@include watch-animation( | ||
$speed-up-duration * 60, | ||
(0.5 * $minute-w) $minute-h, | ||
steps(60, end) | ||
); | ||
} | ||
} | ||
|
||
&__second { | ||
width: $sec-w; | ||
height: $sec-h; | ||
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variables |
||
background-color: #2c8000; | ||
position: absolute; | ||
top: #{0.5 * $watch-size - $sec-h}; | ||
left: #{0.5 * ($watch-size - $sec-w)}; | ||
|
||
@include watch-animation($default-duration, (0.5 * $sec-w) $sec-h, linear); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mixin |
||
|
||
.stopwatch--speed-up & { | ||
@include watch-animation( | ||
$speed-up-duration, | ||
(0.5 * $sec-w) $sec-h, | ||
linear | ||
); | ||
} | ||
} | ||
|
||
&__center { | ||
width: $center-size; | ||
height: $center-size; | ||
Comment on lines
+67
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
background-color: #f6a603; | ||
border-radius: 50%; | ||
position: absolute; | ||
top: #{0.5 * ($watch-size - $center-size)}; | ||
left: #{0.5 * ($watch-size - $center-size)}; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@mixin watch-animation($mix-duration, $tr-origin, $t-func) { | ||
|
||
& { | ||
transform-origin: $tr-origin; | ||
animation: move $mix-duration $t-func infinite; | ||
} | ||
|
||
@keyframes move { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$watch-size: 80vmin; | ||
$minute-w: 3vmin; | ||
$minute-h: 20vmin; | ||
$sec-w: 1.5vmin; | ||
$sec-h: 38vmin; | ||
$center-size: 5vmin; | ||
$default-duration: 60s; | ||
$speed-up-duration: $default-duration / 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the files './utils/variables' and './utils/mixins' exist and contain the necessary variable and mixin definitions used in this SCSS file. Without these definitions, the SCSS compilation will fail.