summaryrefslogtreecommitdiffstats
path: root/web/play/src/history.ts
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-08 12:24:25 +0100
committersalmonik <salmonik@tuta.io>2026-11-08 12:24:25 +0100
commitc45ff4525c0e45e4b8e762b81fd180c53d206d66 (patch)
treebd0ffca5835d612a884d973e65f17cf954d69239 /web/play/src/history.ts
parentweb: remove .git from repo link (diff)
downloadzagan-bet-c45ff4525c0e45e4b8e762b81fd180c53d206d66.tar.gz
zagan-bet-c45ff4525c0e45e4b8e762b81fd180c53d206d66.zip
web: match the desktop layout and remove play-money copy
The browser now uses the desktop's full-width game split: no extra game header or card frame, a full-height sidebar with a pinned action block, and the same lobby grid, topbar account/balance blocks, and bottom-left notices. Slots uses the desktop symbol colours and gold win border; roulette gets the flat felt, column bets under the dozens, the wheel, circular chips, and a LAST line; blackjack gets a centred dealer/player table and divider; crash gets the chart panel, phase label and empty ready state. Also drops every play-money/real-money disclaimer from the page copy.
Diffstat (limited to 'web/play/src/history.ts')
-rw-r--r--web/play/src/history.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/web/play/src/history.ts b/web/play/src/history.ts
index 9e7a564..943c8b8 100644
--- a/web/play/src/history.ts
+++ b/web/play/src/history.ts
@@ -1,5 +1,5 @@
1import type { View } from "./types"; 1import type { View } from "./types";
2import { clear, formatTime, money, node, signedMoney } from "./dom"; 2import { clear, money, node } from "./dom";
3 3
4function summary(record: any): string { 4function summary(record: any): string {
5 const details = record.details ?? {}; 5 const details = record.details ?? {};
@@ -37,21 +37,20 @@ export function renderHistory(root: HTMLElement, view: View): void {
37 const table = node("table"); 37 const table = node("table");
38 const head = node("thead"); 38 const head = node("thead");
39 const headRow = node("tr"); 39 const headRow = node("tr");
40 for (const label of ["Time", "Game", "Bet", "Result", "Net", "Balance"]) { 40 for (const label of ["When", "Game", "Bet", "Won", "Balance", "Result"]) {
41 headRow.append(node("th", undefined, label)); 41 headRow.append(node("th", undefined, label));
42 } 42 }
43 head.append(headRow); 43 head.append(headRow);
44 const body = node("tbody"); 44 const body = node("tbody");
45 for (const record of records) { 45 for (const record of records) {
46 const row = node("tr"); 46 const row = node("tr");
47 row.append(node("td", "mono", formatTime(String(record.at ?? "")))); 47 row.append(node("td", "mono", String(record.at ?? "").slice(0, 16)));
48 row.append(node("td", undefined, String(record.game ?? ""))); 48 row.append(node("td", "mono", String(record.game ?? "").toUpperCase()));
49 row.append(node("td", "num", money(Number(record.bet ?? 0)))); 49 row.append(node("td", "num", money(Number(record.bet ?? 0))));
50 row.append(node("td", "muted", summary(record))); 50 const winnings = Number(record.winnings ?? 0);
51 const net = Number(record.winnings ?? 0) - Number(record.bet ?? 0); 51 row.append(node("td", `num ${winnings > 0 ? "pos" : ""}`, money(winnings)));
52 const netCell = node("td", `num ${net > 0 ? "pos" : net < 0 ? "neg" : ""}`, net === 0 ? "0 Kr" : signedMoney(net));
53 row.append(netCell);
54 row.append(node("td", "num", money(Number(record.balance_after ?? 0)))); 52 row.append(node("td", "num", money(Number(record.balance_after ?? 0))));
53 row.append(node("td", "muted", summary(record)));
55 body.append(row); 54 body.append(row);
56 } 55 }
57 table.append(head, body); 56 table.append(head, body);