svg+css实现文字字母跳动动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现文字字母跳动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --crouch-ratio: 0.9; --jump-height: -180%; --easing: ease-in-out; --spin-angle: 180deg; --font-size: 3rem; --color-text: #fa2; --color-highlight: #4ad4; --color-bg: #111; --chaos-percentage: 0%; } body { height: 100vh; font-family: sans-serif; display: flex; justify-content: center; align-items: center; overflow: hidden; background-color: var(--color-bg); color: var(--color-text); font-size: var(--font-size); } .text { text-align: center; } .word, .letter { display: inline-block; animation: jump var(--easing) infinite; transform-origin: center bottom; } @keyframes jump { 0%, 20% { transform: scaleY(1); } 25% { transform: scaleY(var(--crouch-ratio)); } 30% { transform: scaleY(var(--crouch-ratio)) translateY(var(--jump-height)) rotateX(var(--spin-angle)); background-color: var(--color-highlight); padding: 0 var(--chaos-percentage); } 40% { transform: translateY(0) scaleY(1) rotateX(0deg); } 45% { transform: scaleY(var(--crouch-ratio)); } 100% { transform: scaleY(1); } } </style> </head> <body translate="no"> <p class="text"><span class="word" style="animation-delay: 0s; animation-duration: 5s"><span class="letter" style="animation-delay: 0s; animation-duration: 0s">J</span><span class="letter" style="a.........完整代码请登录后点击上方下载按钮下载查看
网友评论0