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/background.jpg | Bin 0 -> 31291 bytes views/common/bold.ttf | Bin 0 -> 58416 bytes views/common/fonts.css | 27 ++++ views/common/index.css | 29 ++++ views/common/light.ttf | Bin 0 -> 58584 bytes views/common/load-channel.otf | Bin 0 -> 59108 bytes views/common/load-version.otf | Bin 0 -> 63240 bytes views/common/mouse.css | 3 + views/common/old/Josefin Sans 100.ttf | Bin 0 -> 58400 bytes views/common/old/Josefin Sans 100italic.ttf | Bin 0 -> 62460 bytes views/common/old/Josefin Sans 200.ttf | Bin 0 -> 58568 bytes views/common/old/Josefin Sans 200italic.ttf | Bin 0 -> 62708 bytes views/common/old/Josefin Sans 300italic.ttf | Bin 0 -> 62676 bytes views/common/old/Josefin Sans 500.ttf | Bin 0 -> 58560 bytes views/common/old/Josefin Sans 500italic.ttf | Bin 0 -> 62792 bytes views/common/old/Josefin Sans 600.ttf | Bin 0 -> 58580 bytes views/common/old/Josefin Sans 600italic.ttf | Bin 0 -> 62820 bytes views/common/old/Josefin Sans 700italic.ttf | Bin 0 -> 62568 bytes views/common/old/Josefin Sans italic.ttf | Bin 0 -> 62660 bytes views/common/old/bold~.ttf | Bin 0 -> 134916 bytes views/common/old/light~.ttf | Bin 0 -> 135420 bytes views/common/old/regular~.ttf | Bin 0 -> 135304 bytes views/common/race.svg | 1 + views/common/regular.ttf | Bin 0 -> 58548 bytes views/credits.html | 198 ++++++++++++++++++++++++ views/game.css | 152 +++++++++++++++++++ views/game.html | 152 +++++++++++++++++++ views/hero.svg | 3 + views/intro.css | 33 ++++ views/intro.html | 51 +++++++ views/load.html | 52 +++++++ views/loader.html | 41 +++++ views/menu.css | 150 ++++++++++++++++++ views/menu.html | 80 ++++++++++ views/menu.jpg | Bin 0 -> 345993 bytes views/online.html | 41 +++++ views/rain/rainscript.js | 44 ++++++ views/rain/rainstyle.css | 155 +++++++++++++++++++ views/script/client_fullscreen.js | 9 ++ views/script/core_chart.js | 67 +++++++++ views/script/core_fullscreen.js | 9 ++ views/script/core_head.js | 31 ++++ views/script/core_music.js | 109 ++++++++++++++ views/script/core_stats.js | 47 ++++++ views/script/core_viewer.js | 23 +++ views/script/credits_global.js | 54 +++++++ views/script/credits_libs.js | 15 ++ views/script/credits_music.js | 4 + views/script/credits_technical.js | 9 ++ views/script/game_global.js | 45 ++++++ views/script/game_music.js | 10 ++ views/script/game_online.js | 9 ++ views/script/game_select.js | 131 ++++++++++++++++ views/script/intro_global.js | 21 +++ views/script/intro_media.js | 4 + views/script/intro_message.js | 7 + views/script/loader_global.js | 85 +++++++++++ views/script/menu_copyright.js | 5 + views/script/menu_global.js | 113 ++++++++++++++ views/script/menu_gpuinfo.js | 69 +++++++++ views/script/menu_music.js | 5 + views/script/menu_system.js | 33 ++++ views/script/online_play.js | 2 + views/script/settings_global.js | 226 ++++++++++++++++++++++++++++ views/script/settings_load.js | 25 +++ views/script/win_global.js | 22 +++ views/script/win_message.js | 9 ++ views/script/win_music.js | 4 + views/script/win_play.js | 12 ++ views/script/win_quit.js | 7 + views/settings.html | 68 +++++++++ views/splash.png | Bin 0 -> 205335 bytes views/win.html | 42 ++++++ 73 files changed, 2543 insertions(+) create mode 100644 views/background.jpg create mode 100644 views/common/bold.ttf create mode 100644 views/common/fonts.css create mode 100644 views/common/index.css create mode 100644 views/common/light.ttf create mode 100644 views/common/load-channel.otf create mode 100644 views/common/load-version.otf create mode 100644 views/common/mouse.css create mode 100644 views/common/old/Josefin Sans 100.ttf create mode 100644 views/common/old/Josefin Sans 100italic.ttf create mode 100644 views/common/old/Josefin Sans 200.ttf create mode 100644 views/common/old/Josefin Sans 200italic.ttf create mode 100644 views/common/old/Josefin Sans 300italic.ttf create mode 100644 views/common/old/Josefin Sans 500.ttf create mode 100644 views/common/old/Josefin Sans 500italic.ttf create mode 100644 views/common/old/Josefin Sans 600.ttf create mode 100644 views/common/old/Josefin Sans 600italic.ttf create mode 100644 views/common/old/Josefin Sans 700italic.ttf create mode 100644 views/common/old/Josefin Sans italic.ttf create mode 100644 views/common/old/bold~.ttf create mode 100644 views/common/old/light~.ttf create mode 100644 views/common/old/regular~.ttf create mode 100644 views/common/race.svg create mode 100644 views/common/regular.ttf create mode 100644 views/credits.html create mode 100644 views/game.css create mode 100644 views/game.html create mode 100644 views/hero.svg create mode 100644 views/intro.css create mode 100644 views/intro.html create mode 100644 views/load.html create mode 100644 views/loader.html create mode 100644 views/menu.css create mode 100644 views/menu.html create mode 100644 views/menu.jpg create mode 100644 views/online.html create mode 100644 views/rain/rainscript.js create mode 100644 views/rain/rainstyle.css create mode 100644 views/script/client_fullscreen.js create mode 100644 views/script/core_chart.js create mode 100644 views/script/core_fullscreen.js create mode 100644 views/script/core_head.js create mode 100644 views/script/core_music.js create mode 100644 views/script/core_stats.js create mode 100644 views/script/core_viewer.js create mode 100644 views/script/credits_global.js create mode 100644 views/script/credits_libs.js create mode 100644 views/script/credits_music.js create mode 100644 views/script/credits_technical.js create mode 100644 views/script/game_global.js create mode 100644 views/script/game_music.js create mode 100644 views/script/game_online.js create mode 100644 views/script/game_select.js create mode 100644 views/script/intro_global.js create mode 100644 views/script/intro_media.js create mode 100644 views/script/intro_message.js create mode 100644 views/script/loader_global.js create mode 100644 views/script/menu_copyright.js create mode 100644 views/script/menu_global.js create mode 100644 views/script/menu_gpuinfo.js create mode 100644 views/script/menu_music.js create mode 100644 views/script/menu_system.js create mode 100644 views/script/online_play.js create mode 100644 views/script/settings_global.js create mode 100644 views/script/settings_load.js create mode 100644 views/script/win_global.js create mode 100644 views/script/win_message.js create mode 100644 views/script/win_music.js create mode 100644 views/script/win_play.js create mode 100644 views/script/win_quit.js create mode 100644 views/settings.html create mode 100644 views/splash.png create mode 100644 views/win.html (limited to 'views') diff --git a/views/background.jpg b/views/background.jpg new file mode 100644 index 0000000..d3e959a Binary files /dev/null and b/views/background.jpg differ diff --git a/views/common/bold.ttf b/views/common/bold.ttf new file mode 100644 index 0000000..a7e7b1e Binary files /dev/null and b/views/common/bold.ttf differ diff --git a/views/common/fonts.css b/views/common/fonts.css new file mode 100644 index 0000000..ac8f9f0 --- /dev/null +++ b/views/common/fonts.css @@ -0,0 +1,27 @@ +@font-face { + font-family: "Comfortaa"; + src: url("regular.ttf"); + font-weight: normal; +} + +@font-face { + font-family: "Comfortaa"; + src: url("bold.ttf"); + font-weight: bold; +} + +*, body, html, div { + font-family: "Comfortaa", -apple-system, sans-serif; +} + +#gpuinfo, #gpuinfo * { + font-family: monospace !important; +} + +body, * { + cursor: url("../../cursors/main.png"), default !important; +} + +input { + cursor: url("../../cursors/text.png"), default !important; +} \ No newline at end of file diff --git a/views/common/index.css b/views/common/index.css new file mode 100644 index 0000000..f9ff24e --- /dev/null +++ b/views/common/index.css @@ -0,0 +1,29 @@ +#titlebar-minimize, #titlebar-close { + background-color: transparent; + transition: background-color 200ms; + border-radius: 10px; +} + +#titlebar-minimize:hover { + background-color: rgba(99, 99, 99, .5); +} + +#titlebar-minimize:focus, #titlebar-minimize:active { + background-color: rgba(99, 99, 99, .75); +} + +#titlebar-close:hover { + background-color: rgba(255, 0, 0, .5); +} + +#titlebar-close:focus, #titlebar-close:active { + background-color: rgba(255, 0, 0, .75); +} + +*::selection { + background-color: transparent; +} + +*::inactive-selection { + background-color: transparent; +} \ No newline at end of file diff --git a/views/common/light.ttf b/views/common/light.ttf new file mode 100644 index 0000000..5e4bfc7 Binary files /dev/null and b/views/common/light.ttf differ diff --git a/views/common/load-channel.otf b/views/common/load-channel.otf new file mode 100644 index 0000000..1968a8e Binary files /dev/null and b/views/common/load-channel.otf differ diff --git a/views/common/load-version.otf b/views/common/load-version.otf new file mode 100644 index 0000000..d112022 Binary files /dev/null and b/views/common/load-version.otf differ diff --git a/views/common/mouse.css b/views/common/mouse.css new file mode 100644 index 0000000..7670e90 --- /dev/null +++ b/views/common/mouse.css @@ -0,0 +1,3 @@ +*::selection { + background: none; +} \ No newline at end of file diff --git a/views/common/old/Josefin Sans 100.ttf b/views/common/old/Josefin Sans 100.ttf new file mode 100644 index 0000000..b440c18 Binary files /dev/null and b/views/common/old/Josefin Sans 100.ttf differ diff --git a/views/common/old/Josefin Sans 100italic.ttf b/views/common/old/Josefin Sans 100italic.ttf new file mode 100644 index 0000000..70bc289 Binary files /dev/null and b/views/common/old/Josefin Sans 100italic.ttf differ diff --git a/views/common/old/Josefin Sans 200.ttf b/views/common/old/Josefin Sans 200.ttf new file mode 100644 index 0000000..4425f67 Binary files /dev/null and b/views/common/old/Josefin Sans 200.ttf differ diff --git a/views/common/old/Josefin Sans 200italic.ttf b/views/common/old/Josefin Sans 200italic.ttf new file mode 100644 index 0000000..2b9df22 Binary files /dev/null and b/views/common/old/Josefin Sans 200italic.ttf differ diff --git a/views/common/old/Josefin Sans 300italic.ttf b/views/common/old/Josefin Sans 300italic.ttf new file mode 100644 index 0000000..caa381c Binary files /dev/null and b/views/common/old/Josefin Sans 300italic.ttf differ diff --git a/views/common/old/Josefin Sans 500.ttf b/views/common/old/Josefin Sans 500.ttf new file mode 100644 index 0000000..7f58172 Binary files /dev/null and b/views/common/old/Josefin Sans 500.ttf differ diff --git a/views/common/old/Josefin Sans 500italic.ttf b/views/common/old/Josefin Sans 500italic.ttf new file mode 100644 index 0000000..27efef3 Binary files /dev/null and b/views/common/old/Josefin Sans 500italic.ttf differ diff --git a/views/common/old/Josefin Sans 600.ttf b/views/common/old/Josefin Sans 600.ttf new file mode 100644 index 0000000..2df283e Binary files /dev/null and b/views/common/old/Josefin Sans 600.ttf differ diff --git a/views/common/old/Josefin Sans 600italic.ttf b/views/common/old/Josefin Sans 600italic.ttf new file mode 100644 index 0000000..b6a60e3 Binary files /dev/null and b/views/common/old/Josefin Sans 600italic.ttf differ diff --git a/views/common/old/Josefin Sans 700italic.ttf b/views/common/old/Josefin Sans 700italic.ttf new file mode 100644 index 0000000..58c1d47 Binary files /dev/null and b/views/common/old/Josefin Sans 700italic.ttf differ diff --git a/views/common/old/Josefin Sans italic.ttf b/views/common/old/Josefin Sans italic.ttf new file mode 100644 index 0000000..1da194d Binary files /dev/null and b/views/common/old/Josefin Sans italic.ttf differ diff --git a/views/common/old/bold~.ttf b/views/common/old/bold~.ttf new file mode 100644 index 0000000..ec3eadf Binary files /dev/null and b/views/common/old/bold~.ttf differ diff --git a/views/common/old/light~.ttf b/views/common/old/light~.ttf new file mode 100644 index 0000000..dea4cec Binary files /dev/null and b/views/common/old/light~.ttf differ diff --git a/views/common/old/regular~.ttf b/views/common/old/regular~.ttf new file mode 100644 index 0000000..5e81491 Binary files /dev/null and b/views/common/old/regular~.ttf differ diff --git a/views/common/race.svg b/views/common/race.svg new file mode 100644 index 0000000..197387b --- /dev/null +++ b/views/common/race.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/views/common/regular.ttf b/views/common/regular.ttf new file mode 100644 index 0000000..89d36f8 Binary files /dev/null and b/views/common/regular.ttf differ diff --git a/views/credits.html b/views/credits.html new file mode 100644 index 0000000..e3ff9f9 --- /dev/null +++ b/views/credits.html @@ -0,0 +1,198 @@ + + + + + + + + + + Kartik + + + + + + + + + + +
+ + + +

