animarte
Version:
Making the digital world a little more animated place
63 lines (60 loc) • 1.46 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--pendulum-2 .animarte-ellipsis__element {
position: absolute;
animation-timing-function: linear;
animation-duration: var(--animarte-speed);
top: 50%;
}
.animarte-ellipsis--pendulum-2 .animarte-ellipsis__element:nth-child(1) {
animation-name: ellipsisPendulum2Left;
}
.animarte-ellipsis--pendulum-2 .animarte-ellipsis__element:nth-child(2) {
left: 50%;
transform: translate(-50%, -50%);
}
.animarte-ellipsis--pendulum-2 .animarte-ellipsis__element:nth-child(3) {
animation-name: ellipsisPendulum2Right;
}
@keyframes ellipsisPendulum2Left {
0%, 25%, 75%, 100% {
left: calc(50% - var(--width));
transform: translate(-50%, -50%);
}
50% {
left: 0;
transform: translate(0, -50%);
}
}
@keyframes ellipsisPendulum2Right {
0%, 100% {
left: 100%;
transform: translate(-100%, -50%);
}
25%, 75% {
left: calc(50% + var(--width));
transform: translate(-50%, -50%);
}
}