旋转风车
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> [class^=cit] { position: absolute; border-style: dashed; border-width: 40px 40px 0px 50px; width: 0; } .cit { margin-top: -59px; margin-left: -20px; border-color: #5697FE transparent transparent #5687E7; transform: rotate(270deg); } .cit1 { margin-top: 30px; margin-left: -60px; border-color: #5697FE transparent transparent #5687E7; transform: rotate(90deg); } .cit2 { margin-top: -33px; margin-left: -83px; border-color: #5697FE transparent transparent #5687E7; transform: rotate(180deg); } .cit3 { margin-top: 5px; margin-left: 4px; border-color: #5697FE transparent transparent #5687E7; } #div11 { position: relative; margin: 200px 300px; border: 1px solid red; width: 10px; height: 10px; border-radius: 50%; transform: rotate(180deg); animation: run 9s linear infinite; } #gu { width: 10px; height: 206px; background-color: black; position: absolute; margin-top: -207px; margin-left: 301px; z-index: -1; } #div11:hover { animation: run 0.7s linear infinite; } @keyframes run { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } #div1 { float: left; /* transform: rotate(180deg); */ margin-top: -29px; margin-left: 301px; } #div2 { float: left; transform: rotate(180deg); margin-top: -45px; margin-left: 300px; } #div3 { float: left; transform: rotate(89deg); margin-top: -607px; margin-left: 545px; } #div4 { float: left; transform: rotate(270deg); margin-top: -602px; margin-left: 58px; } #div5 { float: left; margin-top: -602px; margin-left: 300px; } </style> </head> <body> <div id="div1"> <div id="div11"> <div class="cit"> </div> <div class="cit1"> </div> <div class="cit2"> </div> <div class="cit3"> </div> </div> <div id="gu"></div> </div> <div id="div2"> <div id="div11"> <div class="cit"> </div> <div class="cit1"> </div> <div class="cit2"> </div> <div class="cit3"> </div> </div> <div id="gu"></div> </div> <div id="div3"> <div id="div11"> <div class="cit"> </div> <div class="cit1"> </div> <div class="cit2"> </div> <div class="cit3"> </div> </div> <div id="gu"></div> </div> <div id="div4"> <div id="div11"> <div class="cit"> </div> <div class="cit1"> </div> <div class="cit2"> </div> <div class="cit3"> </div> </div> <div id="gu"></div> </div> <div id="div5"> <div id="div11"> <div class="cit"> </div> <div class="cit1"> </div> <div class="cit2"> </div> <div class="cit3"> </div> </div> </div> <!-- <script src="../../js/jquery-3.6.0.js"></script> <script> var div11 = document.getElementById('div11'); var o = 180; setInterval(function() { o += 1; div11.style.transform = 'rotate(' + o + 'deg)'; div11.style.transition = 'all 2s' }, 20) $('#div11').hover(function() { o += 300; div11.style.transform = 'rotate(' + o + 'deg)'; div11.style.transition = 'all 1s' }) </script> --> </body> </html>