refactor(client): specify global scope
This commit is contained in:
@ -136,7 +136,7 @@ export function physics(container: HTMLElement) {
|
||||
}
|
||||
|
||||
// 奈落に落ちたオブジェクトは消す
|
||||
const intervalId = setInterval(() => {
|
||||
const intervalId = window.setInterval(() => {
|
||||
for (const obj of objs) {
|
||||
if (obj.position.y > (containerHeight + 1024)) Matter.World.remove(world, obj);
|
||||
}
|
||||
@ -146,7 +146,7 @@ export function physics(container: HTMLElement) {
|
||||
stop: () => {
|
||||
stop = true;
|
||||
Matter.Runner.stop(runner);
|
||||
clearInterval(intervalId);
|
||||
window.clearInterval(intervalId);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -34,11 +34,11 @@ export const builtinThemes = [
|
||||
let timeout = null;
|
||||
|
||||
export function applyTheme(theme: Theme, persist = true) {
|
||||
if (timeout) clearTimeout(timeout);
|
||||
if (timeout) window.clearTimeout(timeout);
|
||||
|
||||
document.documentElement.classList.add('_themeChanging_');
|
||||
|
||||
timeout = setTimeout(() => {
|
||||
timeout = window.setTimeout(() => {
|
||||
document.documentElement.classList.remove('_themeChanging_');
|
||||
}, 1000);
|
||||
|
||||
|
Reference in New Issue
Block a user