From d5a620cf09b835db2bccd99556525c90b458719f Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 5 Aug 2021 17:21:23 +0200 Subject: i18n for 21.08 --- sfx/sfx.js | 118 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'sfx') diff --git a/sfx/sfx.js b/sfx/sfx.js index 9ed6418..71e3fe3 100644 --- a/sfx/sfx.js +++ b/sfx/sfx.js @@ -1,60 +1,60 @@ -const Sound = { - pass: () => { - new Audio(kresources.sfx['pass']).play() - }, - last: () => { - new Audio(kresources.sfx['last']).play() - }, - crash: () => { - new Audio(kresources.sfx['crash']).play() - }, - win: () => { - new Audio(kresources.sfx['win']).play() - }, - click: () => { - new Audio(kresources.sfx['click']).play() - }, - menu: () => { - new Audio(kresources.sfx['menu']).play() - }, - pause: () => { - new Audio(kresources.sfx['pause']).play() - }, - start: () => { - new Audio(kresources.sfx['start']).play() - }, - intro: () => { - new Audio(kresources.music['start'].file).play() - }, -} - -shouldMusicPlay = true; - -setInterval(() => { - try { - if (typeof document.getElementById('music') !== "undefined" && typeof document.getElementById('music') !== "null") { - if (shouldMusicPlay) { - document.getElementById('music').play(); - } - if (!shouldMusicPlay) { - document.getElementById('music').pause(); - } - } - if (typeof b !== "undefined" && typeof b !== "null") { - if (shouldMusicPlay) { - b.play(); - } - if (!shouldMusicPlay) { - b.pause(); - } - } - if (typeof me !== "undefined" && typeof me !== "null") { - if (me.currentTime < me.duration) { - me.play(); - } - if (me.currentTime >= me.duration) { - me.pause(); - } - } - } catch (e) {} +const Sound = { + pass: () => { + new Audio(kresources.sfx['pass']).play() + }, + last: () => { + new Audio(kresources.sfx['last']).play() + }, + crash: () => { + new Audio(kresources.sfx['crash']).play() + }, + win: () => { + new Audio(kresources.sfx['win']).play() + }, + click: () => { + new Audio(kresources.sfx['click']).play() + }, + menu: () => { + new Audio(kresources.sfx['menu']).play() + }, + pause: () => { + new Audio(kresources.sfx['pause']).play() + }, + start: () => { + new Audio(kresources.sfx['start']).play() + }, + intro: () => { + new Audio(kresources.music['start'].file).play() + }, +} + +shouldMusicPlay = true; + +setInterval(() => { + try { + if (typeof document.getElementById('music') !== "undefined" && typeof document.getElementById('music') !== "null") { + if (shouldMusicPlay) { + document.getElementById('music').play(); + } + if (!shouldMusicPlay) { + document.getElementById('music').pause(); + } + } + if (typeof b !== "undefined" && typeof b !== "null") { + if (shouldMusicPlay) { + b.play(); + } + if (!shouldMusicPlay) { + b.pause(); + } + } + if (typeof me !== "undefined" && typeof me !== "null") { + if (me.currentTime < me.duration) { + me.play(); + } + if (me.currentTime >= me.duration) { + me.pause(); + } + } + } catch (e) {} }, 200) \ No newline at end of file -- cgit