文字跳动跳舞动画效果
代码语言:html
所属分类:动画
代码描述:文字跳动跳舞动画效果,主要使用了splitting插件进行运动
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> :root { --black: #010101; --red: #fd0002; --blue: #1600fe; --green: #00ff00; --letter-skew: 8deg; } body { height: 100vh; display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; overflow: hidden; background: var(--black); } .words { font-size: 7.5rem; letter-spacing: 1rem; font-family: 'Marvin Visions Variable'; text-transform: uppercase; } .words:nth-child(odd) .char:nth-child(odd) { --rotation: 10deg; -webkit-transform-origin: bottom left; transform-origin: bottom left; -webkit-animation-name: stretchHozThenVert; animation-name: stretchHozThenVert; } .words:nth-child(odd) .char:nth-child(even) { --rotation: -10deg; -webkit-transform-origin: bottom left; transform-origin: bottom left; -webkit-animation-name: stretchVertThenHoz; animation-name: stretchVertThenHoz; } .words:nth-child(odd) .char:nth-child(even):before, .words:nth-child(odd) .char:nth-child(even):after { -webkit-animation-name: stretchVertThenHoz; animation-name: stretchVertThenHoz; } .words:nth-child(even) .char:nth-child(odd) { --rotation: -10deg; -webkit-transform-origin: top right; transform-origin: top right; -webkit-animation-name: stretchVertThenHoz; animation-name: stretchVertThenHoz; } .words:nth-child(even) .char:nth-child(even) { --rotation: 10deg; -webkit-transform-origin: top left; transform-origin: top left; -webkit-animation-name: stretchHozThenVert; animation-name: stretchHozThenVert; } .words:nth-child(even) .char:nth-child(even):before, .words:nth-child(even) .char:nth-child(even):after { -webkit-animation-name: stretchHozThenVert; animation-name: stretchHozThenVert; } .char { position: relative; display: inline-block; color: var(--blue); mix-blend-mode: screen; font-variation-settings: 'wght' 200; -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; animation-easing: ease-in-out; } .char::after, .char::before { content: attr(data-char); position: absolute; mix-blend-mode: screen; left: 0; -webkit-animation-duration: 1.3s; animation-duration: 1.3s; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-name: stretchHozThenVert; animation-name: stretchHozThenVert; animation-easing: ease-in-out; } .char::before { color: var(--red); font-variation-settings: 'wght' 170; -webkit-animation-delay: 0.25s; animation-delay: 0.25s; font.........完整代码请登录后点击上方下载按钮下载查看
网友评论0