HTML+CSS 纯代码打造小风车动态效果

效果

(实际是动态的,图是静态的而已)

 🌟 微动画能够为用户界面增添活力和趣味性。本文将带领读者学习如何使用纯CSS来实现一个生动的小风车动画效果。无需JavaScript或其他库,我们仅需利用CSS的强大功能,包括关键帧动画(@keyframes)和转换(transform)属性,即可创造出一个既美观又富有动感的动画风车。本教程适合希望在网页设计中加入创意动画效果的设计师和开发者。


HTML:

<div class="windBox">
  <div class="threeAngle right"></div>
  <div class="threeAngle bottom"></div>
  <div class="threeAngle left"></div>
  <div class="threeAngle top"></div>
</div>
<div class="stick"></div>

CSS:

.windBox {
          position: relative;
          z-index: 10;
          width: 200px;
          height: 200px;
          animation: circle 2s infinite linear;
        }
        
        .stick {
          position: absolute;
          top: 95px;
          left: 102.5px;
          height: 200px;
          width: 10px;
          background: royalblue;
          border-radius: 5px;
        }
        
        .threeAngle {
          position: absolute;
          height: 0;
          border: 50px solid transparent;
        }
        
        .threeAngle.right {
          border-right-color: rgba(223, 219, 29, 0.825);
        }
        
        .threeAngle.bottom {
          left: 100px;
          border-bottom-color: rgb(0, 255, 98);
        }
        
        .threeAngle.left {
          top: 100px;
          left: 100px;
          border-left-color: rgb(128, 115, 244);
        }
        
        .threeAngle.top {
          top: 100px;
          border-top-color: rgb(241, 0, 161);
        }
        
        @keyframes circle {
          to {
            transform: rotate(0);
          }
          from {
            transform: rotate(360deg);
          }
        }

🌟 综上,效果实现了, 后续有什么想要的欢迎大家留言,也可以加喔微信, 18634371151,欢迎~

🌟 往期精彩,可以关注博主看左侧专栏,一定有你需要的!!!

🌟 关注耀南.,探索更多精彩的动画效果!🚀

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

耀南.

你的鼓励将是我最最最最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值