div+css实现三维彩色七环伸缩换位动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现三维彩色七环伸缩换位动画效果代码
代码标签: div css 三维 彩色 七环 伸缩 换位 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *::before, *::after { padding: 0; margin: 0 auto; box-sizing: border-box; } body { background-color: #000; min-height: 100vh; display: grid; place-items: center; perspective: 800px; overflow: hidden; } body * { transform-style: preserve-3d; } .rings { position: relative; transform: rotateX(60deg); } .rings div { position: absolute; -webkit-animation: ringTranslate 14s var(--delay, 0s) infinite linear, ringScale 28s var(--delay, 0s) infinite, ease-in-out; animation: ringTranslate 14s var(--delay, 0s) infinite linear, ringScale 28s var(--delay, 0s) infinite, ease-in-out; } @-webkit-keyframes ringTranslate { 0%, 100% { translate: 0 0 -12em; } 90% { translate: 0 0 12em; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; } } @keyframes ringTranslate { 0%, 100% { translate: 0 0 -12em; } 90% { translate: 0 0 12em; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; } } @-webkit-keyframes ringScale { 0%, 5%, 8%, 11.5%, 14.5%, 18%, 21%, 24.5%, 27.5%, 30.5%, 34%, 36.5%, 40.5%, 50%, 55%, 58%, 61.5%, 64.5%, 68%, 71%, 74.5%, 77.5%, 80.5%, 84%, 86.5%, 90.5% { scale: 1; } 6%, 19%, 32%, 62.5%, 75.5%, 88.5% { scale: 1.3; } 12.5%, 25.5%, 38.5%, 56%, 69%, 82% { scale: 0.7; } } @keyframes ringScale { 0%, 5%, 8%, 11.5%, 14.5%, 18%, 21%, 24.5%, 27.5%, 30.5%, 34%, 36.5%, 40.5%, 50%, 55%, 58%, 61.5%, 64.5%, 68%, 71%, 74.5%, 77.5%, 80.5%, 84%, 86.5%, 90.5% { scale: 1; } 6%, 19%, 32%, 62.5%, 75.5%, 88.5% { scale: 1.3; } 12.5%, 25.5%, 38.5%, 56%, 69%, 82% { scale: 0.7; } } .rings div:nth-child(1) { --delay: 0s; --hue: 0; } .rings div:nth-child(2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0