UNPKG

animarte

Version:

Making the digital world a little more animated place

45 lines (43 loc) 1.25 kB
.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 .animarte-semicircle__element { width: 100%; height: 100%; border-radius: 100vw; background-color: transparent; border-color: currentColor; border-style: solid; border-width: calc(var(--animarte-size) * 0.1); animation-iteration-count: infinite, infinite; animation-duration: var(--animarte-speed), var(--animarte-speed); animation-timing-function: linear, linear; animation-direction: alternate, normal; animation-name: changeShapeKeyframes, spinKeyframes; } @keyframes spinKeyframes { 100% { transform: rotate(360deg); } } @keyframes changeShapeKeyframes { 0% { clip-path: polygon(50% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%); } 25% { clip-path: polygon(50% 50%, 100% 0%, 100% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%); } 75% { clip-path: polygon(50% 50%, 0% 0%, 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 100%); } 100% { clip-path: polygon(50% 50%, 0% 50%, 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 50%); } }