UNPKG

animarte

Version:

Making the digital world a little more animated place

80 lines (77 loc) 1.94 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-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; } @property --ellipsis-dancing-1_angle { syntax: "<angle>"; initial-value: 0deg; inherits: true; } .animarte-ellipsis--dancing-1 .animarte-ellipsis__element { position: absolute; animation-timing-function: linear; animation-duration: var(--animarte-speed); } .animarte-ellipsis--dancing-1 .animarte-ellipsis__element:nth-of-type(1) { animation-name: ellipsisDancing1Left; } .animarte-ellipsis--dancing-1 .animarte-ellipsis__element:nth-of-type(2) { animation-name: ellipsisDancing1Middle; } .animarte-ellipsis--dancing-1 .animarte-ellipsis__element:nth-of-type(3) { --ellipsis-dancing-1_angle: 0deg; --radius: calc(var(--animarte-size) / 2 - 2.5 * var(--width)); left: calc(50% - var(--width) / 2); animation-timing-function: linear; animation-name: ellipsisDancing1Right; translate: calc(cos(var(--ellipsis-dancing-1_angle)) * var(--radius)) calc(sin(var(--ellipsis-dancing-1_angle) * -1) * var(--radius)); } @keyframes ellipsisDancing1Left { 0% { right: 100%; bottom: 50%; transform: translate(100%, 50%); } 100% { right: 50%; bottom: 50%; transform: translate(50%, 50%); } } @keyframes ellipsisDancing1Middle { 0% { right: 50%; bottom: 50%; transform: translate(50%, 50%); } 100% { right: 0%; bottom: 50%; transform: translate(0%, 50%); } } @keyframes ellipsisDancing1Right { to { --ellipsis-dancing-1_angle: 180deg; } }