UNPKG

animarte

Version:

Making the digital world a little more animated place

63 lines (60 loc) 1.44 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; } .animarte-ellipsis--pendulum-1 .animarte-ellipsis__element { position: absolute; animation-timing-function: ease; animation-duration: var(--animarte-speed); top: 50%; } .animarte-ellipsis--pendulum-1 .animarte-ellipsis__element:nth-child(1) { animation-name: ellipsisPendulum1Left; } .animarte-ellipsis--pendulum-1 .animarte-ellipsis__element:nth-child(2) { left: 50%; transform: translate(-50%, -50%); } .animarte-ellipsis--pendulum-1 .animarte-ellipsis__element:nth-child(3) { animation-name: ellipsisPendulum1Right; } @keyframes ellipsisPendulum1Left { 0%, 100% { left: calc(50% - var(--width)); transform: translate(-50%, -50%); } 50% { left: 0; transform: translate(0, -50%); } } @keyframes ellipsisPendulum1Right { 0%, 100% { left: 100%; transform: translate(-100%, -50%); } 50% { left: calc(50% + var(--width)); transform: translate(-50%, -50%); } }