animarte
Version:
Making the digital world a little more animated place
74 lines (71 loc) • 1.65 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-2 .animarte-ellipsis__element {
position: absolute;
animation-timing-function: ease;
animation-duration: var(--animarte-speed);
top: 50%;
}
.animarte-ellipsis--one-for-all-2 .animarte-ellipsis__element:nth-child(1) {
animation-name: ellipsisOneForAll2Left;
}
.animarte-ellipsis--one-for-all-2 .animarte-ellipsis__element:nth-child(2) {
left: 50%;
transform: translate(-50%, -50%);
animation-name: ellipsisOneForAll2Middle;
}
.animarte-ellipsis--one-for-all-2 .animarte-ellipsis__element:nth-child(3) {
animation-name: ellipsisOneForAll2Right;
}
@keyframes ellipsisOneForAll2Left {
0%, 100% {
left: 0;
transform: translate(0, -50%);
}
50% {
left: 50%;
transform: translate(-50%, -50%);
}
}
@keyframes ellipsisOneForAll2Middle {
0% {
width: var(--width);
height: var(--height);
}
50% {
width: calc(2 * var(--width));
height: calc(2 * var(--height));
}
}
@keyframes ellipsisOneForAll2Right {
0%, 100% {
left: 100%;
transform: translate(-100%, -50%);
}
50% {
left: 50%;
transform: translate(-50%, -50%);
}
}