9月8日
网站LOGO 千鹤喵绫
做分享的事,总有意义的
菜单
  • 千鹤喵绫
    做分享的事,总有意义的
    用户的头像
    首次访问
    上次留言
    累计留言
    我的等级
    我的角色
    打赏二维码
    打赏博主
    【分享】CSS 动画特效代码
    点击复制本页信息
    微信扫一扫
    文章二维码
    文章图片 文章标题
    创建时间
  • 一 言
    确认删除此评论么? 确认
  • 本弹窗介绍内容来自,本网站不对其中内容负责。
    • 复制图片
    • 复制图片地址
    • 百度识图
    按住ctrl可打开默认菜单

    【分享】CSS 动画特效代码

    千鹤喵绫 · 原创 ·
    程序员专区 · 暂无标签
    共 3862 字 · 约 1 分钟 · 186

    ![]()

    由5个圆形元素组成的3D旋转加载动画。每个圆形元素都在自己的轴上不断缩放,创建出旋转的视觉效果

    代码分享:

    html 代码:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
      .loading-container {
        perspective: 500px;
        width: 100px;
        height: 100px;
        position: relative;
        margin: 50px auto;
      }
     
      .loading {
        width: 100%;
        height: 100%;
        position: absolute;
        transform-style: preserve-3d;
        animation: rotate 2s infinite linear;
      }
     
      .loading div {
        position: absolute;
        width: 100%;
        height: 100%;
        background: #3498db;
        border-radius: 50%;
        opacity: 0.7;
      }
     
      .loading div:nth-child(1) {
        transform: translateZ(50px);
        animation: bounce 2s infinite linear;
      }
     
      .loading div:nth-child(2) {
        background: #9b59b6;
        transform: translateZ(100px) rotateX(90deg);
        animation: bounce 2s infinite -1s linear;
      }
     
      .loading div:nth-child(3) {
        background: #f39c12;
        transform: translateZ(150px) rotateX(180deg);
        animation: bounce 2s infinite -2s linear;
      }
     
      .loading div:nth-child(4) {
        background: #1abc9c;
        transform: translateZ(100px) rotateX(270deg);
        animation: bounce 2s infinite -3s linear;
      }
     
      .loading div:nth-child(5) {
        background: #e74c3c;
        transform: translateZ(50px) rotateX(360deg);
        animation: bounce 2s infinite -4s linear;
      }
     
      @keyframes rotate {
        0% {
          transform: rotateX(0deg) rotateY(0deg);
        }
        100% {
          transform: rotateX(360deg) rotateY(360deg);
        }
      }
     
      @keyframes bounce {
        0%, 100% {
          transform: scale(0.5);
        }
        50% {
          transform: scale(1);
        }
      }
    </style>
    </head>
    <body>
    <div class="loading-container">
      <div class="loading">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </div>
    </div>
    </body>
    </html>
    声明:本文由 千鹤喵绫(博主)原创,依据 CC-BY-NC-SA 4.0 许可协议 授权,转载请注明出处。

    还没有人喜爱这篇文章呢

    现在已有

    1

    条评论
    我要发表评论
    1. 头像
      千鹤喵绫

      欢迎自取😀

      · ·
    博客logo 千鹤喵绫 做分享的事,总有意义的
    MOEICP 萌ICP备20240860号 ICP 粤ICP证XXXXX号 又拍云 本站由又拍云提供CDN加速/云存储服务 本站支持IPv6访问 本站支持IPv6访问

    💻️ 千鹤喵绫 5天前 在线

    🕛

    本站已运行 311 天 8 小时 31 分
    千鹤喵绫. © 2023 ~ 2024.
    网站logo

    千鹤喵绫 做分享的事,总有意义的