优化聊天室特效加载与移动端性能
This commit is contained in:
@@ -66,7 +66,8 @@ const RainEffect = (() => {
|
||||
const w = canvas.width;
|
||||
const h = canvas.height;
|
||||
const DURATION = 8000;
|
||||
const DROP_COUNT = 200; // 增加雨滴数量(原 180)
|
||||
const isMobile = window.matchMedia?.("(max-width: 640px)")?.matches || window.innerWidth <= 640;
|
||||
const DROP_COUNT = isMobile ? 130 : 200; // 移动端降低雨线数量,避免满屏线段拖慢滚动和输入。
|
||||
|
||||
const drops = Array.from({ length: DROP_COUNT }, () => {
|
||||
const d = new Drop(w, h);
|
||||
|
||||
Reference in New Issue
Block a user