Feat: 管理员进入聊天室自动触发烟花+公屏欢迎公告

This commit is contained in:
2026-02-27 14:34:04 +08:00
parent 998611f4ba
commit 4668c163aa
2 changed files with 29 additions and 1 deletions

View File

@@ -405,6 +405,13 @@
onlineUsers[u.username] = u;
});
renderUserList();
// 管理员自己进房时,在本地播放烟花(服务端广播可能在 WS 连上前已发出)
const ctx = window.chatContext;
if (ctx && ctx.userLevel >= ctx.superLevel && typeof EffectManager !== 'undefined') {
// 延迟 800ms 确保页面渲染完成再播特效
setTimeout(() => EffectManager.play('fireworks'), 800);
}
});
window.addEventListener('chat:joining', (e) => {