From 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 5 Jun 2021 19:27:48 +0200 Subject: Presque sortie du jeu --- views/script/intro_global.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 views/script/intro_global.js (limited to 'views/script/intro_global.js') 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 -- cgit