css实现小球从墙上弹下来动画效果代码
代码语言:html
所属分类:动画
代码描述: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: #111; color: #fff; min-height: 100vh; display: flex; justify-content: center; align-items: center; perspective: 800px; overflow: hidden; } .fall { position: relative; transform-style: preserve-3d; -webkit-animation: fallRotate 42s infinite linear; animation: fallRotate 42s infinite linear; } @-webkit-keyframes fallRotate { to { transform: rotateY(360deg); } } @keyframes fallRotate { to { transform: rotateY(360deg); } } .wall { position: absolute; width: 80px; height: 80px; transform-style: preserve-3d; background-image: linear-gradient(#0007, #000c); -webkit-animation: move 15s infinite linear; animation: move 15s infinite linear; bottom: -210px; } .wall:nth-child(odd) { left: -10px; transform: translate(-50%, 50%) rotateY(90deg) rotateX(45deg) translatez(-20px) translateY(-220px); } .wall:nth-child(even) { left: 10px; transform: translate(-50%, 50%) rotateY(-90deg) rotateX(45deg) translatez(-20px) translateY(-220px); } .wall:nth-child(1) { -webkit-animation-delay: -1.5s; animation-delay: -1.5s; background-color: #ef8f8f; } .wall:nth-child(2) { -webkit-animation-delay: -3s; animation-delay: -3s; background-color: #efc98f; } .wall:nth-child(3) { -webkit-animation-delay: -4.5s; animation-delay: -4.5s; background-color: #dcef8f; } .wall:nth-child(4) { -webkit-animation-delay: -6s; animation-delay: -6s; background-col.........完整代码请登录后点击上方下载按钮下载查看
网友评论0