Alessandro Petitcollin
ca618d64ca
Now using variable to define time before result message disappears to avoid magic numbers in this case.
2026-01-12 17:02:30 +01:00
Alessandro Petitcollin
35a7438e83
Instead of toast, result message is now displayed on top of tic-tac-toe grid and disappear after a timeout period.
...
# Conflicts:
# frontend/src/pages/ttt/ttt.ts
diff --git c/frontend/src/pages/ttt/ttt.html i/frontend/src/pages/ttt/ttt.html
index 82b0f8f..0ea49e1 100644
--- c/frontend/src/pages/ttt/ttt.html
+++ i/frontend/src/pages/ttt/ttt.html
@@ -1,6 +1,6 @@
<div class="displaybox">
- <div id="mainbox" class="mainboxDisplay">
- <button id="JoinQueueBtn" class="btn-style absolute top-4 right-6">Join Queue</button>
+ <div class="mainboxDisplay" id="mainbox">
+ <button class="btn-style absolute top-4 right-6" id="JoinQueueBtn">Join Queue</button>
<h1 class="text-3xl font-bold text-gray-800">
Tic-tac-toe Box<span id="t-username"></span>
</h1><br>
@@ -14,7 +14,7 @@
</div>
<div class="text-center text-sm text-gray-800 px-4 whitespace-nowrap">
- <div id="currentPlayer" class='text-7xl font-bold'></div>
+ <div class='text-7xl font-bold' id="currentPlayer"></div>
<div id="currentPlayerTimer">Waiting for match...</div>
</div>
@@ -27,17 +27,21 @@
</div>
</div>
<div class="grid-box mt-2">
- <div class="grid-layout">
- <div id="cell1" class="ttt-cell"></div>
- <div id="cell2" class="ttt-cell"></div>
- <div id="cell3" class="ttt-cell"></div>
- <div id="cell4" class="ttt-cell"></div>
- <div id="cell5" class="ttt-cell"></div>
- <div id="cell6" class="ttt-cell"></div>
- <div id="cell7" class="ttt-cell"></div>
- <div id="cell8" class="ttt-cell"></div>
- <div id="cell9" class="ttt-cell"></div>
+ <div class="grid-layout relative rounded-lg overflow-hidden">
+ <div class="absolute inset-0 flex flex-col items-center justify-center z-10 bg-gray-900/85 text-white hidden"
+ id="ttt-end-screen">
+ outcome
+ </div>
+ <div class="ttt-cell" id="cell1"></div>
+ <div class="ttt-cell" id="cell2"></div>
+ <div class="ttt-cell" id="cell3"></div>
+ <div class="ttt-cell" id="cell4"></div>
+ <div class="ttt-cell" id="cell5"></div>
+ <div class="ttt-cell" id="cell6"></div>
+ <div class="ttt-cell" id="cell7"></div>
+ <div class="ttt-cell" id="cell8"></div>
+ <div class="ttt-cell" id="cell9"></div>
</div>
- </div>
+ </div>
</div>
</div>
\ No newline at end of file
diff --git c/frontend/src/pages/ttt/ttt.ts i/frontend/src/pages/ttt/ttt.ts
index 2c22add..a111624 100644
--- c/frontend/src/pages/ttt/ttt.ts
+++ i/frontend/src/pages/ttt/ttt.ts
@@ -1,7 +1,7 @@
import "./ttt.css"
import {addRoute, type RouteHandlerReturn} from "@app/routing";
import tttPage from "./ttt.html?raw";
-import {showError, showInfo, showSuccess, showWarn} from "@app/toast";
+import {showError, showInfo} from "@app/toast";
import {io} from "socket.io-client";
import type {CSocket as Socket, GameUpdate} from "./socket";
import {updateUser} from "@app/auth";
@@ -57,7 +57,8 @@ async function handleTTT(): Promise<RouteHandlerReturn> {
const currentPlayerIndicator = document.getElementById("currentPlayer");
const joinQueueBtn = document.getElementById("JoinQueueBtn");
const currentPlayerTimer = document.getElementById("currentPlayerTimer")
- if (!userXString || !userOString || !currentPlayerIndicator || !joinQueueBtn || !currentPlayerTimer) {
+ const result_message = document.getElementById("ttt-end-screen");
+ if (!userXString || !userOString || !currentPlayerIndicator || !joinQueueBtn || !currentPlayerTimer || !result_message) {
return showError('fatal error');
}
@@ -128,9 +129,12 @@ async function handleTTT(): Promise<RouteHandlerReturn> {
};
const makeEnd = (type: 'win' | 'conceded' | 'draw', player: 'X' | 'O') => {
- // TODO: Enhance the draw notification
if (type === 'draw') {
- showWarn('It\'s a draw !')
+ result_message.innerText = "It's a draw! :/";
+ result_message.classList.remove("hidden");
+ setTimeout(() => {
+ result_message.classList.add("hidden");
+ }, 3 * 1000);
}
if (type === 'win') {
@@ -145,11 +149,19 @@ async function handleTTT(): Promise<RouteHandlerReturn> {
default:
return;
}
- // TODO: Enhance the win/loss notification
- if (youWin)
- showSuccess('You won the game !');
- else
- showError('You lost the game :(');
+ if (youWin) {
+ result_message.innerText = "You won the game! :)";
+ result_message.classList.remove("hidden");
+ setTimeout(() => {
+ result_message.classList.add("hidden");
+ }, 3 * 1000);
+ } else {
+ result_message.innerText = "You lost the game! :(";
+ result_message.classList.remove("hidden");
+ setTimeout(() => {
+ result_message.classList.add("hidden");
+ }, 3 * 1000);
+ }
}
};
2026-01-12 17:02:30 +01:00
Alessandro Petitcollin
1c6a513e4f
result of make npm@update && make npm@openapi
2026-01-12 17:02:30 +01:00
Alessandro Petitcollin
830d733f1b
Initial commit
2026-01-12 17:02:30 +01:00
bgoulard
152d5e9578
added join game via url.
2026-01-12 15:09:54 +01:00
bgoulard
b862dc27f1
[wip] added socket shape for join game + started working on front handling of game param in url
2026-01-12 15:09:54 +01:00
NigeParis
96cfbef642
Added U Game system
2026-01-12 13:35:31 +01:00
Maieul BOYER
6a55b28c2a
feat(tour): tournament is almost done
2026-01-11 18:14:49 +01:00
Maieul BOYER
2e23943578
feat(tour): tournament is almost done
2026-01-11 17:11:59 +01:00
Maieul BOYER
f14d618ed5
feat(chat): Handle user change
2026-01-11 14:00:09 +01:00
Maieul BOYER
0ec2b3007c
feat(pong): now support getting gameUpdate from games you are not playing
2026-01-11 13:58:32 +01:00
NigeParis
cd03048cb3
Chat Overlay on global site done - needs to have chat hide still
2026-01-11 13:16:46 +01:00
Maieul BOYER
d3bd2fce22
update: rebased
2026-01-10 18:53:45 +01:00
NigeParis
b4af6e08ca
Chat moved up to top level now in all services frontend
2026-01-10 18:53:45 +01:00
NigeParis
814c389e38
Deleted NextGame Dev Button in Chat
2026-01-10 18:53:45 +01:00
Maieul BOYER
1b169fca13
added pong keepalive
2026-01-10 18:07:20 +01:00
Maieul BOYER
901e3e5a8e
feat(tour): better frontend for tournament start phase, and auto start after X seconds
2026-01-10 18:07:20 +01:00
bgoulard
ce02e37b81
clean-up css
2026-01-10 17:42:31 +01:00
bgoulard
6d2ebc56ea
[wip]
2026-01-10 17:42:31 +01:00
Maieul BOYER
2195207297
feat(tournament): allow the creation of a tournament
...
A tournament can be created (by the "owner")
Any other players can join said tournament.
The information is currently not displayed in the frontend, but does
exists and is passed to the frontend using a socket.io event
2026-01-10 16:09:04 +01:00
apetitco
272c6f319c
(feat): Queue/Dequeue button and waiting for match text
2026-01-09 18:23:29 +01:00
apetitco
6bd3a01f5f
cleaning code
2026-01-09 17:55:44 +01:00
apetitco
67a277da2d
cleaning code
2026-01-09 17:55:44 +01:00
apetitco
f9d11bd6fa
(frontend): added player names to game page and current player turn indicator
2026-01-09 17:55:44 +01:00
apetitco
1fe5d4711a
(tic-tac-toe): smol update
2026-01-09 17:55:44 +01:00
apetitco
92eb73c508
(tic-tac-toe): Erratum, it's the join/leave queue button
2026-01-09 17:55:44 +01:00
apetitco
ca9b2a7320
(tic-tac-toe): Starting work to implement "New Game" button
2026-01-09 17:55:44 +01:00
bgoulard
a65b8a9067
fix: minor oopsy in the rebase
2026-01-09 11:46:09 +01:00
bgoulard
317c8b62bf
fix(pong-end messages): added pong usernames instead of ids
2026-01-09 11:46:09 +01:00
bgoulard
6894c30f92
[WIP] added dummy chat recieve for games on pong service
2026-01-09 11:46:09 +01:00
NigeParis
4f54d5a462
Clean-up in progress
2026-01-09 10:27:36 +01:00
NigeParis
8086444098
Clean-up
2026-01-09 10:27:36 +01:00
NigeParis
b89fa8504a
Small Bug fixed when member send msg to a member that blocked guest broadcasts
2026-01-09 10:27:36 +01:00
NigeParis
df192cf227
Added possibility for members to block broadcast messages from guests
2026-01-08 13:27:16 +01:00
NigeParis
2b9613fbfb
WIP - block guests - working - deBugging
2026-01-08 13:27:16 +01:00
NigeParis
66a9947197
WIP no guest msg flagger
2026-01-08 13:27:16 +01:00
Maieul BOYER
43e6ec24f5
feat(ttt): added concede detection and move timeout
2026-01-07 21:10:31 +01:00
bgoulard
350c5bf4fc
added local games keys
2026-01-07 15:28:32 +01:00
bgoulard
8df5c57b9a
ready btn pretty
2026-01-07 15:28:32 +01:00
bgoulard
5e19ed3ed9
pong pro-tips / how-to-play added
2026-01-07 15:28:32 +01:00
bgoulard
20a0e4cc61
pretty-fy the ready btn
2026-01-07 15:28:32 +01:00
bgoulard
7633e7ca05
fix bug rdy-box visibility @ end of game
2026-01-07 15:28:32 +01:00
bgoulard
adb89aecbe
fix:local, fix:timer, fix:evt rdyEnd
2026-01-07 15:28:32 +01:00
bgoulard
155f4ec169
win cond fixed
2026-01-07 15:28:32 +01:00
bgoulard
572392f640
[wip] - frontend meh/20 back-end meh/20 still, works. works badly but does work...
2026-01-07 15:28:32 +01:00
Maix0
f87a991441
feat(ttt): added draw status in ttt match history
2026-01-07 00:20:00 +01:00
Maix0
2bf5e6e700
feat(ttt): match history done
2026-01-07 00:20:00 +01:00
NigeParis
8f3ed71d8a
Added @block
2026-01-06 16:56:24 +01:00
NigeParis
97a7384af7
Added cmd @block <name> to toggle block / un block user
2026-01-06 16:56:24 +01:00
Maieul BOYER
0ef66cdc10
feat(pong): add way to view game list
2026-01-06 16:50:11 +01:00