animarte
Version:
Making the digital world a little more animated place
98 lines (96 loc) • 3.42 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-settings {
--width: 15%;
--height: 25%;
--radius: calc((var(--animarte-size) - var(--height)) / 2);
animation-name: settingsGear1;
animation-duration: var(--animarte-speed);
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.animarte-settings--gear-1 .animarte-settings__element {
position: absolute;
left: calc(var(--x) + 5%);
top: var(--y);
width: var(--width);
height: var(--height);
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(1) {
--degree: calc(1 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(2) {
--degree: calc(2 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(3) {
--degree: calc(3 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(4) {
--degree: calc(4 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(5) {
--degree: calc(5 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(6) {
--degree: calc(6 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(7) {
--degree: calc(7 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(8) {
--degree: calc(8 * 45deg);
--x: calc(var(--radius) + var(--radius) * cos(var(--degree)));
--y: calc(var(--radius) + var(--radius) * sin(var(--degree)));
rotate: calc(var(--degree) - 90deg);
background: currentColor;
}
.animarte-settings--gear-1 .animarte-settings__element:nth-of-type(9) {
left: 50%;
top: 50%;
width: calc(var(--animarte-size) / 1.35);
height: calc(var(--animarte-size) / 1.35);
border-radius: 100svw;
translate: -50% -50%;
border: calc(var(--animarte-size) / 8) solid currentColor;
}
@keyframes settingsGear1 {
100% {
rotate: 360deg;
}
}