div+css实现文字路径无限循环动画代码
代码语言:html
所属分类:动画
代码描述:div+css实现文字路径无限循环动画代码,可点击右侧暂停或开始
代码标签: div css 文字 路径 无限 循环 动画 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; background: #000; overflow: hidden; display: grid; height: 100vh; place-items: center; container-type: size; } .container { position: relative; display: flex; font-size: min(.9cqh, .45cqw); --h: 100em; height: var(--h); width: calc(2*var(--h) - 5.5em); } .wrapper { position: absolute; height: 100%; width: unset; aspect-ratio: 1; display: grid; &:nth-child(2 of .wrapper) { right: 0; bottom: unset; } } .swirl { position: absolute; inset: 0; --dur: 10s; display: grid; align-items: center; justify-items: unset; animation: spin var(--dur) linear infinite; :nth-child(2 of .wrapper) & { animation-direction: reverse; } } span { position: absolute; width: 50%; height: unset; color: #fff; font-family: monospace; font-weight: bold; font-size: calc(var(--h)/10); rotate: calc(360deg/28*var(--nth)*var(--dir)); animation: fade var(--dur) linear infinite; animation-delay: calc(-1*var(--dur)/28 * var(--nth)); --glow: hsl(calc(360deg/28*var(--nth)) 100% 50%); text-shadow: 0 0 1em var(--glow), 0 0 .5em var(--glow), 0 0 .25em var(--glow); &:nth-child(1) { --nth: 1;} &:nth-child(2) { --nth: 2;} &:nth-child(3) { --nth: 3;} &:nth-child(4) { --nth: 4;} &:nth-child(5) { --nth: 5;} &:nth-child(6) { --nth: 6;} &:nth-child(7) { --nth: 7;} &:nth-child(8) { --nth: 8;} &:nth-child(9) { --nth: 9;} &:nth-child(10) { --nth: 10;} &:nth-child(11) { --nth: 11;} &am.........完整代码请登录后点击上方下载按钮下载查看
网友评论0