div+css实现三维柱状图图标动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现三维柱状图图标动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { overflow: hidden; margin: 0; height: 100vh; perspective: 65em; perspective-origin: 50% calc(50% - 24em); background: #000; } div { position: absolute; top: 50%; left: 50%; transform-style: preserve-3d; } .assembly { transform: rotateY(0deg) translate3d(24em, -24em, 30em); animation: move 13s ease-in-out infinite; } @keyframes move { 80%, 100% { transform: rotateY(-45deg) translate3d(-24em, 3em, -6em); } } .plane { margin: -100vmax; width: 200vmax; height: 200vmax; transform: rotateX(90deg) translateZ(-12em); background: radial-gradient(transparent 50%, #000 71%), linear-gradient(rgba(252, 249, 216, .1) 0.125em, transparent 0), linear-gradient(90deg, rgba(252, 249, 216, .1) 0.125em, transparent 0); background-position: 50% 50%; background-size: 100%, 3em 3em, 3em 3em; } .bar { transform-origin: 0 12em 0; } .bar:nth-child(1) { margin-left: -18em; animation: grow-1 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(1) .face:nth-child(1) { -webkit-filter: brightness(0.6); filter: brightness(0.6); } .bar:nth-child(1) .face:nth-child(2) { -webkit-filter: brightness(0.55); filter: brightness(0.55); } .bar:nth-child(1) .face:nth-child(3) { -webkit-filter: brightness(0.5); filter: brightness(0.5); } .bar:nth-child(1) .face:nth-child(4) { -webkit-filter: brightness(0.45); filter: brightness(0.45); } @keyframes grow-1 { 0%, 0% { transform: scaleY(0.01); } 8.3333333333%, 100% { transform: scaleY(0.1); } } .bar:nth-child(2) { margin-left: -12em; animation: grow-2 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(2) .face:nth-child(1) { -webkit-filter: brightness(0.65); filter: brightness(0.65); } .bar:nth-child(2) .face:nth-child(2) { -webkit-filter: brightness(0.6); filter: brightness(0.6); } .bar:nth-child(2) .face:nth-child(3) { -webkit-filter: brightness(0.55); filter: brightness(0.55); } .bar:nth-child(2) .face:nth-child(4) { -webkit-filter: brightness(0.5); filter: brightness(0.5); } @keyframes grow-2 { 0%, 8.3333333333% { transform: scaleY(0.01); } 16.6666666667%, 100% { transform: scaleY(0.16); } } .bar:nth-child(3) { margin-left: -6em; animation: grow-3 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(3) .face:nth-child(1) { -webkit-filter: brightness(0.7); filter: brightness(0.7); } .bar:nth-child(3) .face:nth-child(2) { -webkit-filter: brightness(0.65); filter: brightness(0.65); } .bar:nth-child(3) .face:nth-child(3) { -webkit-filter: brightness(0.6); filter: brightness(0.6); } .bar:nth-child(3) .face:nth-child(4) { -webkit-filter: brightness(0.55); filter: brightness(0.55); } @keyframes grow-3 { 0%, 16.6666666667% { transform: scaleY(0.01); } 25%, 100% { transform: scaleY(0.25); } } .bar:nth-child(4) { margin-left: 0em; animation: grow-4 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(4) .face:nth-child(1) { -webkit-filter: brightness(0.75); filter: brightness(0.75); } .bar:nth-child(4) .face:nth-child(2) { -webkit-filter: brightness(0.7); filter: brightness(0.7); } .bar:nth-child(4) .face:nth-child(3) { -webkit-filter: brightness(0.65); filter: brightness(0.65); } .bar:nth-child(4) .face:nth-child(4) { -webkit-filter: brightness(0.6); filter: brightness(0.6); } @keyframes grow-4 { 0%, 25% { transform: scaleY(0.01); } 33.3333333333%, 100% { transform: scaleY(0.37); } } .bar:nth-child(5) { margin-left: 6em; animation: grow-5 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(5) .face:nth-child(1) { -webkit-filter: brightness(0.8); filter: brightness(0.8); } .bar:nth-child(5) .face:nth-child(2) { -webkit-filter: brightness(0.75); filter: brightness(0.75); } .bar:nth-child(5) .face:nth-child(3) { -webkit-filter: brightness(0.7); filter: brightness(0.7); } .bar:nth-child(5) .face:nth-child(4) { -webkit-filter: brightness(0.65); filter: brightness(0.65); } @keyframes grow-5 { 0%, 33.3333333333% { transform: scaleY(0.01); } 41.6666666667%, 100% { transform: scaleY(0.5); } } .bar:nth-child(6) { margin-left: 12em; animation: grow-6 13s cubic-bezier(0.17, 0.89, 0.32, 1.28) infinite; } .bar:nth-child(6) .face:nth-child(1) { -webkit-filter: brightness(0.85); filter: brightness(0.85); } .bar:nth-child(6) .face:nth-child(2) { -webkit-filter: brightness(0.8); filter: brightness(0.8); } .bar:nth-child(6) .face:nth-child(3) { -webkit-filter: bright.........完整代码请登录后点击上方下载按钮下载查看
网友评论0