css实现多彩方形旋转组成三角形立体效果代码
代码语言:html
所属分类:动画
代码描述:css实现多彩方形旋转组成三角形立体效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background-color: #0F0F0F; } .tri { position: absolute; top: 50%; left: 50%; transform: translate(-50%, 100%); width: 50px; height: 50px; } .tri .side { width: 50px; height: 50px; position: absolute; transform-origin: center center; } .tri .side:nth-child(1) { transform: translateX(-100px); } .tri .side:nth-child(2) { transform: translateX(0px); } .tri .side:nth-child(3) { transform: translateX(100px); } .tri .side:nth-child(2) { transform: translateY(-150px); } .tri .ring { width: 50px; height: 50px; position: absolute; background: white; -webkit-animation-name: rotate, cromatic; animation-name: rotate, cromatic; -webkit-animation-duration: 3s, 3s; animation-duration: 3s, 3s; -webkit-animation-timing-function: linear, linear; animation-timing-function: linear, linear; -webkit-animation-iteration-count: infinite, infinite; animation-iteration-count: infinite, infinite; opacity: 0.5; box-shadow: 0 0 30px black; border-radius: 20%; } .side:nth-child(1) .ring:nth-child(0) { margin: 0 0 0 0px; z-index: 0; -webkit-animation-delay: 0s; animation-delay: 0s; } .side:nth-child(1) .ring:nth-child(1) { margin: 0 0 0 6.6666666667px; z-index: 1; -webkit-animation-delay: 0.0333333333s; animation-delay: 0.0333333333s; } .side:nth-child(1) .ring:nth-child(2) { margin: 0 0 0 13.3333333333px; z-index: 2; -webkit-animation-delay: 0.0666666667s; animation-delay: 0.0666666667s; } .side:nth-child(1) .ring:nth-child(3) { margin: 0 0 0 20px; z-index: 3; -webkit-animation-delay: 0.1s; animation-delay: 0.1s; } .side:nth-child(1) .ring:nth-child(4) { margin: 0 0 0 26.6666666667px; z-index: 4; -webkit-animation-delay: 0.1333333333s; animation-delay: 0.1333333333s; } .side:nth-child(1) .ring:nth-child(5) { margin: 0 0 0 33.3333333333px; z-index: 5; -webkit-animation-delay: 0.1666666667s; animation-delay: 0.1666666667s; } .side:nth-child(1) .ring:nth-child(6) { margin: 0 0 0 40px; z-index: 6; -webkit-animation-delay: 0.2s; animation-delay: 0.2s; } .side:nth-child(1) .ring:nth-child(7) { margin: 0 0 0 46.6666666667px; z-index: 7; -webkit-animation-delay: 0.2333333333s; animation-delay: 0.2333333333s; } .side:nth-child(1) .ring:nth-child(8) { margin: 0 0 0 53.3333333333px; z-index: 8; -webkit-animation-delay: 0.2666666667s; animation-delay: 0.2666666667s; } .side:nth-child(1) .ring:nth-child(9) { margin: 0 0 0 60px; z-index: 9; -webkit-animation-delay: 0.3s; animation-delay: 0.3s; } .side:nth-child(1) .ring:nth-child(10) { margin: 0 0 0 66.6666666667px; z-index: 10; -webkit-animation-delay: 0.3333333333s; animation-delay: 0.3333333333s; } .side:nth-child(1) .ring:nth-child(11) { margin: 0 0 0 73.3333333333px; z-index: 11; -webkit-animation-delay: 0.3666666667s; animation-delay: 0.3666666667s; } .side:nth-child(1) .ring:nth-child(12) { margin: 0 0 0 80px; z-index: 12; -webkit-animation-delay: 0.4s; animation-delay: 0.4s; } .side:nth-child(1) .ring:nth-child(13) { margin: 0 0 0 86.6666666667px; z-index: 13; -webkit-animation-delay: 0.4333333333s; animation-delay: 0.4333333333s; } .side:nth-child(1) .ring:nth-child(14) { margin: 0 0 0 93.3333333333px; z-index: 14; -webkit-animation-delay: 0.4666666667s; animation-delay: 0.4666666667s; } .side:nth-child(1) .ring:nth-child(15) { margin: 0 0 0 100px; z-index: 15;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0