diff options
Diffstat (limited to 'views/script/win_global.js')
-rw-r--r-- | views/script/win_global.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/views/script/win_global.js b/views/script/win_global.js new file mode 100644 index 0000000..3609af7 --- /dev/null +++ b/views/script/win_global.js @@ -0,0 +1,22 @@ +if (native) {global.$ = require('jquery');} else {var script = document.createElement('script');script.src = '../webinit/jquery.js';script.type = 'text/javascript';document.getElementsByTagName('head')[0].appendChild(script);} +$("#box").fadeOut(0); +setTimeout(() => { + $("#box").fadeIn(500); +}, 200) + +keysEnabled = true; +$(document).keydown(function(e) { + if (keysEnabled) { + if (e.keyCode === 13 || e.keyCode === 88 || e.keyCode === 32 || e.keyCode === 27 || e.keyCode === 8 || e.keyCode === 16) { // enter/esc + Sound.click(); + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("GWinWindow", "Switching control to MenuWindow"); + location.href = "menu.html"; + }, 3000) + } + } +}) + +info("GWinWindow", "Rendered!");
\ No newline at end of file |