Skip to content

Instantly share code, notes, and snippets.

@shshaw
Created June 8, 2018 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shshaw/e4f2c5c10489cb6636f417a1a34f3868 to your computer and use it in GitHub Desktop.
Save shshaw/e4f2c5c10489cb6636f417a1a34f3868 to your computer and use it in GitHub Desktop.
@Keyframes 1.8.2 | Overloadered 3
<div class="box"></div>
<div class="box"></div>
$duration: 4s;
.box {
height: 1em;
width: 1em;
font-size: 10vmin;
background-color: #fff;
position: absolute;
top: 50%;
left: 50%;
margin: -.5em;
transform-origin: top right;
animation: box-flip $duration ease-in-out infinite;
&:nth-child(2) {
animation-delay: #{$duration / -2};
}
}
@keyframes box-flip {
#{percentage(1/6)} {
transform: rotate(0);
}
#{percentage(2/6)} {
transform: rotate(.5turn);
}
#{percentage(3/6)} {
transform: rotate(.5turn);
}
#{percentage(4/6)} {
transform: rotate(.75turn);
}
#{percentage(5/6)} {
transform: rotate(.75turn);
}
#{percentage(6/6)} {
transform: rotate(1turn);
}
}
/* ---------------------------------- */
html, body {
background: #000;
height: 100%;
width: 100%;
display: flex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment