css实现三维木块翻转动画效果代码
代码语言:html
所属分类:三维
代码描述:css实现三维木块翻转动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { overflow: hidden; margin: 0; height: 100vh; perspective: 40em; background: #000; } .assembly { transform: rotateX(-30deg); } .assembly, .assembly * { position: absolute; top: 50%; left: 50%; transform-style: preserve-3d; } .positioner:nth-child(1) { transform: rotateY(0deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(1) .prism { animation-delay: 0s; } .positioner:nth-child(1) .prism__face { background: #542252; } .positioner:nth-child(1) .prism__face:nth-child(n + 5) { background: #6699ff; } .positioner:nth-child(2) { transform: rotateY(15deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(2) .prism { animation-delay: -0.07292s; } .positioner:nth-child(2) .prism__face { background: #552251; } .positioner:nth-child(2) .prism__face:nth-child(n + 5) { background: #6698fc; } .positioner:nth-child(3) { transform: rotateY(30deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(3) .prism { animation-delay: -0.14583s; } .positioner:nth-child(3) .prism__face { background: #57234e; } .positioner:nth-child(3) .prism__face:nth-child(n + 5) { background: #6894f3; } .positioner:nth-child(4) { transform: rotateY(45deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(4) .prism { animation-delay: -0.21875s; } .positioner:nth-child(4) .prism__face { background: #5a244a; } .positioner:nth-child(4) .prism__face:nth-child(n + 5) { background: #6a8ee5; } .positioner:nth-child(5) { transform: rotateY(60deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(5) .prism { animation-delay: -0.29167s; } .positioner:nth-child(5) .prism__face { background: #5f2644; } .positioner:nth-child(5) .prism__face:nth-child(n + 5) { background: #6c86d2; } .positioner:nth-child(6) { transform: rotateY(75deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(6) .prism { animation-delay: -0.36458s; } .positioner:nth-child(6) .prism__face { background: #64273d; } .positioner:nth-child(6) .prism__face:nth-child(n + 5) { background: #6f7cbd; } .positioner:nth-child(7) { transform: rotateY(90deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(7) .prism { animation-delay: -0.4375s; } .positioner:nth-child(7) .prism__face { background: #692936; } .positioner:nth-child(7) .prism__face:nth-child(n + 5) { background: #7272a6; } .positioner:nth-child(8) { transform: rotateY(105deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(8) .prism { animation-delay: -0.51042s; } .positioner:nth-child(8) .prism__face { background: #6e2b2f; } .positioner:nth-child(8) .prism__face:nth-child(n + 5) { background: #75688e; } .positioner:nth-child(9) { transform: rotateY(120deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(9) .prism { animation-delay: -0.58333s; } .positioner:nth-child(9) .prism__face { background: #742d28; } .positioner:nth-child(9) .prism__face:nth-child(n + 5) { background: #785f79; } .positioner:nth-child(10) { transform: rotateY(135deg) translateZ(10.15625em) rotateX(70deg); } .positioner:nth-child(10) .prism { animation-delay: -0.65625s; } .posi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0