波纹扩散效果

html 复制代码
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>波纹扩散</title>
    <style>
      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        background: rgba(32, 33, 47, 0.9);
      }

      .circle-container {
        position: relative;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        /* overflow: hidden; */
      }

      .circle {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        animation: rotate 6s linear infinite;
      }

      .circle-container > span {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 50%;
        border: 2px solid #00bfff; /* 设置边框颜色为蓝色 */
        z-index: -1;
        animation: ripple 2s linear infinite;
      }

      @keyframes rotate {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }
      @keyframes ripple {
        0% {
          transform: scale(1);
          opacity: 1;
        }
        100% {
          transform: scale(1.5);
          opacity: 0;
        }
      }
    </style>
  </head>
  <body>
    <div class="circle-container">
      <img class="circle" src="../assets/img/童话.jpg" alt="Circle Image" />
      <span class="ripple"></span>
      <span class="ripple"></span>
      <span class="ripple"></span>
    </div>
  </body>
  <script>
    const allRippleDom = document.querySelectorAll(".ripple");
    if (allRippleDom) {
      allRippleDom.forEach((item, index) => {
        item.style.animation = `ripple ${index + 1.5}s linear infinite`;
      });
    }
  </script>
</html>
相关推荐
石小石Orz5 分钟前
星云SDK + 油猴:给LLM塑造肉身,陪伴你在每个网页
前端·人工智能
2601_963771379 分钟前
10 Best PHP Media CMS and Scripts for Web Creators in 2026
开发语言·前端·php
VaJoy38 分钟前
全面革新⚡️ Vue 3.6 项目工程的基础实现
前端·vue.js
苍何1 小时前
耗时 7 天,我们开源了腾讯 WorkBuddy 实战蓝皮书(建议收藏)
前端·后端
大家的林语冰1 小时前
😭 Electron 麻了,Deno 直接支持二进制应用,无需第三方桌面应用框架!
前端·javascript·node.js
Damai2 小时前
DOMPurify 完整介绍
前端·面试
随风一样自由2 小时前
【前端+跨域】跨域问题全面解析与解决方案指南
前端·跨域
小帅不太帅2 小时前
我随手发了几张截图,白拿了一个月 AI 顶配会员
前端·github
36岁的我开始学习打篮球2 小时前
外规内化技术架构
前端
雪隐2 小时前
用Flutter做背单词APP-03为了给单词库塞满数据,我让AI给我打了上万份工
前端·人工智能·后端