diff options
Diffstat (limited to 'tictactoe')
-rw-r--r-- | tictactoe/game.svg | 1 | ||||
-rw-r--r-- | tictactoe/index.html | 9 | ||||
-rwxr-xr-x | tictactoe/morpion.html | 10 | ||||
-rwxr-xr-x | tictactoe/morpion/base.js | 19 | ||||
-rw-r--r-- | tictactoe/morpion/online.js | 4 | ||||
-rw-r--r-- | tictactoe/online.html | 10 |
6 files changed, 38 insertions, 15 deletions
diff --git a/tictactoe/game.svg b/tictactoe/game.svg new file mode 100644 index 0000000..9d0be2c --- /dev/null +++ b/tictactoe/game.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M41 44H7Q5.8 44 4.9 43.1Q4 42.2 4 41V7Q4 5.8 4.9 4.9Q5.8 4 7 4H41Q42.2 4 43.1 4.9Q44 5.8 44 7V41Q44 42.2 43.1 43.1Q42.2 44 41 44ZM16.35 41V31.7H7V41Q7 41 7 41Q7 41 7 41ZM7 28.7H16.35V19.35H7ZM7 16.35H16.35V7H7Q7 7 7 7Q7 7 7 7ZM19.35 41H28.65V31.7H19.35ZM19.35 28.7H28.65V19.35H19.35ZM19.35 16.35H28.65V7H19.35ZM31.65 41H41Q41 41 41 41Q41 41 41 41V31.7H31.65ZM31.65 28.7H41V19.35H31.65ZM31.65 16.35H41V7Q41 7 41 7Q41 7 41 7H31.65Z" fill="#fff"/></svg>
\ No newline at end of file diff --git a/tictactoe/index.html b/tictactoe/index.html index 51b4b60..6a86ca6 100644 --- a/tictactoe/index.html +++ b/tictactoe/index.html @@ -1,10 +1,11 @@ <!DOCTYPE html> -<html lang="en"> +<html lang="en" translate="no"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Tic-Tac-Toe</title> + <title>Tic-Tac-Toe | Minteck Arcade</title> + <link rel="icon" href="/_general/favicon.svg" type="image/svg+xml"> <style> body { background: black; @@ -15,7 +16,9 @@ </style> </head> <body> - <div style="display:flex;position:fixed;inset:0;align-items: center;justify-content: center;"> + <iframe src="/_general/navbar.html" style="position: fixed;z-index: 9999999999;top: 0;border: none;left: 0;right: 0;height: 32px;width: 100%;"></iframe> + + <div style="display:flex;position:fixed;inset:0;align-items: center;justify-content: center;top:32px;"> <div> <h1>Tic-Tac-Toe</h1> <p>Select a game mode:</p> diff --git a/tictactoe/morpion.html b/tictactoe/morpion.html index 87ae9df..c53ba55 100755 --- a/tictactoe/morpion.html +++ b/tictactoe/morpion.html @@ -4,7 +4,8 @@ <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Tic-Tac-Toe</title> + <title>Game | Tic-Tac-Toe | Minteck Arcade</title> + <link rel="icon" href="/_general/favicon.svg" type="image/svg+xml"> <style> body { background: black; @@ -40,7 +41,8 @@ <script src="morpion/online.js"></script> </head> <body> - <div style="display:flex;align-items:center;justify-content: center;position:fixed;inset: 0;z-index:5;"> +<iframe src="/_general/navbar.html" style="position: fixed;z-index: 9999999999;top: 0;border: none;left: 0;right: 0;height: 32px;width: 100%;"></iframe> + <div style="display:flex;align-items:center;justify-content: center;position:fixed;inset: 0;z-index:5;top:32px;"> <div id="loader" style="color: white;text-align: center;"> Loading... </div> @@ -82,14 +84,14 @@ <div id="wait" style="position:fixed;inset: 0;z-index:10;cursor:wait;display:none;"></div> <pre id="instructions" style="position:fixed;bottom:0;left:0;color:white;margin:0;">// ML Model Training model.addTrainedGame();</pre> - <div id="stats" style="position:fixed;top:0;left:0;color:white;margin:0;font-family:monospace;"> + <div id="stats" style="position:fixed;top:32px;left:0;color:white;margin:0;font-family:monospace;"> <div id="online-credits" style="display:none;">Online mode made with ❤️ for Twi</div> <div id="stats-left"> Thought Moves: <span id="stat-thought">0</span><br>Random Moves: <span id="stat-random">0</span><br>Randomness: <span id="stat-randomness">0.00%</span><br>Game State: <span id="stat-state">NONE</span><br>Learned Games: <span id="stat-games"><script> document.getElementById("stat-games").innerText = modelTrainedGames; </script></span><span id="stat-goal">/5000</span> (<span id="stat-modelsize">...</span>)<br>Played Games: <span id="stat-played">-</span></div> </div> - <div id="last-games" style="text-align:right;position:fixed;top:0;right:0;color:white;margin:0;font-family:monospace;">-</div> + <div id="last-games" style="text-align:right;position:fixed;top:32px;right:0;color:white;margin:0;font-family:monospace;">-</div> <div id="online-restart-btn" style="text-align:left;position:fixed;bottom:0;left:0;color:white;margin:0;font-family:monospace;z-index:999999;"> <button disabled id="resetbtn" onclick="reset();" style="padding:10px 20px;background:black;color:white;border:1px solid white;border-bottom:none;border-left:none;">Restart Game</button> </div> diff --git a/tictactoe/morpion/base.js b/tictactoe/morpion/base.js index b5db1d2..7bb8fd2 100755 --- a/tictactoe/morpion/base.js +++ b/tictactoe/morpion/base.js @@ -215,5 +215,20 @@ function airevrand() { } window.addEventListener("load", () => { - if (location.hash === "#/train") train(); -}); + if (location.hash === "#/train") { + train(); + } + if (!location.hash.startsWith("#online/")) { + document.getElementById("resetbtn").style.display = "none"; + } + + if (location.hash === "#/train") { + document.title = "Local Game | Tic-Tac-Toe | Minteck Arcade"; + } else if (location.hash.startsWith("#online/")) { + document.title = "Online Game | Tic-Tac-Toe | Minteck Arcade"; + } else if (location.hash === "#/auto") { + document.title = "Automated machine learning | Tic-Tac-Toe | Minteck Arcade"; + } else { + document.title = "Singleplayer Game | Tic-Tac-Toe | Minteck Arcade"; + } +});
\ No newline at end of file diff --git a/tictactoe/morpion/online.js b/tictactoe/morpion/online.js index c218e79..49bf957 100644 --- a/tictactoe/morpion/online.js +++ b/tictactoe/morpion/online.js @@ -1,4 +1,4 @@ -const onlineServer = "wss://tictactoe.minteck.org/server/prod"; +const onlineServer = "wss://arcade.minteck.org/tictactoe/server/prod"; let errorDisconnect = false; let wcInterval; let waitCount = 0; @@ -46,7 +46,7 @@ function online() { let parts = location.hash.substring(8).split("|"); ws.send(JSON.stringify({ action: 'init', - room: atob(parts[0]), + room: "tictactoe." + atob(parts[0]), player: atob(parts[1]) })) } diff --git a/tictactoe/online.html b/tictactoe/online.html index 38ceb88..37a64df 100644 --- a/tictactoe/online.html +++ b/tictactoe/online.html @@ -1,10 +1,11 @@ <!DOCTYPE html> -<html lang="en"> +<html lang="en" translate="no"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Online Lobby | Tic-Tac-Toe</title> + <title>Online Lobby | Tic-Tac-Toe | Minteck Arcade</title> + <link rel="icon" href="/_general/favicon.svg" type="image/svg+xml"> <style> body { background: black; @@ -15,14 +16,15 @@ </style> </head> <body> -<div style="display:flex;position:fixed;inset:0;align-items: center;justify-content: center;"> +<iframe src="/_general/navbar.html" style="position: fixed;z-index: 9999999999;top: 0;border: none;left: 0;right: 0;height: 32px;width: 100%;"></iframe> +<div style="display:flex;position:fixed;inset:0;align-items: center;justify-content: center;top:32px;"> <div> <h1>Online Mode</h1> <p>Enter a name for your game room: (this is the name you will give to the other player; make sure you pick something unique)</p> <input maxlength="30" placeholder="Game Room Name" name="room" type="text"> <p>Enter a player name: (it will be shown to the other player)</p> <input maxlength="30" placeholder="Player Name" name="name" type="text"> - <p>Your game is encrypted and only you, the other player, and tictactoe.minteck.org can know what you are doing. Player name and game room name are not stored. The other player will see your IP address.</p> + <p>Your game is encrypted and only you, the other player, and Minteck Arcade can know what you are doing. Player name and game room name are not stored. The other player will see your IP address.</p> <div style="width:max-content;margin-left:auto;margin-right:auto;"> <a href="#" onclick="goIfGood();" style="color:white;text-decoration:none;display:block;border:1px solid white;padding:10px;">Let's go!</a> </div> |