animarte
Version:
Making the digital world a little more animated place
67 lines (65 loc) • 1.45 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-blocks--dancing-1 .animarte-blocks__element {
display: grid;
grid-template: 1fr 1fr/1fr 1fr;
position: absolute;
left: 50%;
top: 50%;
width: 75%;
height: 75%;
}
.animarte-blocks--dancing-1 .animarte-blocks__element:nth-of-type(1) {
transform: translate(-50%, -50%) rotate(45deg);
}
.animarte-blocks--dancing-1 .animarte-blocks__element:nth-of-type(2) {
opacity: 0.5;
transform: translate(-50%, -50%) rotate(-45deg);
}
.animarte-blocks--dancing-1 .animarte-blocks__element:nth-of-type(3) {
opacity: 0.5;
transform: translate(-50%, -50%) rotate(135deg);
}
.animarte-blocks--dancing-1 .animarte-blocks__element:nth-of-type(4) {
transform: translate(-50%, -50%) rotate(-135deg);
}
.animarte-blocks--dancing-1 .animarte-blocks__element::before {
content: "";
display: block;
position: relative;
margin: 7.5%;
background: currentColor;
animation-iteration-count: infinite;
animation-duration: var(--animarte-speed);
animation-name: blockDancing1;
}
@keyframes blockDancing1 {
0% {
top: 0%;
left: 0%;
}
25% {
top: 0%;
left: 100%;
}
50% {
top: 100%;
left: 100%;
}
75% {
top: 100%;
left: 0%;
}
100% {
top: 0%;
left: 0%;
}
}