-
Notifications
You must be signed in to change notification settings - Fork 4k
add solution #4162
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
base: master
Are you sure you want to change the base?
add solution #4162
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,76 @@ | ||
| @mixin hand($width, $height, $bg-color) { | ||
| position: absolute; | ||
| left: 50%; | ||
| top: 50%; | ||
| width: $width; | ||
| height: $height; | ||
| background-color: $bg-color; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| height: 100vh; | ||
| } | ||
|
|
||
| .stopwatch { | ||
| position: relative; | ||
| width: 80vmin; | ||
| height: 80vmin; | ||
| border: 1vmin dotted #000; | ||
| border-radius: 50%; | ||
|
|
||
| &__seconds { | ||
|
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 task explicitly requires: "The starting position of the hands should be at the top." With the current combination of |
||
| @include hand(38vmin, 1.5vmin, #2c8000); | ||
|
|
||
| transform-origin: 0 50%; | ||
| transform: translateY(-50%) rotate(-90deg); | ||
| animation: rotate 60s linear infinite; | ||
|
Comment on lines
+26
to
+31
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. This still violates the requirement "The starting position of the hands should be at the top" and the previous review’s correction: with |
||
| } | ||
|
|
||
| &__minutes { | ||
| @include hand(20vmin, 3vmin, #0700ff); | ||
|
|
||
| transform-origin: 0 50%; | ||
| transform: translateY(-50%) rotate(-90deg); | ||
| animation: rotate 3600s steps(60) infinite; | ||
|
Comment on lines
+34
to
+39
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. This shares the same issue as the seconds hand: the minutes hand’s initial transform and |
||
| } | ||
|
|
||
| &::before { | ||
| content: ''; | ||
| position: absolute; | ||
| left: 50%; | ||
| top: 50%; | ||
| width: 5vmin; | ||
| height: 5vmin; | ||
| background-color: #f6a603; | ||
| border-radius: 50%; | ||
| transform: translate(-50%, -50%); | ||
| z-index: 1; | ||
| } | ||
|
|
||
| &--speed-up { | ||
| .stopwatch__seconds { | ||
| animation-duration: 10s; | ||
| } | ||
|
|
||
| .stopwatch__minutes { | ||
| animation-duration: 600s; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @keyframes rotate { | ||
| from { | ||
| transform-origin: left center; | ||
| transform: translateY(-50%) rotate(-90deg); | ||
| } | ||
|
|
||
| to { | ||
| transform-origin: left center; | ||
| transform: translateY(-50%) rotate(270deg); | ||
|
Comment on lines
+66
to
+74
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. This animation uses
Comment on lines
+66
to
+74
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. This keyframes definition violates checklist item #1: "Keyframes implemented using from/to + transform with rotate property" and the requirement that the hand starts at the top. You are animating |
||
| } | ||
| } | ||
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.
According to the description, "The starting position of the hands should be at the top." With the current SCSS (using
transform-origin: left centerand rotation around a horizontal axis from the center), these hands will appear horizontal, not pointing to the top of the circle. You should adjust the hand positioning/transform logic so that, with this markup, the hands are visually pointing up at the start of the animation.