Fix: 烟花/下雨改用clearRect不遮挡背景,雷电次数增至10次更密集

This commit is contained in:
2026-02-27 14:17:56 +08:00
parent 709e0d4975
commit 215fbd7221
3 changed files with 10 additions and 16 deletions
+2 -7
View File
@@ -78,14 +78,9 @@ const RainEffect = (() => {
let animId = null;
const startTime = performance.now();
// 画"乌云"背景遮罩(让画面有阴暗感但不完全遮住聊天)
ctx.fillStyle = "rgba(30, 40, 60, 0.18)";
ctx.fillRect(0, 0, w, h);
function animate(now) {
// 用极轻微的透明背景刷新(保留少量拖尾感
ctx.fillStyle = "rgba(30, 40, 60, 0.08)";
ctx.fillRect(0, 0, w, h);
// 清除画布(保持透明,不遮挡聊天背景
ctx.clearRect(0, 0, w, h);
drops.forEach((d) => {
d.update();