UNPKG

animarte

Version:

Making the digital world a little more animated place

58 lines (56 loc) 1.38 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-blocks--dancing-2 .animarte-blocks__element { display: grid; grid-template: 1fr 1fr/1fr 1fr; position: absolute; left: 50%; top: 50%; width: 70%; height: 70%; } .animarte-blocks--dancing-2 .animarte-blocks__element:nth-of-type(1) { transform: translate(-50%, -50%) rotate(45deg); } .animarte-blocks--dancing-2 .animarte-blocks__element:nth-of-type(2) { transform: translate(-50%, -50%) rotate(-45deg); } .animarte-blocks--dancing-2 .animarte-blocks__element:nth-of-type(3) { transform: translate(-50%, -50%) rotate(135deg); } .animarte-blocks--dancing-2 .animarte-blocks__element:nth-of-type(4) { transform: translate(-50%, -50%) rotate(-135deg); } .animarte-blocks--dancing-2 .animarte-blocks__element::before { content: ""; display: block; position: relative; background: currentColor; animation-iteration-count: infinite; animation-duration: var(--animarte-speed); animation-name: blockDancing2; } @keyframes blockDancing2 { 0% { top: 0%; left: 0%; } 50% { top: 0%; left: 100%; border-radius: calc(var(--animarte-size) / 2); scale: 0.5; } 100% { top: 100%; left: 100%; } }