<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.bootcdn.net/ajax/libs/animejs/3.2.0/anime.min.js"></script>
<style>
.text-all{
font-size: 64px;
font-weight: bold;
text-transform: uppercase;
fill: none;
stroke-dasharray: 50 100;
stroke-width: 2px;
}
.text{
stroke: #f44336;
animation: stroke 6s infinite linear forwards;
}
.text1{
stroke:#e91e63;
animation: stroke 6s -1s infinite linear;
}
.text2{
stroke: #9c27b0;
animation: stroke 6s -2s infinite linear;
}
.text3{
stroke: #2196f3;
animation: stroke 6s -3s infinite linear;
}
.text4{
stroke:#ffeb3b;
animation: stroke 6s -4s infinite linear;
}
@keyframes stroke {
100% {
stroke-dashoffset:-400;
}
}
</style>
</head>
<body>
<svg style="width:100vw;height:90vh" id="svg">
<text x="10%" y="35%" class="text text-all">我</text>
<text x="10%" y="35%" class="text1 text-all">我</text>
<text x="10%" y="35%" class="text2 text-all">我</text>
<text x="10%" y="35%" class="text3 text-all">我</text>
<text x="10%" y="35%" class="text4 text-all">我</text>
<text x="30%" y="35%" class="text text-all">菲</text>
<text x="30%" y="35%" class="text1 text-all">菲</text>
<text x="30%" y="35%" class="text2 text-all">菲</text>
<text x="60%" y="35%" class="text text-all">飞</text>
<text x="60%" y="35%" class="text1 text-all">飞</text>
<text x="60%" y="35%" class="text2 text-all">飞</text>
</svg>
<script>
// anime({
// targets:".text-all",
// duration:5000,
// loop:true
// })
</script>
</body>
</html>
网友评论