Skip to content

Conversation

@wolfika
Copy link

@wolfika wolfika commented Oct 28, 2019

Added a new hexagon spinner, in the new lib structure this time.

hexa_no-rotation

@tobiasahlin
Copy link
Owner

Thanks @wolfika 🙏 let me have a look.


```html
<div class="sk-hexagon">
<div class="sk-hex-parent">
Copy link
Owner

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));
Copy link
Owner

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);
}
Copy link
Owner

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;
Copy link
Owner

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));
Copy link
Owner

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants