animarte
Version:
Making the digital world a little more animated place
72 lines (70 loc) • 2.11 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-semicircle--growing-2 .animarte-semicircle__element {
display: grid;
width: 100%;
height: 100%;
border-radius: 100vw;
border-color: currentColor;
border-style: solid;
border-width: calc(var(--animarte-size) * 0.1);
padding: calc(var(--animarte-size) * 0.1);
}
.animarte-semicircle--growing-2 .animarte-semicircle__element::before {
content: "";
grid-area: 1/1;
border-radius: 100vw;
background: currentColor;
animation-iteration-count: infinite, infinite;
animation-duration: var(--animarte-speed), var(--animarte-speed);
animation-timing-function: linear, linear;
animation-name: semicircleGrowing2ChangeForm, semicircleGrowing2Spin;
}
@keyframes semicircleGrowing2Spin {
100% {
transform: rotate(360deg);
}
}
@keyframes semicircleGrowing2ChangeForm {
0% {
clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
}
6.25% {
clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
}
18.75% {
clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%, 100% 100%);
}
31.25% {
clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 100%, 0% 100%);
}
43.75% {
clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 0% 0%);
}
50% {
clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
}
56.25% {
clip-path: polygon(50% 50%, 100% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
}
68.75% {
clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
}
81.25% {
clip-path: polygon(50% 50%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 0%, 50% 0%);
}
93.75% {
clip-path: polygon(50% 50%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 50% 0%);
}
100% {
clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
}
}