悄悄话:变星特效等星空画好再放,放了才记下
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
16
js/wh-cm.js
16
js/wh-cm.js
@@ -90,9 +90,19 @@
|
||||
function celebrate() {
|
||||
var done = {}; try { done = JSON.parse(localStorage.getItem(SK) || '{}') || {}; } catch (e) {}
|
||||
var c = (REAL || []).filter(function (x) { return x.me && x.star && !done[x.id]; })[0];
|
||||
if (!c) return;
|
||||
done[c.id] = 1; try { localStorage.setItem(SK, JSON.stringify(done)); } catch (e) {}
|
||||
setTimeout(function () { if (page.classList.contains('show')) starFx(c.t, true); }, 1200);
|
||||
if (!c || celebrate.on) return;
|
||||
/* 等星空里的星星画出来再放(拉星星要几秒),放了才记下,没放成下次进来还会放 */
|
||||
celebrate.on = 1; var n = 0;
|
||||
(function wait() {
|
||||
if (++n > 40) { celebrate.on = 0; return; }
|
||||
if (!page.classList.contains('show') || !page.querySelector('.wsk-st')) { setTimeout(wait, 500); return; }
|
||||
setTimeout(function () {
|
||||
celebrate.on = 0;
|
||||
if (!page.classList.contains('show')) return;
|
||||
done[c.id] = 1; try { localStorage.setItem(SK, JSON.stringify(done)); } catch (e) {}
|
||||
starFx(c.t, true);
|
||||
}, 1200);
|
||||
})();
|
||||
}
|
||||
function starFx(text, mine) {
|
||||
snap('closed');
|
||||
|
||||
Reference in New Issue
Block a user