div+css实现夜晚驾车回家路上路灯模糊动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现夜晚驾车回家路上路灯模糊动画效果代码
代码标签: div css 夜晚 驾车 回家 路上 路灯 模糊 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *::before, *::after { font-family: inherit; box-sizing: inherit; margin: 0; padding: 0; } html { box-sizing: border-box; font-family: 'Nunito Sans', sans-serif; font-size: 62.5%; } html body { font-size: 1.6rem; margin: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; } ul { list-style: none; } a, a:link, a:visited { text-decoration: none; } </style> <style> .container .city-lights .light, .container .cars-going .car, .container .cars-going .reflect, .container .cars-going-flash .car, .container .cars-going-flash .reflect, .container .cars-incoming .car, .container .cars-incoming .reflect, .container .street-lamps .street-lamp, .container, .container > * { display: flex; align-items: center; justify-content: center; } .container, .container > * { position: absolute; width: 100%; height: 100%; left: 0; top: 0; } .container .city-lights .light::before, .container .cars-going .car::before, .container .cars-going .reflect::before, .container .cars-going-flash .car::before, .container .cars-going-flash .reflect::before, .container .cars-incoming .car::before, .container .cars-incoming .reflect::before, .container .street-lamps .street-lamp::before, .container .city-lights .light::after, .container .cars-going .car::after, .container .cars-going .reflect::after, .container .cars-going-flash .car::after, .container .cars-going-flash .reflect::after, .container .cars-incoming .car::after, .container .cars-incoming .reflect::after, .container .street-lamps .street-lamp::after { -webkit-mask-image: radial-gradient(closest-side, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8) 75%, white); mask-image: radial-gradient(closest-side, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8) 75%, white); } .container .city-lights .light, .container .cars-going .car, .container .cars-going .reflect, .container .cars-going-flash .car, .container .cars-going-flash .reflect, .container .cars-incoming .car, .container .cars-incoming .reflect, .container .street-lamps .street-lamp { display: block; width: var(--width); height: var(--size); position: absolute; -webkit-animation: move var(--speed) linear infinite forwards; animation: move var(--speed) linear infinite forwards; filter: blur(2px); } .container .city-lights .light::before, .container .cars-going .car::before, .container .cars-going .reflect::before, .container .cars-going-flash .car::before, .container .cars-going-flash .reflect::before, .container .cars-incoming .car::before, .container .cars-incoming .reflect::before, .container .street-lamps .street-lamp::before, .container .city-lights .light::after, .container .cars-going .car::after, .container .cars-going .reflect::after, .container .cars-going-flash .car::after, .container .cars-going-flash .reflect::after, .container .cars-incoming .car::after, .container .cars-incoming .reflect::after, .container .street-lamps .street-lamp::after { content: ""; display: block; position: absolute; height: 100%; aspect-ratio: 1/1; border-radius: 100%; background-color: currentColor; } .container .city-lights .light::before, .container .cars-going .car::before, .container .cars-going .reflect::before, .container .cars-going-flash .car::before, .container .cars-going-flash .reflect::before, .container .cars-incoming .car::before, .container .cars-incoming .reflect::before, .container .street-lamps .street-lamp::before { left: 0; } .container .city-lights .light::after, .container .cars-going .car::after, .container .cars-going .reflect::after, .container .cars-going-flash .car::after, .container .cars-going-flash .reflect::after, .container .cars-incoming .car::after, .container .cars-inco.........完整代码请登录后点击上方下载按钮下载查看
网友评论0