-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implement hexagon spinner (new structure) #144
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?
Conversation
|
Thanks @wolfika 🙏 let me have a look. |
|
|
||
| ```html | ||
| <div class="sk-hexagon"> | ||
| <div class="sk-hex-parent"> |
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.
Could we get rid of this sk-hex-parent element? It's only used for positioning that could be applied directly to the children, right?
|
|
||
| .sk-hex-child:nth-child(2), | ||
| .sk-hex-child:nth-child(3) { | ||
| top: calc(45 * var(--sk-hex-scale)); |
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.
There's a lot of calc usage in general here to position the three hexagons—could we just use %? They're just being centered horizontally or attached to a corner, right?
| 100% { | ||
| opacity: 0; | ||
| transform: scale(0) translateZ(0); | ||
| } |
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.
All keyframes that share all properties (like 100% and 0% can be defined on the same row 🙏
| .sk-hex-child { | ||
| animation: sk-hexagonAnimation 2s infinite cubic-bezier(.19, 1.6, .4, 1); | ||
| background-color: var(--sk-color); | ||
| display: block; |
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.
We don't need display: block when position is set to absolute 👀
| :root { | ||
| --sk-size: 40px; | ||
| --sk-color: #333; | ||
| --sk-hex-scale: (0.0096153846153846 * var(--sk-size)); |
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.
Where does this number come from? Why is it so exact? Can we get rid of if (if we get rid of the parent element)?
Added a new hexagon spinner, in the new lib structure this time.