Kartik, a 2D car race game

+

© Minteck Projects. All assets are licensed under their original license rather than Kartik's license.

+

+ +

Lead

+

Minteck

+ +

Base Assets

+

Minteck
Redman 054

+ +

Narrator Character

+

Averi by cactus (@fiddleafox on Twitter)

+ +

Sound Effects, Music and Additional Assets

+
+
Prosta4okua
+
Felix Corvus
+
Vanguard
+
Timmeey86
+
Epowerj
+
Baltazár Radics
+
Dexapnow
+
Milinai
+
키에르
+
skybldev
+
Leone25
+
Gureumi
+
VizardAlpha
+
LQ
+
Commodore64x
+
iczero
+
Krzysztof Skrzętnicki
+
Baramos666
+
theshadowknight
+
elmenda452
+
Predator127
+
Sonnicon
+
CinExPL
+
toushangyouxiang
+
xgamezs
+
William So
+
beito
+
BeefEX
+
Lorex
+
老滑稽
+
Spico The Spirit Guy
+
TunacanGamer
+
kemalinanc13
+
Zachary
+
Fenr1r
+
Jaiun Lee
+
Gab_351
+
Carter Gale
+
Jan Polák
+
JustYanns
+
BasedUser
+
BLucky-gh
+
DinoWattz
+
Jae
+
angelickite
+
ScriptHosT12
+
Senventise
+
SkeptiC
+
Deyvid67
+
Damlon
+
DaGamerFiles
+
Trigg
+
Uriel
+
VXF
+
Valen. H
+
Valentin Sonin
+
Clarence "Sparr" Risher
+
bei2
+
AceEllysium
+
Cedric L'homme
+
Michał “Neoqueto”
+
indielm
+
Ameb
+
player20033
+
Ignacy
+
J-VdS
+
Kenny
+
Franciszek Zaranowicz
+
Andreas Heiskanen
+
Doyoung Gwak
+
MMG
+
Math2128
+
Michael Plotke
+
Niko
+
Paul T
+
Dominik
+
Arkanic
+
Potion
+
Markus G
+
itskatt
+
Agent-Laevain
+
AzariasB
+
amrsoll
+
ねらひかだ
+
Draco
+
Quezler
+
killall -q
+
Alicila
+
Daniel Dusek
+
DeltaNedas
+
GioIacca9
+
SnakkiZXZ
+
sk7725
+
The Slaylord
+
ThePlayerA
+
YellOw139
+
NgLamVN
+
JINODK
+
PetrGasparik
+
LeoDog896
+
Summet
+
MEEP of Faith
+
jalastram (freesound.org)
+
newlocknew (freesound.org)
+
dsmolenaers (freesound.org)
+
Headphaze (freesound.org)
+
Nikolass
+
VolasYouKnow
+
Quick-Korx
+
Ángel Rodríguez Aguilera
+
Catchears
+
younggam
+
simba-fs
+
RedRadiation
+
Marko Zajc
+
CPX MC
+
Phinner
+
BTA_Susideur
+
nilq
+
AsgerHB
+
AzCraft
+
foo
+
Skat
+
WilloIzCitron
+
+ +

Testing

+

Minteck
Romain
Redman 054
Oxymillion

+ +

Libraries

+

