svg实现文字跳动动画效果代码
代码语言:html
所属分类:动画
代码描述:svg实现文字跳动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap'); body { background: #333; height: 100vh; display: flex; justify-content: center; overflow: hidden; } svg { width: 30%; animation: rotate infinite linear; mix-blend-mode: multiply; margin: 0 -8%; } svg:nth-child(1) { fill: tomato; animation-duration: 4s; } svg:nth-child(2) { fill: gold; animation-duration: 2s; animation-direction: reverse; } svg:nth-child(3) { fill: lime; animation-duration: 6s; } svg:nth-child(4) { fill: turquoise; animation-duration: 3s; animation-direction: reverse; } @keyframes rotate { 100%{transform: rotate(360deg)} } h1 { position: absolute; width: fit-content; height: fit-content; left:0; right:0; top:0; bottom:0; margin: auto; font-family: 'Poppins', sans-serif; text-transform: uppercase; font-weight: 900; color: white; letter-spacing: .5em; font-size: 10vw; animation: text 1s infinite; mix-blend-mode: screen; } @keyframes text { 0% {text-shadow: 5px 0px 0px tomato;} 10%{text-shadow: -5px -5px 0px gold;} 20% {text-shadow: 5px 0px 0px lime;} 30% {text-shadow: 5px 0px 0px turquoise;} 40% {text-shadow: 5px 5px 0px tomato;} 50%{text-shadow: 0px -5px 0px gold;} 60% {text-shadow: 0px 5px 0px lime;} 70% {text-shadow: 5px 0px 0px turquoise;} 80% {text-shadow: 5px -10px 0px tomato;} 90%{text-shadow: 5px 5px 0px gold;} 100% {text-shadow: 5px 0px 0px lime;} } </style> </head> <body> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path d="M21.1,-21.7C27.9,-14.3,34.5,-7.1,36.1,1.7C37.8,10.4,34.5,20.9,27.7,27.6C20.9,34.3,10.4,37.4,1.6,35.7C-7.2,34.1,-14.4,27.9,-19.6,21.1C-24.8,14.4,-27.9,7.2,-28.4,-0.5C-28.8,-8.1,-26.6,-16.2,-21.4,.........完整代码请登录后点击上方下载按钮下载查看
网友评论0