css实现立体彩虹小球滚动动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现立体彩虹小球滚动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *::before, *::after { position: relative; box-sizing: border-box; margin: 0; padding: 0; } body { margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; height: 100vh; background: #777777; overflow: hidden; background-image: linear-gradient(145deg, rgba(255, 255, 220, 1), rgba(255, 255, 220, 0) 66%), linear-gradient(220deg, rgba(30, 45, 70, 0.75), rgba(30, 45, 70, 0) 70%); &::before { content: ""; display: block; position: absolute; bottom: 0; left: 0; right: 0; height: 50%; z-index: -1; background: linear-gradient(to top, #707070 33%, #ffffff33 100%); } } #ball { position: relative; width: 200px; height: 200px; border-radius: 50%; animation: rolling 5s infinite linear; &::before { content: ""; display: block; position: absolute; bottom: -5px; left: 25px; width: 200px; height: 30px; border-radius: 50%; background-image: radial-gradient(ellipse at 35% 75%, #000000 10%, #00000000 70%); z-index: -1; } &::after { content: ""; display: block; position: absolute; inset: 0; border-radius: 50%; background: #f090f0; background-image: radial-gradient( circle, #ffffff, #ffffff77 10%, #ffffff00 calc(10% + 1px), #ffffff00 20%, #ffffff77 calc(20% + 1px), #ffffff77 30%, #ffffff00 calc(30% .........完整代码请登录后点击上方下载按钮下载查看
网友评论0