UNPKG

three-dots

Version:

CSS loading animations made with single element

55 lines (44 loc) 959 B
/** * ============================================== * Experimental: Gooey Effect * Dot Shuttle * ============================================== */ @d: 3 * @dot-spacing; @dot-color-hsl: hsl(0, 100%, 0%); .dot-shuttle { .dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent); position: relative; left: -@dot-spacing; margin: -1px 0; filter: blur(2px); &::before, &::after { .dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent); content: ''; display: inline-block; position: absolute; top: 0; filter: blur(2px); } &::before { left: @dot-spacing; animation: dot-shuttle 2s infinite ease-out; } &::after { left: 2 * @dot-spacing; } } @keyframes dot-shuttle { 0%, 50%, 100% { transform: translateX(0); } 25% { transform: translateX(-@d); } 75% { transform: translateX(@d); } }