animarte
Version:
Making the digital world a little more animated place
58 lines (55 loc) • 1.49 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--agitated .animarte-ellipsis__element {
position: relative;
display: flex;
align-items: flex-end;
background-color: transparent;
}
.animarte-ellipsis--agitated .animarte-ellipsis__element::before {
content: "";
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
animation-name: ellipsisAgitated;
animation-duration: var(--animarte-speed);
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
.animarte-ellipsis--agitated .animarte-ellipsis__element:nth-of-type(1)::before {
animation-delay: calc(var(--animarte-speed) / 4 * 1);
}
.animarte-ellipsis--agitated .animarte-ellipsis__element:nth-of-type(2)::before {
animation-delay: calc(var(--animarte-speed) / 4 * 2);
}
.animarte-ellipsis--agitated .animarte-ellipsis__element:nth-of-type(3)::before {
animation-delay: calc(var(--animarte-speed) / 4 * 3);
}
@keyframes ellipsisAgitated {
50% {
height: 50%;
}
}