div+css实现文字立体螺旋动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现文字立体螺旋动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Roboto: 700"); *, *::before, *::after { padding: 0; margin: 0; box-sizing: border-box; } body { font-family: Roboto, sans-serif; background-color: #000; color: #fff; min-height: 100vh; display: grid; place-items: center; overflow: hidden; perspective: 600px; * { transform-style: preserve-3d; } } .scene { position: relative; * { position: absolute; } } .texts { font-size: 6vmin; -webkit-animation: texts 12s infinite linear; animation: texts 12s infinite linear; &::after { content: ''; position: absolute; inset: -7.5em -1.5em; background-image: linear-gradient(to right, transparent, 10%, black, 90%, transparent); } } .text { -webkit-animation: text 8s calc(var(--text) * -2s) infinite linear; animation: text 8s calc(var(--text) * -2s) infinite linear; color: hsl(calc(var(--text) * 90) 75% 75%); span { inset: -1em; display: grid; place-items: center; font-weight: 700; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; transform: translateY(calc((var(--i) - 6) * 0.6em)) rotateY(calc(var(--i) * 20deg)) translateZ(1.5em) rotateZ(-40deg); } } @-webkit-keyframes texts { from { transform: rotateZ(0deg) rotateX(20deg) rotateZ(360deg); } to { transform: rotateZ(360deg) rotateX(20deg) rotateZ(0deg); } } @keyframes texts { from { transform: rotateZ(0deg) rotateX(20deg) rotateZ(360deg); } to { transform.........完整代码请登录后点击上方下载按钮下载查看
网友评论0