animarte
Version:
Making the digital world a little more animated place
114 lines (111 loc) • 2.5 kB
CSS
.animarte {
position: relative;
isolation: isolate;
box-sizing: border-box;
overflow: hidden;
flex-shrink: 0;
width: var(--animarte-size);
height: var(--animarte-size);
color: var(--animarte-color);
}
.animarte-ellipsis {
display: flex;
justify-content: space-between;
align-items: center;
}
.animarte-ellipsis__element {
--width: 20%;
--height: 20%;
width: var(--width);
height: var(--height);
border-radius: 100vw;
background: currentColor;
animation-iteration-count: infinite;
}
.animarte-ellipsis--one-for-all-1 .animarte-ellipsis__element {
position: absolute;
animation-timing-function: linear;
animation-duration: var(--animarte-speed);
}
.animarte-ellipsis--one-for-all-1 .animarte-ellipsis__element:nth-child(1) {
animation-name: ellipsisOneForAll1Top;
left: 50%;
}
.animarte-ellipsis--one-for-all-1 .animarte-ellipsis__element:nth-child(2) {
top: 50%;
animation-name: ellipsisOneForAll1Right;
}
.animarte-ellipsis--one-for-all-1 .animarte-ellipsis__element:nth-child(3) {
left: 50%;
animation-name: ellipsisOneForAll1Bottom;
}
.animarte-ellipsis--one-for-all-1 .animarte-ellipsis__element:nth-child(4) {
top: 50%;
animation-name: ellipsisOneForAll1Left;
}
@keyframes ellipsisOneForAll1Top {
0%, 90%, 100% {
top: 0;
transform: translate(-50%, 0);
}
10%, 80% {
top: 50%;
transform: translate(-50%, -50%);
}
}
@keyframes ellipsisOneForAll1Right {
0%, 20%, 90%, 100% {
left: 100%;
transform: translate(-100%, -50%);
}
25% {
width: var(--width);
height: var(--height);
}
30% {
left: 50%;
transform: translate(-50%, -50%);
}
35%, 45% {
width: calc(1.5 * var(--width));
height: calc(1.5 * var(--height));
}
55%, 65% {
width: calc(2 * var(--width));
height: calc(2 * var(--height));
}
75% {
width: calc(2.5 * var(--width));
height: calc(2.5 * var(--height));
}
80% {
width: calc(2.5 * var(--width));
height: calc(2.5 * var(--height));
left: 50%;
transform: translate(-50%, -50%);
}
85% {
width: var(--width);
height: var(--height);
}
}
@keyframes ellipsisOneForAll1Bottom {
0%, 40%, 90%, 100% {
top: 100%;
transform: translate(-50%, -100%);
}
50%, 80% {
top: 50%;
transform: translate(-50%, -50%);
}
}
@keyframes ellipsisOneForAll1Left {
0%, 60%, 90%, 100% {
left: 0;
transform: translate(0, -50%);
}
70%, 80% {
left: 50%;
transform: translate(-50%, -50%);
}
}