$timing: 1000ms*sqrt(2) infinite linear; html { height: 100%; width: 100%; } body { position: relative; height: 100%; width: 100%; background: black; color: white; padding: 50px; } section { position: absolute; top: 50%; left: 50%; margin: -500px/sqrt(2); width: 1000px/sqrt(2); height: 1000px/sqrt(2); overflow: hidden; background: black; } div { box-sizing: border-box; position: absolute; top: 50%; left: 50%; margin: -50%/sqrt(2); width: 100%/sqrt(2); height: 100%/sqrt(2); border-radius: 100%/sqrt(2)/4; transform: rotate(45deg); animation: rotate $timing; background: #fff; backface-visibility: hidden; overflow: visible; &.a { animation: zoom $timing; transform: scale(sqrt(2)*2); } &.e { background: #000; } &.tb { animation: tb $timing; } } @keyframes zoom { 0% { transform: rotate(0deg) scale(sqrt(2)*2); } 100% { transform: rotate(360deg) scale(sqrt(2)); } } @keyframes tb { 100% { opacity: 0; } }