gsap实现多行文字文本多种动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap实现多行文字文本多种动画效果代码

代码标签: gsap 多行 文字 文本 多种 动画 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">

  <style>
    :root {
      --bg: #0f1720;
      --card: #0b1220cc;
      --accent: #ff8a00;
      --muted: #98a0ad;
      --panel: #0b122030;
      --text: #e6eef8;
    }

    * { box-sizing: border-box }
    html, body, #app { height: 100%; margin: 0; font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial }
    body {
      background: linear-gradient(180deg, #071022 0%, #081426 60%);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    #stage {
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      overflow: hidden;
      text-align: center;
    }

    /* 修复:color 不支持渐变,改用 background-clip 方案 */
    #target {
      font-weight: 700;
      font-size: clamp(28px, 8vw, 88px);
      line-height: 0.95;
      margin: 0;
      letter-spacing: -0.02em;
      display: inline-block;
      transform-origin: center;
      pointer-events: none;
      background: linear-gradient(90deg, var(--text), #a8d3ff);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    /* 浮动控制面板 */
    #panel {
      position: fixed;
      top: 14px;
      right: 14px;
      width: 300px;
      background: var(--panel);
      backdrop-filter: blur(6px);
      border-radius: 1.........完整代码请登录后点击上方下载按钮下载查看

网友评论0