Added comments

This commit is contained in:
Vaclav Siml 2023-02-24 23:58:26 +01:00
parent d6154ad3f5
commit 693b6ef5aa

View file

@ -14,7 +14,8 @@
</script> <!--Loadne Vars.js--> </script> <!--Loadne Vars.js-->
<div class="hlavnidiv"> <div class="hlavnidiv">
<div class="container"> <div class="container">
<button class="move" type="button" id="sdvx3-button" onclick="vers=3;sdvx()"> <button class="move" type="button" id="sdvx3-button" onclick="vers=3;sdvx()"> <!-- on click sets var vers to number and then runs sdvx which is just switch for
game path select-->
<img src="JPGS/sound-voltex-iii-gravity-wars-1.png" alt=""> <img src="JPGS/sound-voltex-iii-gravity-wars-1.png" alt="">
<h1 class="sex">Sound Voltex III: Gravity Wars</h1> <h1 class="sex">Sound Voltex III: Gravity Wars</h1>
</button> <!--SDVX3--> </button> <!--SDVX3-->
@ -44,24 +45,21 @@
</div> </div>
<script> <script>
const prvnihra = [...document.querySelectorAll("button")] //creates array from buttons for focus select
const prvnihra = [...document.querySelectorAll("button")]
// for (i = 0; i < prvnihra.length; i++) {
//console.log(prvnihra[i]);
//}
console.log(prvnihra[0]) console.log(prvnihra[0])
prvnihra[0].focus(); /* Handles interaction with bindable buttons and focus*/ prvnihra[0].focus();
</script> </script>
<script> <script>
/**/ //SFX Audio Sources
var i = 0; var i = 0;
const switchfocus = new Audio("Audio/switchfocus.mp3"); const switchfocus = new Audio("Audio/switchfocus.mp3");
const startaudio = new Audio("Audio/audiostart.mp3") const startaudio = new Audio("Audio/audiostart.mp3")
/* Handles interaction with bindable buttons and focus*/
document.addEventListener("keydown", function (KeypressD) { document.addEventListener("keydown", function (KeypressD) {
if (KeypressD.code === KeyRight) { if (KeypressD.code === KeyRight) {
if (i >= prvnihra.length - 1) i = -1; if (i >= prvnihra.length - 1) i = -1;
switchfocus.play(); switchfocus.play(); //plays audio
i++; i++;
prvnihra[i].focus(); prvnihra[i].focus();
console.log("right", i); console.log("right", i);
@ -116,16 +114,17 @@
<script> <script>
var vers = 0; /* Handles Running of apps */ var vers = 0;
const { execFile, exec, spawn } = require('child_process'); const { execFile, exec, spawn } = require('child_process');
function sdvx() { function sdvx() {
console.log("promenna", vers); console.log("promenna", vers);
/* Handles Running of apps */
switch (vers) { switch (vers) {
case 3: case 3:
execFile(AsphyxiaPath); execFile(AsphyxiaPath);
exec("start /b " + SDVX3Path); exec("start /b " + SDVX3Path); //executes cmd with start and path
setTimeout(function () { setTimeout(function () {
exec("taskkill /im " + browser) exec("taskkill /im " + browser)//kills browser
}, 2000) }, 2000)
//console.log(vers); //console.log(vers);
break; break;