@use 'sass:math';
@use 'sass:string';
html {
background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
height: 100%;
width: 100%;
overflow: hidden;
}
@function createShadow($n) {
$shadow: '#{math.random(100)}vw #{math.random(100)}vh #fff';
@for $i from 2 through $n {
$shadow: '#{$shadow}, #{math.random(100)}vw #{math.random(100)}vh #fff';
}
@return string.unquote($shadow);
}
$count: 1000;
$duration: 2000s;
@for $i from 1 through 5 {
$count: math.floor(calc($count / 2));
$duration: math.floor(calc($duration / 2));
.layer#{$i} {
$size: #{$i}px;
position: fixed;
width: $size;
height: $size;
border-radius: 50%;
left: 0;
top: 0;
box-shadow: createShadow($count);
animation: moveUp $duration linear infinite;
&::after {
content: '';
width: inherit;
height: inherit;
position: fixed;
top: 100vh;
left: 0;
border-radius: inherit;
box-shadow: inherit;
}
}
}
@keyframes moveUp {
100% {
transform: translateY(-100vh);
}
}
<body>
<div class="layer1"></div>
<div class="layer2"></div>
<div class="layer3"></div>
<div class="layer4"></div>
<div class="layer5"></div>
</body>
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
2024-02-15 [Rust] Macros vs. Functions
2024-02-15 [Rust] Error handling with Enum
2023-02-15 [Typescript] Creating Chainable Method Abstractions with Generics and the Builder Pattern - 05
2021-02-15 [Node] Install packages correctly and avoid attacks
2020-02-15 【时间管理】猴子理论 ”monkey-on-the-back” Analogy
2020-02-15 【时间管理】GTD:Getting things done
2019-02-15 [Webpack] Create Separate webpack Configs for Development and Production with webpack-merge