Wind Mill
Home
Snippets
Wind Mill
HTML
CSS
JS
<div class="windmill"> <div class="tower"></div> <div class="nacelle"></div> <div class="blades"> <div class="blade"></div> <div class="blade"></div> <div class="blade"></div> </div> </div> <div class="ground"></div>
body{ margin: 0; background: #cce7ff; height: 100vh; display: flex; justify-content: center; align-items: end; overflow: hidden; font-family: sans-serif; } .windmill { position: relative; width: 100px; height: 300px; } .tower { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 190px solid #333; border-top: 10px solid transparent; margin: 0 auto; } .nacelle { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; background: #333; border-radius: 50%; z-index: 1; } .blades { position: absolute; top: -85px; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; animation: spin 3s linear infinite; } .blade { position: absolute; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 100px solid #aaa; border-radius: 4px; left: 50%; transform: translateX(-50%); } .blade:nth-child(2) { transform: translateX(-50%) rotate(120deg); transform-origin: bottom center; } .blade:nth-child(3) { transform: translateX(-50%) rotate(240deg); transform-origin: bottom center; } @keyframes spin { to { transform: translateX(-50%) rotate(360deg); } } .ground { position: absolute; bottom: 0; width: 100%; height: 100px; background: #6b8e23; z-index: -1; }
//javascript
Ad #1
Ad #2
Scroll to Top