css svg 描边动画效果

svg实现的一个微不足道的描边效果:

线条是运动着的,以下是png,本应放gif来着

颜色看起来有点乱,哈哈

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>流光</title>
    <style>
        .text{
            fill:#eee;
            font-size: 80px;
        }
        .text1{
            stroke: #f00;
            animation: slide1 5s linear infinite;
        }
        @keyframes slide1{0%{stroke-dashoffset: -0;}
            100% {stroke-dashoffset: 125;}}
        .text2{
            stroke: #f33;
            animation: slide2 5s linear infinite;
        }
        @keyframes slide2{0%{stroke-dashoffset: -35;}
            100% {stroke-dashoffset: 160;}}
        .text3{
            stroke: #f66;
            animation: slide3 5s linear infinite;
        }
        @keyframes slide3{0%{stroke-dashoffset: -70;}
            100% {stroke-dashoffset: 195;}}
        .text4{
            stroke: #faa;
            animation: slide4 5s linear infinite;
        }
        @keyframes slide4{0%{stroke-dashoffset: -105;}
            100% {stroke-dashoffset: 230;}}
    </style>
</head>
<body>
    <div class="svg_wrap">
        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600px;height: 300px;">
            <text class="text text1" x="50" y="100"
            stroke-dasharray="35 135" >细草微风岸,平林月未满</text>
            <text class="text text2" x="50" y="100"
            stroke-dasharray="35 135" >细草微风岸,平林月未满</text>
            <text class="text text3" x="50" y="100"
            stroke-dasharray="35 135" >细草微风岸,平林月未满</text>
            <text class="text text4" x="50" y="100"
            stroke-dasharray="35 135" >细草微风岸,平林月未满</text>
        </svg>
    </div>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值