+ + + +
+ + + + + + + diff --git a/views/game.css b/views/game.css new file mode 100644 index 0000000..e72a786 --- /dev/null +++ b/views/game.css @@ -0,0 +1,152 @@ +#paused { + z-index: 5; + position: fixed; + inset: 0; + display: flex; + align-items: center; + justify-content: center; +} + +#paused > div { + background: #262626; + border-radius: 10px; + padding: 20px; + box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.25); +} + +#paused * { + color: white; +} + +.services li { + padding: 10px; + font-size: 28px; + width: 256px; + list-style: none; + color: transparent; + margin-top: 10px; + margin-bottom: 10px; + border-radius: 10px; +} + +.services li a { + color: white !important; + text-decoration: none; + transition: color 200ms; +} + +.services li.selected a { + color: black !important; + text-decoration: none; +} + +.services li.selected { + background-color: #00ff99; +} + +.services li { + background-color: #383838; + transition: margin-left 200ms, background-color 200ms; +} + +#circuit.hitboxes, #circuit.hitboxes * { + outline: 1px dashed blue; +} + +#car0, #car1 { + transition: top 600ms, bottom 600ms, left 600ms, right 600ms, transform 500ms; +} + +#box.paused { + opacity: .5; +} + +circuit { + display: none; +} + +#credits-inner { + position: fixed; + z-index: 9; + background: #171717; + color: white; + padding: 20px; + display: grid; + font-size: 11px; + top: 200px; + left: 0; + right: 0; +} + +#credits .big { + font-size: 15px; + font-weight: bold; +} + +#credits #race, #credits #musicb { + display: grid; + grid-template-columns: 48px 1fr; +} + +#credits-inner > * > * { + vertical-align: middle; +} + +#credits img { + filter: invert(100%); +} + +#credits .cbox { + width: max-content; +} + +#laps-inner-car0 { + background: rgba(0, 0, 0, .5); + position: fixed; + bottom: 20px; + left: 20px; + z-index: 9; + border-radius: 9999px; + width: 40px; + height: 43px; + text-align: center; + color: white; + padding: 7px 10px 10px; +} + +#laps-inner-car1 { + background: rgba(0, 0, 0, .5); + position: fixed; + bottom: 20px; + right: 20px; + z-index: 9; + border-radius: 9999px; + width: 40px; + height: 43px; + text-align: center; + color: white; + padding: 7px 10px 10px; +} + +.laps-inner-sep { + margin: 5px; + border: none; + border-top: 2px solid white; +} + +#oil img { + position: fixed; + width: 32px; + z-index: 5; + opacity: .9; +} + +#credits { + background: rgba(0, 0, 0, .5); + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 9999; +} \ No newline at end of file diff --git a/views/game.html b/views/game.html new file mode 100644 index 0000000..023e547 --- /dev/null +++ b/views/game.html @@ -0,0 +1,152 @@ + + + + + + + + + + Kartik + + + + + + + + + + + + + + + + + + + + diff --git a/views/hero.svg b/views/hero.svg new file mode 100644 index 0000000..e19252e --- /dev/null +++ b/views/hero.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/views/intro.css b/views/intro.css new file mode 100644 index 0000000..bcda35f --- /dev/null +++ b/views/intro.css @@ -0,0 +1,33 @@ +.hero-inner { + position: fixed; + inset: 0; + background-image: url('./hero.svg'); + background-position: 100% 50%; + background-size: cover; + background-repeat: repeat; + background-attachment: scroll; + z-index: -1; +} + +.hero { + color: #fff; + background: linear-gradient(-45deg, #64f20c, #5cfbc6, #3149ff, #63f777); + background-size: auto; + background-size: 400% 400%; + animation: Gradient 10s ease infinite; + position: fixed; + inset: 0; + z-index: -2; +} + +@keyframes Gradient { + 0% { + background-position: 0 50%; + } + 50% { + background-position: 100% 50%; + } + 100% { + background-position: 0 50%; + } +} \ No newline at end of file diff --git a/views/intro.html b/views/intro.html new file mode 100644 index 0000000..f298cb7 --- /dev/null +++ b/views/intro.html @@ -0,0 +1,51 @@ + + + + + + + + Kartik + + + + + + + + + + + + + + + + + diff --git a/views/load.html b/views/load.html new file mode 100644 index 0000000..b4fe8c2 --- /dev/null +++ b/views/load.html @@ -0,0 +1,52 @@ + + + + + Kartik + + + + + + + + + + diff --git a/views/loader.html b/views/loader.html new file mode 100644 index 0000000..c1db38b --- /dev/null +++ b/views/loader.html @@ -0,0 +1,41 @@ + + + + + + + + Kartik + + + + + +
+ +
+ +

