Fork me on GitHub

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

Coding Poineer

svg动画(适合边框、图形动画)

@keyframes svgdh {
  0%{
    stroke-width: 1;
    stroke-dasharray: 0 650;
  }
  60% {
    stroke-width: 5;
    stroke-dasharray : 350 650
  }
  100% {
    stroke-width: 1;
    stroke-dasharray : 650 650
  }
}
.svgDH{
  animation: svgdh 2s ease-out infinite;
}
        <svg
          xmlns="http://www.w3.org/2000/svg"
          height="400"
          width="200"
          version="1.1"
        >
          <polyline
            points="0,1 120,1 120,382 0,382"
            style="fill: none; stroke: #777777; stroke-width: 1"
          />
          <polyline
            points="0,1 120,1 120,382 0,382"
            class="svgDH"
            style="fill: none; stroke: #e93718; stroke-width: 1"
          />

filter属性制作动画:


<style>
  /* 驰骋之心 */
  .filter-mix {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 200px;
    filter: contrast(20);
    background: #fff;
  }

  .filter-mix::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #333;
    top: 40px;
    left: 40px;
    z-index: 2;
    filter: blur(6px);
    box-sizing: border-box;
    animation: filterBallMove 4s ease-out infinite;
  }

  .filter-mix::after {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #3F51B5;
    top: 60px;
    right: 40px;
    z-index: 2;
    filter: blur(6px);
    animation: filterBallMove2 4s ease-out infinite;
  }

  @keyframes filterBallMove {
    50% {
      left: 140px;
    }
  }

  @keyframes filterBallMove2 {
    50% {
      right: 140px;
    }
  }

  /* soul test */
  .container {
    width: 500px;
    height: 200px;
    position: relative;
    padding: 2em;
    filter: contrast(20);
    background-color: black;
    overflow: hidden;
  }

  span {
    color: white;
    font-size: 4rem;
    text-transform: uppercase;
    line-height: 1;
    animation: letterspacing 5s infinite alternate ease-in-out;
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
    letter-spacing: -2.2rem;
  }

  @keyframes letterspacing {
    0% {
      letter-spacing: -2.2rem;
      filter: blur(.3rem);
    }

    50% {
      filter: blur(.5rem);
    }

    100% {
      letter-spacing: .5rem;
      filter: blur(0rem);
      color: #fff;
    }
  }
</style>

<body>
  <div class="filter-mix"></div>
  <div class="container">
    <span>
      soul
      body
    </span>
  </div>
</body>

posted @   365/24/60  阅读(162)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示