aboutsummaryrefslogtreecommitdiff
path: root/views/script/credits_global.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
committerMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
commit8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch)
tree7096b67b189c0220826123c7d5b121752545d140 /views/script/credits_global.js
downloadkartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip
Presque sortie du jeu
Diffstat (limited to 'views/script/credits_global.js')
-rw-r--r--views/script/credits_global.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/views/script/credits_global.js b/views/script/credits_global.js
new file mode 100644
index 0000000..58946ff
--- /dev/null
+++ b/views/script/credits_global.js
@@ -0,0 +1,54 @@
+let menuOpen = true;
+
+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);}
+
+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
+ keysEnabled = false;
+ Sound.click();
+ require('electron').ipcRenderer.send('prefademusic', "");
+ $("#box").fadeOut(500);
+ setTimeout(() => {
+ info("GWinWindow", "Switching control to MenuWindow");
+ location.href = "settings.html?credits";
+ }, 1000)
+ }
+ }
+})
+
+var currentpos=0,alt=1,curpos1=0,curpos2=-1
+function initialize(){
+ $("#box").fadeIn(500);
+ startit()
+}
+function scrollwindow(){
+ if (document.all)
+ temp=document.body.scrollTop
+ else
+ temp=window.pageYOffset
+ if (alt===0)
+ alt=1
+ else
+ alt=0
+ if (alt===0)
+ curpos1=temp
+ else
+ curpos2=temp
+ if (curpos1!==curpos2){
+ if (document.all)
+ currentpos=document.body.scrollTop+1
+ else
+ currentpos=window.pageYOffset+1
+ window.scroll(0,currentpos)
+ }
+ else{
+ currentpos=0
+ window.scroll(0,currentpos)
+ }
+}
+function startit(){
+ setInterval("scrollwindow()",20)
+}
+window.onload=initialize