+ + + + + + + diff --git a/views/menu.css b/views/menu.css new file mode 100644 index 0000000..d6fc60e --- /dev/null +++ b/views/menu.css @@ -0,0 +1,150 @@ +.services li .item { + padding: 4px; + font-size: 20px; + width: 300px; + border-color: transparent; + margin-right: auto !important; + display: block; + text-align: left; + border-left-width: 3px; + border-left-style: solid; + border-color: transparent; +} + +.services { + position: fixed; + left: 0; + bottom: 0; + right: 0; + top: 150px; + padding-top: 50px; +} + +.services li { + color: transparent; + margin-top: 5px; + margin-bottom: 5px; +} + +.services li .item a { + color: white !important; + text-decoration: none; + transition: color 200ms; +} + +.services li.selected .item a { + text-decoration: none; +} + +.services:not(.services-settings) li.selected .item { + border-color: #00ff99; + animation-direction: alternate-reverse; + animation-duration: 3s; + animation-name: border-overlay; + animation-fill-mode: both; + animation-iteration-count: infinite; +} + +.services.services-settings li.selected .item { + border-color: #00ff99; + background-color: rgba(0, 255, 153, 0.25); + animation-direction: alternate-reverse; + animation-duration: 3s; + animation-name: border-overlay2; + animation-fill-mode: both; + animation-iteration-count: infinite; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; +} + +@keyframes border-overlay { + 0% { + border-color: #00ff66; + } + 100% { + border-color: #00ccff; + } +} + +@keyframes border-overlay2 { + 0% { + border-color: #00ff66; + background-color: rgba(0, 255, 102, 0.25); + } + 100% { + border-color: #00ccff; + background-color: rgba(0, 204, 255, 0.25); + } +} + +.services li .item { + margin-left: 12.5px; + transition: margin-left 200ms, background-color 200ms, border 200ms; +} + +.services li .help { + color: white; + margin-left: 5px; + display: inline-block; + font-size: 12px; + position: relative; + top: -2.5px; + opacity: 0; + transition: opacity 200ms; +} + +.services li .help.exit { + color: #ff6969; +} + +.services li.selected .help { + opacity: 1; +} + +#copyright { + color: rgba(255, 255, 255, .5); + position: fixed; + bottom: 30px; + right: 30px; + text-align: right; + font-size: 12px; +} + +.setting-status { + float: right; +} + +#notice { + color: white; + position: fixed; + top: 20px; + right: 20px; + width: 180px; + text-align: right; + font-size: 14px; +} + +#scroll { + display: block; + text-align: center; + color: white; + padding-top: 100vh; + padding-bottom: 100vh; +} + +.cred-title { + color: yellow; +} + +.cred-content { + color: white; +} + +.technical { + color: cyan; +} + +.item-icon { + filter: invert(1); + vertical-align: middle; +} \ No newline at end of file diff --git a/views/menu.html b/views/menu.html new file mode 100644 index 0000000..7f7256a --- /dev/null +++ b/views/menu.html @@ -0,0 +1,80 @@ + + + + + + + + + + Kartik + + + + + + + + + + + + + + + diff --git a/views/menu.jpg b/views/menu.jpg new file mode 100644 index 0000000..0ac1665 Binary files /dev/null and b/views/menu.jpg differ diff --git a/views/online.html b/views/online.html new file mode 100644 index 0000000..ab8e61d --- /dev/null +++ b/views/online.html @@ -0,0 +1,41 @@ + + + + + + + + Kartik + + + + + + + + + + + + + + + + diff --git a/views/rain/rainscript.js b/views/rain/rainscript.js new file mode 100644 index 0000000..1dabb23 --- /dev/null +++ b/views/rain/rainscript.js @@ -0,0 +1,44 @@ +var makeItRain = function() { + //clear out everything + $('.rain').empty(); + + var increment = 0; + var drops = ""; + var backDrops = ""; + + while (increment < 100) { + //couple random numbers to use for various randomizations + //random number between 98 and 1 + var randoHundo = (Math.floor(Math.random() * (98 - 1 + 1) + 1)); + //random number between 5 and 2 + var randoFiver = (Math.floor(Math.random() * (5 - 2 + 1) + 2)); + //increment + increment += randoFiver; + //add in a new raindrop with various randomizations to certain CSS properties + drops += '
'; + backDrops += '
'; + } + + $('.rain.front-row').append(drops); + $('.rain.back-row').append(backDrops); +} + +$('.splat-toggle.toggle').on('click', function() { + $('body').toggleClass('splat-toggle'); + $('.splat-toggle.toggle').toggleClass('active'); + makeItRain(); +}); + +$('.back-row-toggle.toggle').on('click', function() { + $('body').toggleClass('back-row-toggle'); + $('.back-row-toggle.toggle').toggleClass('active'); + makeItRain(); +}); + +$('.single-toggle.toggle').on('click', function() { + $('body').toggleClass('single-toggle'); + $('.single-toggle.toggle').toggleClass('active'); + makeItRain(); +}); + +makeItRain(); \ No newline at end of file diff --git a/views/rain/rainstyle.css b/views/rain/rainstyle.css new file mode 100644 index 0000000..fef63cf --- /dev/null +++ b/views/rain/rainstyle.css @@ -0,0 +1,155 @@ +.rain { + position: absolute; + left: 0; + width: 100%; + height: 100%; + z-index: 2; +} + +.rain.back-row { + display: none; + z-index: 1; + bottom: 60px; + opacity: 0.5; +} + +body.back-row-toggle .rain.back-row { + display: block; +} + +.drop { + position: absolute; + bottom: 100%; + width: 15px; + height: 120px; + pointer-events: none; + animation: drop 0.5s linear infinite; +} + +@keyframes drop { + 0% { + transform: translateY(0vh); + } + 75% { + transform: translateY(90vh); + } + 100% { + transform: translateY(90vh); + } +} + +.stem { + width: 1px; + height: 60%; + margin-left: 7px; + background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.25)); + animation: stem 0.5s linear infinite; +} + +@keyframes stem { + 0% { + opacity: 1; + } + 65% { + opacity: 1; + } + 75% { + opacity: 0; + } + 100% { + opacity: 0; + } +} + +.splat { + width: 15px; + height: 10px; + border-top: 2px dotted rgba(255, 255, 255, 0.5); + border-radius: 50%; + opacity: 1; + transform: scale(0); + animation: splat 0.5s linear infinite; + display: none; +} + +body.splat-toggle .splat { + display: block; +} + +@keyframes splat { + 0% { + opacity: 1; + transform: scale(0); + } + 80% { + opacity: 1; + transform: scale(0); + } + 90% { + opacity: 0.5; + transform: scale(1); + } + 100% { + opacity: 0; + transform: scale(1.5); + } +} + +.toggles { + position: absolute; + top: 0; + left: 0; + z-index: 3; +} + +.toggle { + position: absolute; + left: 20px; + width: 50px; + height: 50px; + line-height: 51px; + box-sizing: border-box; + text-align: center; + font-family: sans-serif; + font-size: 10px; + font-weight: bold; + background-color: rgba(255, 255, 255, 0.2); + color: rgba(0, 0, 0, 0.5); + border-radius: 50%; + cursor: pointer; + transition: background-color 0.3s; +} + +.toggle:hover { + background-color: rgba(255, 255, 255, 0.25); +} + +.toggle:active { + background-color: rgba(255, 255, 255, 0.3); +} + +.toggle.active { + background-color: rgba(255, 255, 255, 0.4); +} + +.splat-toggle { + top: 20px; +} + +.back-row-toggle { + top: 90px; + line-height: 12px; + padding-top: 14px; +} + +.single-toggle { + top: 160px; +} + +body.single-toggle .drop { + display: none; +} + +body.single-toggle .drop:nth-child(10) { + display: block; +} \ No newline at end of file diff --git a/views/script/client_fullscreen.js b/views/script/client_fullscreen.js new file mode 100644 index 0000000..80d745c --- /dev/null +++ b/views/script/client_fullscreen.js @@ -0,0 +1,9 @@ +document.addEventListener('keydown', function(e) { + if (e.key === "F1" || e.key === "F10" || e.key === "F11") { // F11/F1/F10 + if (!require('@electron/remote').getCurrentWindow().fullScreen && require('@electron/remote').getCurrentWindow().fullScreenable) { + require('@electron/remote').getCurrentWindow().setFullScreen(true); + } else { + require('@electron/remote').getCurrentWindow().setFullScreen(false); + } + } +}) \ No newline at end of file diff --git a/views/script/core_chart.js b/views/script/core_chart.js new file mode 100644 index 0000000..179dd82 --- /dev/null +++ b/views/script/core_chart.js @@ -0,0 +1,67 @@ +setInterval(() => { + try { + currentMemory = process.memoryUsage().rss; + currentMemoryMib = (((currentMemory)/1024)/1024).toFixed(2); + if ((((currentMemory)/1024)/1024) > 250) { + throw new Error("Out of memory"); + } + + file = webview.getURL().split("/")[webview.getURL().split("/").length - 1]; + activity = lang.discord.game[0]; + enableActivity = true; + eaid = ""; + + switch (file) { + case "game.html?online": + activity = lang.online.discord; + break; + case "game.html?sp": + activity = lang.discord.game[1]; + break; + case "game.html": + activity = lang.discord.game[2]; + break; + case "intro.html": + activity = lang.discord.intro[1]; + break; + case "settings.html": + activity = lang.discord.settings[1]; + break; + case "credits.html": + activity = lang.discord.credits[1]; + break; + case "online.html": + activity = lang.online.discord2; + break; + case "menu.html": + case "win.html": + activity = lang.discord.credits[0]; + break; + case "loader.html": + enableActivity = false; + break; + } + + if (file.includes("online.html")) { + activity = lang.online.discord2; + } + + if (enableActivity) { + eaid = " - " + activity; + } else { + eaid = ""; + } + + if (require('./package.json').channel === "git") { + document.getElementById('experimental-ramusage').innerText = currentMemoryMib; + document.title="Kartik Trunk " +require('./package.json').version + eaid; + } else { + if (require('./package.json').channel !== "stable") { + 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; + } + } + } catch (e) {} +}, 1000) \ No newline at end of file diff --git a/views/script/core_fullscreen.js b/views/script/core_fullscreen.js new file mode 100644 index 0000000..69f9e45 --- /dev/null +++ b/views/script/core_fullscreen.js @@ -0,0 +1,9 @@ +$(document).keydown(function(e) { + if (e.keyCode === 122 || e.keyCode === 121 || e.keyCode === 112) { // F11/F1/F10 + if (!require('@electron/remote').getCurrentWindow().fullScreen && require('@electron/remote').getCurrentWindow().fullScreenable) { + require('@electron/remote').getCurrentWindow().setFullScreen(true); + } else { + require('@electron/remote').getCurrentWindow().setFullScreen(false); + } + } +}) \ No newline at end of file diff --git a/views/script/core_head.js b/views/script/core_head.js new file mode 100644 index 0000000..be27c87 --- /dev/null +++ b/views/script/core_head.js @@ -0,0 +1,31 @@ +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);} + +if (native && require('@electron/remote').getCurrentWindow().debug) { + document.write(''); +} + +if (native) { + var ipcRenderer = require('electron').ipcRenderer; + ipcRenderer.on('scenario', function (event,obj) { + try { + console.log(kresources.scenario.voice[obj.lang] + "/" + obj.namespace + obj.id + ".mp3"); + a = new Audio(kresources.scenario.voice[obj.lang] + "/" + obj.namespace + obj.id + ".mp3"); + a.onended = () => { + setTimeout(() => { + $("#message").fadeOut(200); + if (typeof obj.cb == "function") { + obj.cb(); + } + }, 3000) + } + a.play(); + } catch (e) { + console.error(e); + obj.cb(); + } + + document.getElementById('message-text').innerText = obj.message; + document.getElementById('message-character-inner').src = kresources.scenario.averi[obj.emote]; + $("#message").fadeIn(200); + }); +} diff --git a/views/script/core_music.js b/views/script/core_music.js new file mode 100644 index 0000000..d1e8619 --- /dev/null +++ b/views/script/core_music.js @@ -0,0 +1,109 @@ +global.csng = null; +global.csp1 = null; +global.csp2 = null; +global.cspn = 1; +const musicIpc = require('electron').ipcRenderer; + +musicIpc.on('setmusic', (event, args) => { + song = args; + + if (song !== null && song !== "" && csng !== song) { + if (cspn === 1) { + if (csp1 !== null) { + csi1 = setInterval(() => { + if (csp1.volume <= 0.05) { + csp1.pause(); + clearInterval(csi1); + return; + } + csp1.volume = csp1.volume - 0.05; + }, 100) + } + csp2 = new Audio(song); + csp2.volume = 0; + csp2.loop = true; + csp2.play(); + csi2 = setInterval(() => { + if (csp2.volume >= 0.95) { + clearInterval(csi2); + return; + } + csp2.volume = csp2.volume + 0.05; + }, 100) + csng = song; + cspn = 2; + } else { + if (csp2 !== null) { + csi2 = setInterval(() => { + if (csp2.volume <= 0.05) { + csp2.pause(); + clearInterval(csi2); + return; + } + csp2.volume = csp2.volume - 0.05; + }, 100) + } + csp1 = new Audio(song); + csp1.volume = 0; + csp1.loop = true; + csp1.play(); + csi1 = setInterval(() => { + if (csp1.volume >= 0.95) { + clearInterval(csi1); + return; + } + csp1.volume = csp1.volume + 0.05; + }, 100) + csng = song; + cspn = 1; + } + } +}) + +musicIpc.on('fademusic', (event) => { + if (cspn === 1) { + if (csp1 !== null) { + csi1 = setInterval(() => { + if (csp1.volume <= 0.5) { + clearInterval(csi1); + return; + } + csp1.volume = csp1.volume - 0.05; + }, 100) + } + } else { + if (csp2 !== null) { + csi2 = setInterval(() => { + if (csp2.volume <= 0.5) { + clearInterval(csi2); + return; + } + csp2.volume = csp2.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) + } + } +}) \ No newline at end of file diff --git a/views/script/core_stats.js b/views/script/core_stats.js new file mode 100644 index 0000000..5c7314f --- /dev/null +++ b/views/script/core_stats.js @@ -0,0 +1,47 @@ +const fs = require('fs'); +const homedir = require('@electron/remote').getCurrentWindow().homedir; +const defaultStats = { + times: { + game: 0, + single: 0, + local: 0, + online: 0 + }, + results: { + wins: 0, + loses: 0 + }, + ingame: { + walls: 0, + laps: 0, + turns: 0 + } +} + +if (!fs.existsSync(homedir + "/.kartik/stats.json")) { + fs.writeFileSync(homedir + "/.kartik/stats.json", JSON.stringify(defaultStats)); +} else { + try { + JSON.parse(fs.readFileSync(homedir + "/.kartik/stats.json").toString()); + } catch (e) { + fs.writeFileSync(homedir + "/.kartik/stats.json", JSON.stringify(defaultStats)); + } +} + +class Stats { + static add(category, counter, quantity) { + try { + let current = JSON.parse(fs.readFileSync(homedir + "/.kartik/stats.json").toString()); + current[category][counter] = current[category][counter] + quantity; + fs.writeFileSync(homedir + "/.kartik/stats.json", JSON.stringify(current)); + } catch (e) {} + } + + static set(category, counter, value) { + try { + let current = JSON.parse(fs.readFileSync(homedir + "/.kartik/stats.json").toString()); + current[category][counter] = value; + fs.writeFileSync(homedir + "/.kartik/stats.json", JSON.stringify(current)); + } catch (e) {} + } +} \ No newline at end of file diff --git a/views/script/core_viewer.js b/views/script/core_viewer.js new file mode 100644 index 0000000..d22ada9 --- /dev/null +++ b/views/script/core_viewer.js @@ -0,0 +1,23 @@ +const webview = document.getElementById('wb'); + +webview.addEventListener('dom-ready', () => { + require('@electron/remote').getCurrentWindow().log(" * " + webview.getURL()); + try { + if (require('@electron/remote').getCurrentWindow().debug) { + info("MainWindow", "Opening debugging tools..."); + webview.openDevTools(); + } + } catch (e) {} +}) + +webview.addEventListener('dom-ready', () => { + setInterval(() => { + try { + if (webview.isCrashed()) { + require('@electron/remote').getCurrentWindow().log(" * Compositing engine crashed!"); + error("MainWindow", "Subcontainer crashed"); + crash(new Error("Webview crashed")); + } + } catch (e) {} + }, 2000) +}) \ No newline at end of file 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 diff --git a/views/script/credits_libs.js b/views/script/credits_libs.js new file mode 100644 index 0000000..9e2f21a --- /dev/null +++ b/views/script/credits_libs.js @@ -0,0 +1,15 @@ +Object.keys(process.versions).forEach((e) => { + v = process.versions[e]; + document.write(e.substr(0, 1).toUpperCase() + e.substr(1) + " contributors
"); +}) +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 + "
"); + } else { + document.write(j.name.substr(0, 1).toUpperCase() + j.name.substr(1) + " authors
"); + } + } +}) \ No newline at end of file diff --git a/views/script/credits_music.js b/views/script/credits_music.js new file mode 100644 index 0000000..7a4883b --- /dev/null +++ b/views/script/credits_music.js @@ -0,0 +1,4 @@ +if (require('@electron/remote').getCurrentWindow().music) { + info("MusicMgr", "Playing settings.mp3"); + require('electron').ipcRenderer.send('newmusic', kresources.music['credits'].file); +} \ No newline at end of file diff --git a/views/script/credits_technical.js b/views/script/credits_technical.js new file mode 100644 index 0000000..8193167 --- /dev/null +++ b/views/script/credits_technical.js @@ -0,0 +1,9 @@ +document.write("Kartik"+require('@electron/remote').getCurrentWindow().channel + " (" + require('../package.json').name + ") " +require('../package.json').version); +document.write(" on " + require('os').type() + " (" + require('os').version() + ", " + require('os').arch() +") version " + require('os').release() + "
") +cores = require('os').cpus() +if (cores.length > 1) { + document.write(cores.length + " processors
"); +} else { + document.write(cores.length + " processor
"); +} +document.write(((process.memoryUsage().heapUsed/1024)/1024).toFixed(2) + " MB heap memory used, " + ((process.memoryUsage().heapTotal/1024)/1024).toFixed(2) + " MB heap memory total, " + ((process.memoryUsage().rss/1024)/1024).toFixed(2) + " MB virtual memory"); \ No newline at end of file diff --git a/views/script/game_global.js b/views/script/game_global.js new file mode 100644 index 0000000..4e6de21 --- /dev/null +++ b/views/script/game_global.js @@ -0,0 +1,45 @@ +$("#box").fadeOut(0); +$("#bg").fadeOut(0); +setTimeout(() => { + $("#box").fadeIn(500); + $("#bg").fadeIn(500); +}, 200) + +global.startgame = () => { + keysEnabled = true; + $("#credits").fadeOut(200) + Sound.intro(); + + setTimeout(() => { + started = true; + }, 1700) + + setTimeout(() => { + if (location.search === "?sp") { + enableAI(); + } + }, 1200) +} + +startHooks.push(() => { + global.hitshow = false; + global.started = false; + keysEnabled = false; + + $("body").focus(); + + if (!online) { + setTimeout(startgame, 7000) + } + + if (online && role === "host") { + setTimeout(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "gameIsReady", + message: null + }) + "|") + startgame(); + }, 7000) + } +}) \ No newline at end of file diff --git a/views/script/game_music.js b/views/script/game_music.js new file mode 100644 index 0000000..29b00da --- /dev/null +++ b/views/script/game_music.js @@ -0,0 +1,10 @@ +startHooks.push(() => { + if (require('@electron/remote').getCurrentWindow().music) { + info("MusicMgr", "Playing game" + i + ".mp3"); + require('electron').ipcRenderer.send('newmusic', kresources.music['game' + i].file); + } +}) + +if (location.search === "?online") { + require('electron').ipcRenderer.send('newmusic', kresources.music['prepare'].file); +} \ No newline at end of file diff --git a/views/script/game_online.js b/views/script/game_online.js new file mode 100644 index 0000000..e379708 --- /dev/null +++ b/views/script/game_online.js @@ -0,0 +1,9 @@ +if (location.search === "?online") { + document.getElementById('online-login').style.display = ""; + document.write(`<` + `script src="../online/global.js">`); +} else { + startHooks.forEach((hook) => { + hook(this); + }) + document.getElementById('ping').style.display = "none"; +} \ No newline at end of file diff --git a/views/script/game_select.js b/views/script/game_select.js new file mode 100644 index 0000000..7857101 --- /dev/null +++ b/views/script/game_select.js @@ -0,0 +1,131 @@ +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);} + +startHooks.push(() => { + function ranint(min, max) { // min and max included + return Math.floor(Math.random() * (max - min + 1) + min); + } + + circuits = Object.keys(kresources.races); + rand = circuits[Math.floor(Math.random()*circuits.length)]; + + if (online && role === "host") { + setInterval(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "RaceData:circuit", + message: rand + }) + "|"); + }, 100) + } + + if (online && role === "guest") { + rand = guestInfo.circuit; + } + + info("GameWindow", "Selected circuit " + rand); + document.getElementById('circuit').style.backgroundImage = "url('." + kresources.races[rand].substr(0, kresources.races[rand].length - 5).split("'").join("\\'") + ".png')"; + document.getElementById('circuit').innerHTML = require('fs').readFileSync(kresources.races[rand]).toString(); + + inf = JSON.parse(document.getElementsByTagName("circuit")[0].innerText); + if (typeof inf.name[lp] === "undefined") { + document.getElementById('race-title').innerText = inf.name.en; + } else { + document.getElementById('race-title').innerText = inf.name[lp]; + } + document.getElementById('race-author').innerText = inf.author; + + i = ranint(1, 9); + + if (online && role === "host") { + setInterval(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "RaceData:music", + message: i + }) + "|"); + }, 200) + } + + if (online && role === "guest") { + i = guestInfo.music; + } + + global.spreadOil = (oil) => { + rx = ranint(0, 680); + ry = ranint(0, 490); + rd = ranint(0, 360); + rh = ranint(0, 360); + + oil.style.top = ry + "px"; + oil.style.left = rx + "px"; + oil.style.transform = "rotate(" + rd + "deg)"; + oil.style.filter = "hue-rotate(" + rd + "deg)"; + } + + Array.from(document.getElementById('oil').children).forEach((item) => { + spreadOil(item); + }) + + modelsAvailable = Object.keys(kresources.cars); + + selectedModel0I = Math.floor(Math.random() * modelsAvailable.length); + selectedModel0 = modelsAvailable[selectedModel0I]; + modelsAvailable.splice(selectedModel0I, 1); + + selectedModel1I = Math.floor(Math.random() * modelsAvailable.length); + selectedModel1 = modelsAvailable[selectedModel1I]; + + if (online && role === "host") { + setInterval(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "RaceData:hostCar", + message: selectedModel0 + }) + "|"); + }, 300) + setInterval(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "RaceData:guestCar", + message: selectedModel1 + }) + "|"); + }, 400) + } + + if (online && role === "guest") { + selectedModel0 = guestInfo.guestCar; + selectedModel1 = guestInfo.hostCar; + } + + document.getElementById("car0-img").src = kresources.cars[selectedModel0]; + document.getElementById("cars-p1-inner").src = kresources.cars[selectedModel0]; + document.getElementById("car1-img").src = kresources.cars[selectedModel1]; + document.getElementById("cars-p2-inner").src = kresources.cars[selectedModel1]; +}) + +startHooks.push(() => { + setInterval(() => { + if (online) { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "posTop", + message: document.getElementById("car0").style.top + }) + "|") + clientWriter(JSON.stringify({ + _type: "ipc", + action: "posLeft", + message: document.getElementById("car0").style.left + }) + "|") + clientWriter(JSON.stringify({ + _type: "ipc", + action: "posRot", + message: document.getElementById("car0").style.transform + }) + "|") + clientWriter(JSON.stringify({ + _type: "ipc", + action: "progressLaps", + message: document.getElementById("laps-car0").innerText + }) + "|") + } + }, 50) +}) 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 diff --git a/views/script/intro_media.js b/views/script/intro_media.js new file mode 100644 index 0000000..87600b9 --- /dev/null +++ b/views/script/intro_media.js @@ -0,0 +1,4 @@ +if (require('@electron/remote').getCurrentWindow().music) { + info("MusicMgr", "Playing title.mp3"); + require('electron').ipcRenderer.send('newmusic', kresources.music['title'].file); +} \ No newline at end of file diff --git a/views/script/intro_message.js b/views/script/intro_message.js new file mode 100644 index 0000000..6ab8d95 --- /dev/null +++ b/views/script/intro_message.js @@ -0,0 +1,7 @@ +setInterval(() => { + if (require('@electron/remote').getCurrentWindow().controllerAttached) { + document.getElementById('progress').innerText = lang.intro[1]; + } else { + document.getElementById('progress').innerText = lang.intro[0]; + } +}, 100) \ No newline at end of file diff --git a/views/script/loader_global.js b/views/script/loader_global.js new file mode 100644 index 0000000..67016d9 --- /dev/null +++ b/views/script/loader_global.js @@ -0,0 +1,85 @@ +window.addEventListener('load', () => { + setTimeout(() => { + if (native) { + setTimeout(() => { + document.getElementById('vendor').style.transform = "scale(3)"; + new Audio("../sfx/intro.mp3").play(); + setTimeout(() => { + 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);} + $("#progress").fadeOut(500); + setTimeout(() => { + window.fetch("https://kartik.hopto.org/latest.php?v=" + require('@electron/remote').getCurrentWindow().update).then((data) => { + data.blob().then((a) => { + a.text().then((b) => { + if (require('@electron/remote').getCurrentWindow().update == "git") { + document.getElementById('updates').style.backgroundColor = "lightsalmon"; + document.getElementById('updates').innerText = lang.updates.git; + } else { + console.log(b); + console.log(require('../package.json').version); + if (b == require('../package.json').version) { + document.getElementById('updates').style.backgroundColor = "lightgreen"; + document.getElementById('updates').innerText = lang.updates.ok; + } else { + document.getElementById('warning').style.opacity = "1"; + document.getElementById('updates').style.backgroundColor = "lightyellow"; + document.getElementById('updates').innerText = lang.updates.available; + } + } + setTimeout(() => { + $("body").fadeOut(500); + setTimeout(() => { + info("LoadWindow", "Switching control to MenuWindow"); + location.href = "intro.html"; + }, 1000) + }, 3000); + }).catch((e) => { + console.warn(e); + document.getElementById('updates').style.backgroundColor = "lightcoral"; + document.getElementById('updates').innerText = lang.updates.error; + setTimeout(() => { + $("body").fadeOut(500); + setTimeout(() => { + info("LoadWindow", "Switching control to MenuWindow"); + location.href = "intro.html"; + }, 1000) + }, 3000); + }); + }).catch((e) => { + console.warn(e); + document.getElementById('updates').style.backgroundColor = "lightcoral"; + document.getElementById('updates').innerText = lang.updates.error; + setTimeout(() => { + $("body").fadeOut(500); + setTimeout(() => { + info("LoadWindow", "Switching control to MenuWindow"); + location.href = "intro.html"; + }, 1000) + }, 3000); + }); + }).catch((e) => { + console.warn(e); + document.getElementById('updates').style.backgroundColor = "lightcoral"; + document.getElementById('updates').innerText = lang.updates.error; + setTimeout(() => { + setTimeout(() => { + info("LoadWindow", "Switching control to MenuWindow"); + location.href = "intro.html"; + }, 1000) + }, 3000); + }); + }, 2000) + }, 3000) + }, 1000) + } else { + 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);} + setTimeout(() => { + $("body").fadeOut(500); + setTimeout(() => { + info("LoadWindow", "Switching control to MenuWindow"); + location.href = "intro.html"; + }, 1000) + }, 8000); + } + }, 2000) +}) diff --git a/views/script/menu_copyright.js b/views/script/menu_copyright.js new file mode 100644 index 0000000..35b322a --- /dev/null +++ b/views/script/menu_copyright.js @@ -0,0 +1,5 @@ +if (new Date().getFullYear() === 2021) { + document.write(new Date().getFullYear() + " Minteck Projects"); +} else { + document.write("2021-" + new Date().getFullYear() + " Minteck Projects"); +} \ No newline at end of file diff --git a/views/script/menu_global.js b/views/script/menu_global.js new file mode 100644 index 0000000..43937f4 --- /dev/null +++ b/views/script/menu_global.js @@ -0,0 +1,113 @@ +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);} +$("#box").fadeOut(0); +window.addEventListener('load', () => { + setTimeout(() => { + $("#box").fadeIn(500); + }, 1000) +}) + +$("body").focus(); +keysEnabled = true; +$(document).keydown(function(e) { + if (keysEnabled) { + if (e.keyCode === 13 || e.keyCode === 88 || e.keyCode === 32) { // enter + if ($(".services").is(":visible")) { + selectOption(); + } else { + $(".services").show(); + } + menuOpen = !menuOpen; + } + if (e.keyCode === 38 || e.keyCode === 90) { // up + Sound.menu(); + var selected = $(".selected"); + $(".services li").removeClass("selected"); + if (selected.prev().length === 0) { + selected.siblings().last().addClass("selected"); + } else { + selected.prev().addClass("selected"); + } + } + if (e.keyCode === 40 || e.keyCode === 83) { // down + Sound.menu(); + var selected = $(".selected"); + $(".services li").removeClass("selected"); + if (selected.next().length === 0) { + selected.siblings().first().addClass("selected"); + } else { + selected.next().addClass("selected"); + } + } + if (e.keyCode === 27 || e.keyCode === 8) { // esc + keysEnabled = false; + Sound.click(); + setTimeout(() => { + require('@electron/remote').getCurrentWindow().close(); + }, 250) + } + } +}); + +function selectOption() { + item = document.querySelector(".selected a").id; + Sound.click(); + + switch (item) { + case 'single': + scenar("start", "happy"); + keysEnabled = false; + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("MenuWindow", "Switching control to GameWindow"); + location.href = "game.html?sp"; + }, 1000) + break; + case 'online': + keysEnabled = false; + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("MenuWindow", "Switching control to GameWindow"); + location.href = "game.html?online"; + }, 1000) + break; + case 'play': + keysEnabled = false; + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("MenuWindow", "Switching control to GameWindow"); + location.href = "game.html"; + }, 1000) + break; + case 'settings': + keysEnabled = false; + $("#box").fadeOut(500); + setTimeout(() => { + info("MenuWindow", "Switching control to OptnWindow"); + location.href = "settings.html"; + }, 1000) + break; + case 'credits': + keysEnabled = false; + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("MenuWindow", "Switching control to OptnWindow"); + location.href = "credits.html"; + }, 1000) + break; + case 'quit': + keysEnabled = false; + require('electron').ipcRenderer.send('prefademusic', ""); + info("MenuWindow", "Quitting game"); + Sound.click(); + setTimeout(() => { + require('@electron/remote').getCurrentWindow().close(); + }, 250) + break; + } +} \ No newline at end of file diff --git a/views/script/menu_gpuinfo.js b/views/script/menu_gpuinfo.js new file mode 100644 index 0000000..4177cfc --- /dev/null +++ b/views/script/menu_gpuinfo.js @@ -0,0 +1,69 @@ +if (require('os').platform !== "darwin") { + gpuinfo = require('@electron/remote').app.getGPUFeatureStatus(); + document.write("kartik
"); + document.write("├ kartik.accel
"); + if (gpuinfo['2d_canvas'].startsWith("enabled")) { + document.write("│ ├ kartik.accel.Canvas
"); + } else { + document.write("│ ├ kartik.accel.Canvas
"); + } + if (gpuinfo['gpu_compositing'].startsWith("enabled")) { + document.write("│ ├ kartik.accel.Compositing
"); + } else { + document.write("│ ├ kartik.accel.Compositing
"); + } + if (gpuinfo['video_decode'].startsWith("enabled")) { + document.write("│ └ kartik.accel.VideoDecode
"); + } else { + document.write("│ └ kartik.accel.VideoDecode
"); + } + document.write("├ kartik.raster
"); + if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) { + document.write("│ ├ kartik.raster.Threaded
"); + } else { + document.write("│ ├ kartik.raster.Threaded
"); + } + if (gpuinfo['oop_rasterization'].startsWith("enabled")) { + document.write("│ ├ kartik.raster.ObjectOP
"); + } else { + document.write("│ ├ kartik.raster.ObjectOP
"); + } + if (gpuinfo['rasterization'].startsWith("enabled")) { + document.write("│ └ kartik.raster.Common
"); + } else { + document.write("│ └ kartik.raster.Common
"); + } + document.write("└ kartik.renderer
"); + if (gpuinfo['opengl'].startsWith("enabled")) { + document.write("  ├ kartik.renderer.OpenGL
"); + } else { + document.write("  ├ kartik.renderer.OpenGL
"); + } + if (gpuinfo['skia_renderer'].startsWith("enabled")) { + document.write("  ├ kartik.renderer.Skia
"); + } else { + document.write("  ├ kartik.renderer.Skia
"); + } + if (gpuinfo['vulkan'].startsWith("enabled")) { + document.write("  └ kartik.renderer.Vulkan
"); + } else { + document.write("  └ kartik.renderer.Vulkan
"); + } +} else { + document.write("You are using macOS

Kartik can't detect GPU info
for Apple macOS."); +} + +document.onkeydown = (e) => { + if (e.shiftKey) { + document.getElementById('gpuinfo-inner').style.opacity = "1"; + document.getElementById('gpuinfo-outer').style.display = "none"; + } else { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; + } +} + +document.onkeyup = (e) => { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; +} \ No newline at end of file diff --git a/views/script/menu_music.js b/views/script/menu_music.js new file mode 100644 index 0000000..f1d23f9 --- /dev/null +++ b/views/script/menu_music.js @@ -0,0 +1,5 @@ +if (location.search !== "?noreset") { + console.log("back"); + require('electron').ipcRenderer.send('newmusic', kresources.music['title'].file); +} +info("MenuWindow", "Menu opened"); diff --git a/views/script/menu_system.js b/views/script/menu_system.js new file mode 100644 index 0000000..947699f --- /dev/null +++ b/views/script/menu_system.js @@ -0,0 +1,33 @@ + +switch (require('os').platform()) { + case "win32": + document.write("Windows"); + break + case "aix": + document.write("AIX"); + break + case "android": + document.write("Android"); + break + case "cygwin": + document.write("Cygwin"); + break + case "darwin": + document.write("macOS"); + break + case "freebsd": + document.write("FreeBSD"); + break + case "linux": + document.write("GNU/Linux"); + break + case "netbsd": + document.write("NetBSD"); + break + case "openbsd": + document.write("OpenBSD"); + break + case "sunos": + document.write("Solaris"); + break +} diff --git a/views/script/online_play.js b/views/script/online_play.js new file mode 100644 index 0000000..0c1eb91 --- /dev/null +++ b/views/script/online_play.js @@ -0,0 +1,2 @@ +require('@electron/remote').getCurrentWindow().dstate = lang.online.discord2; +require('@electron/remote').getCurrentWindow().ddetails = lang.online.discord; \ No newline at end of file diff --git a/views/script/settings_global.js b/views/script/settings_global.js new file mode 100644 index 0000000..41332c5 --- /dev/null +++ b/views/script/settings_global.js @@ -0,0 +1,226 @@ +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);} +$("#box").fadeOut(0); +setTimeout(() => { + $("#box").fadeIn(500); +}, 200) + +$("body").focus(); +keysEnabled = true; +$(document).keydown(function(e) { + if (keysEnabled) { + if (e.keyCode === 13 || e.keyCode === 88 || e.keyCode === 32) { // enter + if ($(".services").is(":visible")) { + selectOption(); + } else { + $(".services").show(); + } + } + if (e.keyCode === 38 || e.keyCode === 90) { // up + Sound.menu(); + var selected = $(".selected"); + $(".services li").removeClass("selected"); + if (selected.prev().length === 0) { + selected.siblings().last().addClass("selected"); + } else { + selected.prev().addClass("selected"); + } + } + if (e.keyCode === 40 || e.keyCode === 83) { // down + Sound.menu(); + var selected = $(".selected"); + $(".services li").removeClass("selected"); + if (selected.next().length === 0) { + selected.siblings().first().addClass("selected"); + } else { + selected.next().addClass("selected"); + } + } + if (e.keyCode === 68 || e.keyCode === 39 || e.keyCode === 81 || e.keyCode === 37) { // right/left + Sound.menu(); + var selected = $(".selected"); + var id = $(".selected")[0].children[0].children[0].id; + + if (id === "musicb") { + if (document.getElementById("setting-music").innerText === lang.settings.yes) { + document.getElementById("setting-music").innerText = lang.settings.no; + require('fs').writeFileSync(homedir + "/.kartik/config/music.txt", "0"); + } else { + document.getElementById("setting-music").innerText = lang.settings.yes; + require('fs').writeFileSync(homedir + "/.kartik/config/music.txt", "1"); + } + } + if (id === "voice") { + if (document.getElementById("setting-voice").innerText === lang.settings.yes) { + document.getElementById("setting-voice").innerText = lang.settings.no; + require('fs').writeFileSync(homedir + "/.kartik/config/voice.txt", "0"); + } else { + document.getElementById("setting-voice").innerText = lang.settings.yes; + require('fs').writeFileSync(homedir + "/.kartik/config/voice.txt", "2"); + } + } + if (id === "zoom") { + zoom = document.getElementById("setting-zoom").innerText; + + switch (zoom) { + case "0.9": + document.getElementById("setting-zoom").innerText = "1"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1"); + break; + case "1": + document.getElementById("setting-zoom").innerText = "1.1"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.1"); + break; + case "1.1": + document.getElementById("setting-zoom").innerText = "1.2"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.2"); + break; + case "1.2": + document.getElementById("setting-zoom").innerText = "1.3"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.3"); + break; + case "1.3": + document.getElementById("setting-zoom").innerText = "1.4"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.4"); + break; + case "1.4": + document.getElementById("setting-zoom").innerText = "1.5"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.5"); + break; + case "1.5": + document.getElementById("setting-zoom").innerText = "1.6"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.6"); + break; + case "1.6": + document.getElementById("setting-zoom").innerText = "1.7"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.7"); + break; + case "1.7": + document.getElementById("setting-zoom").innerText = "1.8"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.8"); + break; + case "1.8": + document.getElementById("setting-zoom").innerText = "1.9"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "1.9"); + break; + case "1.9": + document.getElementById("setting-zoom").innerText = "2"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "2"); + break; + case "2": + document.getElementById("setting-zoom").innerText = "0.9"; + require('fs').writeFileSync(homedir + "/.kartik/config/scale.txt", "0.9"); + break; + } + } + if (id === "lang") { + lang = document.getElementById("setting-lang").innerText; + slng = require('../lang/languages.json'); + slst = Object.keys(slng); + maxl = slst.length - 1; + + ci = -1; + ni = -1; + slst.forEach((key, index) => { + if (slng[key] === lang) { + ci = index; + if (index + 1 > maxl) { + ni = 0; + } else { + ni = index + 1; + } + } + }) + + if (ci !== -1 && ni !== -1) { + document.getElementById("setting-lang").innerText = slng[slst[ni]]; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", slst[ni]); + require('@electron/remote').getCurrentWindow().lp = slst[ni]; + } + + /*switch (lang) { + case "Français": + document.getElementById("setting-lang").innerText = "English"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "en"); + require('@electron/remote').getCurrentWindow().lp = "en"; + break; + + case "English": + document.getElementById("setting-lang").innerText = "Español"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "es"); + require('@electron/remote').getCurrentWindow().lp = "es"; + break; + + case "Español": + document.getElementById("setting-lang").innerText = "中国人"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "zh"); + require('@electron/remote').getCurrentWindow().lp = "zh"; + break; + + case "中国人": + document.getElementById("setting-lang").innerText = "日本語"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "jp"); + require('@electron/remote').getCurrentWindow().lp = "jp"; + break; + + case "日本語": + document.getElementById("setting-lang").innerText = "русский"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "ru"); + require('@electron/remote').getCurrentWindow().lp = "ru"; + break; + + case "русский": + document.getElementById("setting-lang").innerText = "Deutsche"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "de"); + require('@electron/remote').getCurrentWindow().lp = "de"; + break; + + case "Deutsche": + document.getElementById("setting-lang").innerText = "Nederlands"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "nl"); + require('@electron/remote').getCurrentWindow().lp = "nl"; + break; + + case "Nederlands": + document.getElementById("setting-lang").innerText = "Français"; + require('fs').writeFileSync(homedir + "/.kartik/config/lang.txt", "fr"); + require('@electron/remote').getCurrentWindow().lp = "fr"; + break; + }*/ + } + } + if (e.keyCode === 27 || e.keyCode === 8) { // esc + keysEnabled = false; + Sound.click(); + $("#box").fadeOut(500); + setTimeout(() => { + info("OptnWindow", "Switching control to MenuWindow"); + location.href = "menu.html"; + }, 1000) + } + } +}); + +function selectOption() { + item = document.querySelector(".selected a").id; + Sound.click(); + + switch (item) { + case 'back': + $("#box").fadeOut(500); + setTimeout(() => { + info("OptnWindow", "Switching control to MenuWindow"); + location.href = "menu.html?noreset"; + }, 1000) + break; + case 'credits': + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("OptnWindow", "Switching control to MenuWindow"); + location.href = "credits.html"; + }, 1000) + break; + } +} diff --git a/views/script/settings_load.js b/views/script/settings_load.js new file mode 100644 index 0000000..358f9b1 --- /dev/null +++ b/views/script/settings_load.js @@ -0,0 +1,25 @@ +info("OptnWindow", "Restoring settings..."); + +if (require('@electron/remote').getCurrentWindow().music) { + if (location.search === "?credits") { + require('electron').ipcRenderer.send('newmusic', kresources.music['title'].file); + } + document.getElementById("setting-music").innerText = lang.settings.yes; +} else { + document.getElementById("setting-music").innerText = lang.settings.no; +} + +if (require('@electron/remote').getCurrentWindow().voice) { + document.getElementById("setting-voice").innerText = lang.settings.yes; +} else { + document.getElementById("setting-voice").innerText = lang.settings.no; +} + +slang = require('@electron/remote').getCurrentWindow().lp; +langs = require('../lang/languages.json'); + +if (Object.keys(langs).includes(slang)) { + document.getElementById("setting-lang").innerText = langs[slang]; +} else { + document.getElementById("setting-lang").innerText = slang; +} \ No newline at end of file diff --git a/views/script/win_global.js b/views/script/win_global.js new file mode 100644 index 0000000..3609af7 --- /dev/null +++ b/views/script/win_global.js @@ -0,0 +1,22 @@ +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); +setTimeout(() => { + $("#box").fadeIn(500); +}, 200) + +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 + Sound.click(); + require('electron').ipcRenderer.send('prefademusic', ""); + $("#box").fadeOut(500); + setTimeout(() => { + info("GWinWindow", "Switching control to MenuWindow"); + location.href = "menu.html"; + }, 3000) + } + } +}) + +info("GWinWindow", "Rendered!"); \ No newline at end of file diff --git a/views/script/win_message.js b/views/script/win_message.js new file mode 100644 index 0000000..fd01c22 --- /dev/null +++ b/views/script/win_message.js @@ -0,0 +1,9 @@ +if (location.search === "?sp") { + if ((location.hash.substr(4) - 1 + 2) == 1) { + document.write(lang.win.solo.win); + } else { + document.write(lang.win.solo.lose); + } +} else { + document.write(lang.win.versus.replace("0", (location.hash.substr(4) - 1 + 2))); +} \ No newline at end of file diff --git a/views/script/win_music.js b/views/script/win_music.js new file mode 100644 index 0000000..b6169f6 --- /dev/null +++ b/views/script/win_music.js @@ -0,0 +1,4 @@ +if (require('@electron/remote').getCurrentWindow().music) { + info("MusicMgr", "Playing win.mp3"); + require('electron').ipcRenderer.send('newmusic', kresources.music['win'].file); +} \ No newline at end of file diff --git a/views/script/win_play.js b/views/script/win_play.js new file mode 100644 index 0000000..848b625 --- /dev/null +++ b/views/script/win_play.js @@ -0,0 +1,12 @@ +if (location.search === "?sp") { + if ((location.hash.substr(4) - 1 + 2) == 1) { + require('@electron/remote').getCurrentWindow().dstate = lang.discord.win[0]; + require('@electron/remote').getCurrentWindow().ddetails = lang.discord.game[1]; + } else { + require('@electron/remote').getCurrentWindow().dstate = lang.discord.win[1]; + require('@electron/remote').getCurrentWindow().ddetails = lang.discord.game[1]; + } +} else { + require('@electron/remote').getCurrentWindow().dstate = lang.discord.win[0]; + require('@electron/remote').getCurrentWindow().ddetails = lang.discord.game[2]; +} \ No newline at end of file diff --git a/views/script/win_quit.js b/views/script/win_quit.js new file mode 100644 index 0000000..c8d1af1 --- /dev/null +++ b/views/script/win_quit.js @@ -0,0 +1,7 @@ +setInterval(() => { + if (require('@electron/remote').getCurrentWindow().controllerAttached) { + document.getElementById('progress').innerText = lang.win.quit[1]; + } else { + document.getElementById('progress').innerText = lang.win.quit[0]; + } +}, 100) \ No newline at end of file diff --git a/views/settings.html b/views/settings.html new file mode 100644 index 0000000..4409ed9 --- /dev/null +++ b/views/settings.html @@ -0,0 +1,68 @@ + + + + + + + + + + Kartik + + + + + + + + + + + + + + + diff --git a/views/splash.png b/views/splash.png new file mode 100644 index 0000000..39a90ab Binary files /dev/null and b/views/splash.png differ diff --git a/views/win.html b/views/win.html new file mode 100644 index 0000000..1739098 --- /dev/null +++ b/views/win.html @@ -0,0 +1,42 @@ + + + + + + + + Kartik + + + + + + + + + + + + + + + + -- cgit