animarte
Version:
Making the digital world a little more animated place
55 lines (52 loc) • 1.38 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--orbiting .animarte-ellipsis__element {
position: absolute;
}
.animarte-ellipsis--orbiting .animarte-ellipsis__element:nth-of-type(1) {
animation-direction: alternate;
}
.animarte-ellipsis--orbiting .animarte-ellipsis__element:nth-of-type(2) {
right: 50%;
transform: translateX(50%);
}
.animarte-ellipsis--orbiting .animarte-ellipsis__element:nth-of-type(3) {
animation-direction: alternate-reverse;
}
.animarte-ellipsis--orbiting .animarte-ellipsis__element:nth-of-type(1), .animarte-ellipsis--orbiting .animarte-ellipsis__element:nth-of-type(3) {
animation-name: ellipsisOrbiting;
animation-duration: var(--animarte-speed);
animation-timing-function: ease-in-out;
}
@keyframes ellipsisOrbiting {
0% {
right: 0%;
transform: translateX(0%);
}
100% {
right: 100%;
transform: translateX(100%);
}
}