css动效代码(持续更新中。。。)

本文分享了按钮动效的实践案例,包括悬浮球按钮的动态效果和闪光特效的实现,通过CSS动画让静态按钮更具吸引力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

主要更新一些按钮动效的实践。静态按钮往往不够吸引人,试试让它动起来吧~
悬浮球

 .susbension {
    position: fixed;
    top: 156px;
    right: 10px;
    z-index: 9;
    display: inline-block;
    width: 60px;
    height: 60px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 55%, rgba(240, 245, 255, 0.9), rgba(240, 245, 255, 0.9) 40%, rgba(225, 238, 255, 0.8) 60%, rgba(43, 130, 255, 0.4));
    border-radius: 100%;
    animation: bubble-anim 1.5s ease-in-out infinite alternate;

    &::before {
      position: absolute;
      top: 1%;
      left: 5%;
      z-index: 2;
      width: 90%;
      width: 40%;
      height: 90%;
      height: 80%;
      // background: radial-gradient(circle at top, white, rgba(255, 255, 255, 0) 58%);
      background: radial-gradient(circle at 130% 130%, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.8) 58%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0) 100%);
      border-radius: 100%;
      transform: translateX(131%) translateY(58%) rotateZ(168deg) rotateX(10deg);
      content: "";
      filter: blur(5px);
    }

    &::after {
      position: absolute;
      top: 5%;
      left: 10%;
      z-index: 2;
      display: block;
      width: 80%;
      height: 80%;
      background: radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 74%, white 80%, white 84%, rgba(255, 255, 255, 0) 100%);
      border-radius: 100%;
      transform: rotateZ(-30deg);
      content: "";
      filter: blur(1px);
    }

    .susbension-box {
      position: absolute;
      top: 7px;
      left: 11px;
      display: block;
      width: 37px;
      height: 46px;
      background-image: url(../../images/receiveCourse.png);
      background-size: contain;
      background-repeat: no-repeat;
      border-radius: 100%;
    }
  }

闪光特效

&::before {
      position: absolute;
      top: 0;
      width: 25px;
      height: 54px;
      background: #fff;
      opacity: 0.3;
      transform: skewX(-25deg);
      animation: light 1s ease-out infinite;
      content: '';
      }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值