gsap实现流星 滑过帆布磨砂动画透明效果代码
代码语言:html
所属分类:动画
代码描述:gsap实现流星 滑过帆布磨砂动画透明效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *:after, *:before { box-sizing: border-box; } body { display: grid; place-items: center; min-height: 100vh; font-family: "SF Pro Text", "SF Pro Icons", "AOS Icons", "Helvetica Neue", Helvetica, Arial, sans-serif, system-ui; background: linear-gradient(50deg, hsl(0 0% 50% / 0.25), transparent), hsl(0 0% 0%); overflow: hidden; } .meteor { aspect-ratio: 1; width: 200px; filter: drop-shadow(0 0 25px orange); background: radial-gradient(hsl(30 80% 50% / 0.05), transparent 50%); /* outline: 2px dashed hsl(0 0% 50% / 0.15);*/ position: absolute; left: 50%; bottom: 100%; translate: -50% -50%; -webkit-animation: scale var(--speed) calc(var(--speed) * -0.5) infinite linear ; animation: scale var(--speed) calc(var(--speed) * -0.5) infinite linear ; } @-webkit-keyframes scale { to { transform: translateY(calc(100cqh + 200%)); } } @keyframes scale { to { transform: translateY(calc(100cqh + 200%)); } } .line { --speed: 6s; width: 2px; position: relative; height: 150vmax; background: hsl(0 0% 40% / 0.15); rotate: 50deg; position: fixed; top: 10%; left: 50%; translate: 0 -50%; container-type: size; } .line:nth-of-type(2) { --speed: 10s; top: 40%; } .line:nth-of-type(3) { --speed: 8s; top: 90%; } .line:nth-of-type(4) { --speed: 12s; top: 60%; } article { width: 40vmin; aspect-ratio: 4 / 3; background: hsl(0 0% 25% / 0.25); border: 1px solid hsl(0 0% 40%); border-radius: 12px; z-index: 2; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); } </style> </head> <body translate="no"> <div class="line"> <canvas class="meteor"></canvas> </div> <div class="line"> <canvas class="meteor"></canvas> </div> <div class="line"> <canvas class="meteor"></canvas> </div> <div class="line"> <canvas class="meteor"></can.........完整代码请登录后点击上方下载按钮下载查看
网友评论0