animarte
Version:
Making the digital world a little more animated place
78 lines (75 loc) • 1.68 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--dancing-4 .animarte-ellipsis__element {
position: absolute;
animation-timing-function: ease-in-out;
animation-duration: var(--animarte-speed);
animation-iteration-count: infinite;
}
.animarte-ellipsis--dancing-4 .animarte-ellipsis__element:nth-of-type(1) {
animation-name: ellipsisDancing4Left;
}
.animarte-ellipsis--dancing-4 .animarte-ellipsis__element:nth-of-type(2) {
left: 50%;
bottom: 50%;
transform: translate(-50%, 50%);
}
.animarte-ellipsis--dancing-4 .animarte-ellipsis__element:nth-of-type(3) {
animation-name: ellipsisDancing4Right;
}
@keyframes ellipsisDancing4Left {
0%, 100% {
left: 50%;
bottom: 50%;
transform: translate(-50%, 50%);
}
33.33% {
left: 0%;
bottom: 0%;
transform: translate(0%, 0%);
}
66.66% {
left: 0%;
bottom: 100%;
transform: translate(0%, 100%);
}
}
@keyframes ellipsisDancing4Right {
0%, 100% {
left: 50%;
bottom: 50%;
transform: translate(-50%, 50%);
}
33.33% {
left: 100%;
bottom: 100%;
transform: translate(-100%, 100%);
}
66.66% {
left: 100%;
bottom: 0%;
transform: translate(-100%, 0%);
}
}