Rotating Experiment CSS

HTML
<div class='wrapper'> <div class='inner'> <div></div> </div> <div class='overlay'> <div></div> </div> </div>
CSS
html, body { height: 100%; width: 100%; margin: 0; padding: 0; background: #F4F4F4; display: flex; justify-content: center; align-items: center; } .wrapper { margin-top: 50px; display: inline-block; position: relative; background: tomato; border-radius: 50%; background-size: cover; width: 300px; height: 300px; overflow: hidden; z-index: 1; } .inner { position: absolute; left: -25%; bottom: 50%; width: 150%; height: 50%; transform-origin: bottom center; overflow: hidden; animation: rotate 2s infinite linear; } .inner div { top: 0%; height: 200%; width: 100%; background-color: #2980b9; } .overlay { position: absolute; top: 50%; left: 50%; margin-top: -75px; margin-left: -75px; width: 150px; height: 150px; background: #F4F4F4; border-radius: 50%; } .overlay:before { content: ''; position: absolute; width: 170%; height: 170%; border-radius: 50%; margin-top: -68px; margin-left: -68px; border: 15px solid #F4F4F4; } .overlay div { position: absolute; top: 60%; left: 50%; width: 70px; height: 70px; overflow: hidden; background: tomato; margin-top: -35px; margin-left: -35px; } .overlay div:before { content: ''; position: absolute; left: -80%; height: 120%; width: 80%; background: #F4F4F4; transform-origin: top right; transform: rotate(-33deg); } .overlay div:after { content: ''; position: absolute; right: -80%; height: 120%; width: 80%; background: #F4F4F4; transform-origin: top left; transform: rotate(33deg); } @keyframes rotate { 100% { transform: rotate(360deg); } }
JAVASCRIPT
Expand for more options Login