diff options
author | Minteck <nekostarfan@gmail.com> | 2021-06-10 22:00:49 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-06-10 22:00:49 +0200 |
commit | dfbe8476aa6323bf1d9e699b5e08165a8403b21c (patch) | |
tree | e2fab6a5986c1f7b9d55a7b1009263ff98b5a33c /views | |
parent | 3e62534eb7db3011ef540b6053811d48761dda21 (diff) | |
download | kartik-client-dfbe8476aa6323bf1d9e699b5e08165a8403b21c.tar.gz kartik-client-dfbe8476aa6323bf1d9e699b5e08165a8403b21c.tar.bz2 kartik-client-dfbe8476aa6323bf1d9e699b5e08165a8403b21c.zip |
(Pre)final commit !
Diffstat (limited to 'views')
-rw-r--r-- | views/credits.html | 9 | ||||
-rw-r--r-- | views/menu.html | 2 | ||||
-rw-r--r-- | views/script/core_chart.js | 26 | ||||
-rw-r--r-- | views/script/core_music.js | 89 | ||||
-rw-r--r-- | views/script/credits_libs.js | 6 |
5 files changed, 76 insertions, 56 deletions
diff --git a/views/credits.html b/views/credits.html index e3ff9f9..46978b6 100644 --- a/views/credits.html +++ b/views/credits.html @@ -39,10 +39,13 @@ <!-- START credits --> - <h2>Kartik, a 2D car race game</h2> - <p>© Minteck Projects. All assets are licensed under their original license rather than Kartik's license.</p> + <h2>Kartik, a 2D car racing game</h2> + <p>© Minteck Projects/Cutefox Studios. All assets are licensed under their original license rather than Kartik's license.</p> <p class="technical"><script src="./script/credits_technical.js"></script></p> + made by<br> + <img id="banner" src="common/banner.gif" style="width:380px;"> + <p class="cred-title">Lead</p> <p class="cred-content">Minteck</p> @@ -184,7 +187,7 @@ <p class="cred-content">Minteck<br>Romain<br>Redman 054<br>Oxymillion</p> <p class="cred-title">Libraries</p> - <p class="cred-content"><script src="./script/credits_libs.js"></script></p> + <div class="cred-content" style="display:grid;grid-template-columns: 1fr 1fr 1fr; text-align:center;"><script src="./script/credits_libs.js"></script></div> <!-- END credits --> diff --git a/views/menu.html b/views/menu.html index 0c6849f..661d397 100644 --- a/views/menu.html +++ b/views/menu.html @@ -41,7 +41,7 @@ <script id="prefill"> if (require('@electron/remote').getCurrentWindow().online) { document.write(`<li><span class="item"><a href="#" id="play"><img class="item-icon" src="../icons/local.svg"> ${lang.online.menu.local}</a></span></li>`) - document.write(`<li><span class="item"><a href="#" id="online"><img class="item-icon" src="../icons/online.svg"> ${lang.online.menu.online} <span style="font-size: 10px;vertical-align: middle;display: inline-block;border-radius: 999px;padding: 2px 5px;background: #9c6500;">BETA</span></a></span></li>`); + document.write(`<li><span class="item"><a href="#" id="online"><img class="item-icon" src="../icons/online.svg"> ${lang.online.menu.online}</a></span></li>`); document.write(`<li><span class="item"><a href="#" id="settings"><img class="item-icon" src="../icons/settings.svg"> ${lang.menu.titles[2]}</a></span></li>`); } else { document.write(`<li><span class="item"><a href="#" id="play"><img class="item-icon" src="../icons/local.svg"> ${lang.online.menu.local}</a></span></li>`) diff --git a/views/script/core_chart.js b/views/script/core_chart.js index 179dd82..d34ce21 100644 --- a/views/script/core_chart.js +++ b/views/script/core_chart.js @@ -8,33 +8,42 @@ setInterval(() => { file = webview.getURL().split("/")[webview.getURL().split("/").length - 1]; activity = lang.discord.game[0]; - enableActivity = true; + enableActivity = false; eaid = ""; switch (file) { case "game.html?online": + enableActivity = true; activity = lang.online.discord; break; case "game.html?sp": + enableActivity = true; activity = lang.discord.game[1]; break; case "game.html": + enableActivity = true; activity = lang.discord.game[2]; break; case "intro.html": + enableActivity = true; activity = lang.discord.intro[1]; break; case "settings.html": + case "stats.html": + enableActivity = true; activity = lang.discord.settings[1]; break; case "credits.html": + enableActivity = true; activity = lang.discord.credits[1]; break; case "online.html": + enableActivity = true; activity = lang.online.discord2; break; case "menu.html": case "win.html": + enableActivity = true; activity = lang.discord.credits[0]; break; case "loader.html": @@ -53,11 +62,20 @@ setInterval(() => { } if (require('./package.json').channel === "git") { - document.getElementById('experimental-ramusage').innerText = currentMemoryMib; - document.title="Kartik Trunk " +require('./package.json').version + eaid; + if (currentMemory < 100) { + document.getElementById('experimental-ramusage').innerText = "0" + currentMemoryMib; + } else { + document.getElementById('experimental-ramusage').innerText = currentMemoryMib; + } + buff = Buffer.from(activity, 'utf-8').toString("hex"); + document.title="Kartik Trunk " +require('./package.json').version + "-" + require('./package.json').serial.toLowerCase() + "-debugkeys - <Debugging On>"; } else { if (require('./package.json').channel !== "stable") { - document.getElementById('experimental-ramusage').innerText = currentMemoryMib; + if (currentMemory < 100) { + document.getElementById('experimental-ramusage').innerText = "0" + currentMemoryMib; + } else { + document.getElementById('experimental-ramusage').innerText = currentMemoryMib; + } document.title="Kartik"+require('@electron/remote').getCurrentWindow().channel+require('./package.json').version + eaid; } else { document.title="Kartik"+require('@electron/remote').getCurrentWindow().channel+require('./package.json').version + eaid; diff --git a/views/script/core_music.js b/views/script/core_music.js index adb0ae2..4b85ebb 100644 --- a/views/script/core_music.js +++ b/views/script/core_music.js @@ -1,11 +1,34 @@ -global.csng = null; +/*global.csng = null; global.csp1 = null; global.csp2 = null; -global.cspn = 1; +global.cspn = 1;*/ +global.musicElement = new Audio(); const musicIpc = require('electron').ipcRenderer; musicIpc.on('setmusic', (event, args) => { - try { csp1.volume = 0; } catch (e) {} + if (!musicElement.paused) { + csi1 = setInterval(() => { + if (musicElement.volume <= 0.05) { + clearInterval(csi1); + musicElement.src = args; + musicElement.play(); + musicElement.volume = 0; + csi2 = setInterval(() => { + if (musicElement.volume >= 0.95) { + clearInterval(csi2); + return; + } + musicElement.volume = musicElement.volume + 0.05; + }, 100) + return; + } + musicElement.volume = musicElement.volume - 0.05; + }, 100) + } else { + musicElement.src = args; + musicElement.play(); + } + /*try { csp1.volume = 0; } catch (e) {} try { csp2.volume = 0; } catch (e) {} song = args; @@ -61,53 +84,29 @@ musicIpc.on('setmusic', (event, args) => { csng = song; cspn = 1; } - } + }*/ }) musicIpc.on('fademusic', (event) => { - if (cspn === 1) { - if (csp1 !== null) { - csi1 = setInterval(() => { - if (csp1.volume <= 0.05) { - clearInterval(csi1); - return; - } - csp1.volume = csp1.volume - 0.05; - }, 100) - } - } else { - if (csp2 !== null) { - csi2 = setInterval(() => { - if (csp2.volume <= 0.05) { - clearInterval(csi2); - return; - } - csp2.volume = csp2.volume - 0.05; - }, 100) - } + if (!musicElement.paused) { + csi1 = setInterval(() => { + if (musicElement.volume <= 0.3) { + clearInterval(csi1); + return; + } + musicElement.volume = musicElement.volume - 0.05; + }, 100) } }) musicIpc.on('unfademusic', (event) => { - if (cspn === 1) { - if (csp1 !== null) { - csi1 = setInterval(() => { - if (csp1.volume >= 0.95) { - clearInterval(csi1); - return; - } - csp1.volume = csp1.volume + 0.05; - }, 100) - } - } else { - if (csp2 !== null) { - csi2 = setInterval(() => { - if (csp2.volume >= 0.95) { - clearInterval(csi2); - return; - } - csp2.volume = csp2.volume + 0.05; - }, 100) - } + if (!musicElement.paused) { + csi1 = setInterval(() => { + if (musicElement.volume >= 0.95) { + clearInterval(csi1); + return; + } + musicElement.volume = musicElement.volume + 0.05; + }, 100) } -})
\ No newline at end of file +}) diff --git a/views/script/credits_libs.js b/views/script/credits_libs.js index 9e2f21a..26ee36b 100644 --- a/views/script/credits_libs.js +++ b/views/script/credits_libs.js @@ -1,15 +1,15 @@ Object.keys(process.versions).forEach((e) => { v = process.versions[e]; - document.write(e.substr(0, 1).toUpperCase() + e.substr(1) + " contributors<br>"); + document.write("<div>" + e.substr(0, 1).toUpperCase() + e.substr(1) + " contributors</div>"); }) dirs = require('fs').readdirSync("./node_modules"); dirs.forEach((dir) => { if (!dir.startsWith(".") && !dir.startsWith("@") && dir !== "electron") { j = JSON.parse(require('fs').readFileSync("./node_modules/" + dir + "/package.json").toString()); if (typeof j.author === "string") { - document.write(j.author + "<br>"); + document.write("<div>" + j.author + "</div>"); } else { - document.write(j.name.substr(0, 1).toUpperCase() + j.name.substr(1) + " authors<br>"); + document.write("<div>" + j.name.substr(0, 1).toUpperCase() + j.name.substr(1) + " authors</div>"); } } })
\ No newline at end of file |