前端动画案例分享(三)

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Loading Text Outline Effect</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #333;
        }

        .loading-text {
            font-family: Arial, sans-serif;
            font-size: 30px;
            font-weight: bold;
            color: transparent;
            position: relative;
            text-transform: uppercase;
            letter-spacing: 5px;
        }

        .loading-text .text {
            position: relative;
            z-index: 1;
        }

        .loading-text::before {
            content: attr(data-text);
            position: absolute;
            top: 0;
            left: 0;
            color: transparent;
            -webkit-text-stroke: 2px #fff;
            z-index: 0;
        }

        .loading-text::after {
            content: attr(data-text);
            position: absolute;
            top: 0;
            left: 0;
            color: white;
            z-index: 0;
            clip-path: inset(0 100% 0 0);
            animation: loading 3s linear infinite;
        }

        @keyframes loading {
            0% {
                clip-path: inset(0 100% 0 0);
            }
            50% {
                clip-path: inset(0 0 0 0);
            }
            100% {
                clip-path: inset(0 0 0 100%);
            }
        }
    </style>
</head>
<body>
    <div class="loading-text" data-text="Loading...">
        <span class="text">Loading...</span>
    </div>
</body>
</html>
html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    .dot-trail-loader {
      position: relative;
      width: 100px;
      height: 100px;
    }

    .dot {
      position: absolute;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background-color: #ff6b6b;
      animation: dotTrail 1.5s infinite ease-in-out;
    }

    .dot:nth-child(2) {
      animation-delay: 0.3s;
    }

    .dot:nth-child(3) {
      animation-delay: 0.6s;
    }

    @keyframes dotTrail {
      0% { transform: translate(0, 0); opacity: 1; }
      50% { transform: translate(50px, 50px); opacity: 0.5; }
      100% { transform: translate(100px, 0); opacity: 1; }
    }
  </style>
</head>
<body>
  <div class="dot-trail-loader">
    <div class="dot"></div>
    <div class="dot"></div>
    <div class="dot"></div>
  </div>
</body>
</html>
html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
     body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    .star-spinner {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      position: relative;
      animation: rotateStar 2s infinite linear;
    }

    .star {
      width: 80px;
      height: 80px;
      clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
      background-color: #ff6b6b;
    }

    @keyframes rotateStar {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
  </style>
</head>
<body>
  <div class="star-spinner">
    <div class="star"></div>
  </div>
</body>
</html>

想要获取更多特效,点击免费使用**小奈AI**

相关推荐
xingshanchang4 小时前
PyTorch 不支持旧GPU的异常状态与解决方案:CUDNN_STATUS_NOT_SUPPORTED_ARCH_MISMATCH
人工智能·pytorch·python
OEC小胖胖4 小时前
去中心化身份:2025年Web3身份验证系统开发实践
前端·web3·去中心化·区块链
Cacciatore->5 小时前
Electron 快速上手
javascript·arcgis·electron
reddingtons5 小时前
Adobe Firefly AI驱动设计:实用技巧与创新思维路径
大数据·人工智能·adobe·illustrator·photoshop·premiere·indesign
CertiK5 小时前
IBW 2025: CertiK首席商务官出席,探讨AI与Web3融合带来的安全挑战
人工智能·安全·web3
vvilkim5 小时前
Electron 进程间通信(IPC)深度优化指南
前端·javascript·electron
Deepoch6 小时前
Deepoc 大模型在无人机行业应用效果的方法
人工智能·科技·ai·语言模型·无人机
Deepoch6 小时前
Deepoc 大模型:无人机行业的智能变革引擎
人工智能·科技·算法·ai·动态规划·无人机
某公司摸鱼前端6 小时前
ES13(ES2022)新特性整理
javascript·ecmascript·es13
kngines6 小时前
【字节跳动】数据挖掘面试题0003:有一个文件,每一行是一个数字,如何用 MapReduce 进行排序和求每个用户每个页面停留时间
人工智能·数据挖掘·mapreduce·面试题