animarte
Version:
Making the digital world a little more animated place
98 lines (95 loc) • 1.96 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--queue .animarte-ellipsis__element {
position: absolute;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: var(--animarte-speed);
}
.animarte-ellipsis--queue .animarte-ellipsis__element:nth-of-type(1) {
animation-name: ellipsisQueue1;
}
.animarte-ellipsis--queue .animarte-ellipsis__element:nth-of-type(2) {
animation-name: ellipsisQueue2;
}
.animarte-ellipsis--queue .animarte-ellipsis__element:nth-of-type(3) {
animation-name: ellipsisQueue3;
}
@keyframes ellipsisQueue1 {
0%, 40% {
right: 100%;
bottom: 50%;
transform: translate(100%, 50%);
}
100% {
right: 50%;
bottom: 50%;
transform: translate(50%, 50%);
}
}
@keyframes ellipsisQueue2 {
0%, 10% {
right: 50%;
bottom: 50%;
transform: translate(50%, 50%);
}
100% {
right: 0%;
bottom: 50%;
transform: translate(0%, 50%);
}
}
@keyframes ellipsisQueue3 {
0% {
right: 0%;
bottom: 50%;
transform: translate(0%, 50%);
}
20% {
right: 0%;
bottom: 50%;
transform: translate(100%, 50%);
}
40% {
right: 0%;
bottom: 0;
transform: translate(100%, 100%);
}
60% {
right: 100%;
bottom: 0;
transform: translate(0%, 100%);
}
80% {
right: 100%;
bottom: 50%;
transform: translate(0%, 50%);
}
100% {
right: 100%;
bottom: 50%;
transform: translate(100%, 50%);
}
}