diff options
author | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
commit | 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch) | |
tree | 7096b67b189c0220826123c7d5b121752545d140 /views/script/intro_global.js | |
download | kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2 kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip |
Presque sortie du jeu
Diffstat (limited to 'views/script/intro_global.js')
-rw-r--r-- | views/script/intro_global.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/views/script/intro_global.js b/views/script/intro_global.js new file mode 100644 index 0000000..b6bf033 --- /dev/null +++ b/views/script/intro_global.js @@ -0,0 +1,21 @@ +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); +window.addEventListener('load', () => { + setTimeout(() => { + $("#box").fadeIn(500); + }, 1000) +}) + +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 + kesyEnabled = false; + $("#box").fadeOut(500); + setTimeout(() => { + info("GWinWindow", "Switching control to MenuWindow"); + location.href = "menu.html?noreset"; + }, 1000) + } + } +})
\ No newline at end of file |