162 lines
7.8 KiB
HTML
162 lines
7.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>{{LOBBYTITEL}}</title>
|
|
<!-- Klon der Lobby. Nur Klassennamen aus mock/vorlage/dom-lobby.json - der Test prüft das. -->
|
|
<style>
|
|
body { margin: 0; background: #12141c; color: #e8e8ee; font: 14px/1.4 Roboto, Arial, sans-serif; }
|
|
.cp-header { background: #1b1e29; }
|
|
.app-titlebar { display: flex; justify-content: space-between; padding: 4px 12px; font-size: 12px; color: #9aa; }
|
|
.cp-header__content { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
|
|
.cp-header__logo { font-weight: 700; font-size: 20px; color: #ff4d5e; }
|
|
.user-details { display: flex; gap: 12px; align-items: center; }
|
|
.user-details__balance-value { color: #f5c542; }
|
|
.cp-tab-navigation__buttons { display: flex; gap: 6px; padding: 8px 16px; background: #171a24; }
|
|
.tab-button { padding: 6px 12px; border-radius: 6px; cursor: pointer; color: #aab; }
|
|
.tab-button.active-tab { background: #2b3045; color: #fff; }
|
|
.coinpoker-lobby__body { display: flex; flex-direction: column; min-height: 100vh; }
|
|
.lobby-cash-games { display: flex; gap: 16px; padding: 16px; flex: 1; }
|
|
.game-type-listing, .game-table-listing { background: #1b1e29; border-radius: 8px; padding: 8px; }
|
|
.game-type-listing { flex: 1.2; }
|
|
.game-table-listing { flex: 1; }
|
|
.game-type-row, .table-row, .game-table-listing-row-header, .cash-game-listing-row-header {
|
|
display: grid; align-items: center; padding: 6px 8px; border-bottom: 1px solid #262a38; }
|
|
.game-type-row, .cash-game-listing-row-header { grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr; }
|
|
.table-row, .game-table-listing-row-header { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
|
|
.header-item { color: #889; font-size: 12px; }
|
|
.table-row.selected { background: #262b3d; }
|
|
.button { border: 0; border-radius: 6px; padding: 6px 14px; cursor: pointer; font: inherit; }
|
|
.button-module__primary___C1vVV { background: #1fae64; color: #fff; }
|
|
.quick-join-button { background: #2b3045; color: #fff; }
|
|
.table-seat-progress { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
|
|
.table-seat-progress__seat { width: 6px; height: 6px; border-radius: 50%; background: #1fae64; }
|
|
.table-seat-progress__seat--empty { background: #3a3f52; }
|
|
.lobby-footer { display: flex; gap: 16px; padding: 8px 16px; color: #778; font-size: 12px; }
|
|
</style>
|
|
</head>
|
|
<body class="lang-en">
|
|
<div class="coinpoker-lobby"><div class="coinpoker-lobby__body">
|
|
<header class="cp-header">
|
|
<div class="app-titlebar">
|
|
<div class="app-titlebar__left"></div>
|
|
<div class="app-titlebar__center"></div>
|
|
<div class="app-titlebar__right"><div class="app-titlebar__players"><span>11076 Online</span></div></div>
|
|
</div>
|
|
<div class="cp-header__content">
|
|
<div class="cp-header__logo">CoinPoker</div>
|
|
<div class="user-details">
|
|
<div class="user-details__username">{{HELD}}</div>
|
|
<div class="user-details__balance"><span class="user-details__balance-value">{{KONTO}}</span></div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="cp-tab-navigation"><div class="cp-tab-navigation__buttons">
|
|
<div class="tab-button tab-cash-games active-tab" role="button">Cash Games</div>
|
|
<div class="tab-button tab-vip-arena" role="button">VIP Arena</div>
|
|
<div class="tab-button tab-aof-games" role="button">All-In Or Fold</div>
|
|
<div class="tab-button tab-bomb-pot" role="button">Bomb Pot</div>
|
|
<div class="tab-button tab-tourneys" role="button">Tournaments</div>
|
|
<div class="tab-button tab-freeRolls" role="button">Freerolls</div>
|
|
</div></div>
|
|
<div class="lobby-cash-games">
|
|
<div class="game-type-listing">
|
|
<div class="cash-game-listing-row-header">
|
|
<div class="header-item">Game Type</div><div class="header-item">Blinds</div>
|
|
<div class="header-item">Players</div><div class="header-item">Min Buy-In</div><div></div>
|
|
</div>
|
|
<div class="game-type-row">
|
|
<div>NLH</div><div class="blind-amount">1K / 2K</div><div class="player-count">48</div>
|
|
<div class="buy-in">80K</div><div><button class="button quick-join-button">Quick Join</button></div>
|
|
</div>
|
|
</div>
|
|
<div class="game-table-listing">
|
|
<div class="game-table-listing-row-header">
|
|
<div class="header-item">Table</div><div class="header-item">Avg. Stack</div>
|
|
<div class="header-item">Players</div><div class="header-item">Features</div>
|
|
</div>
|
|
<div class="game-table-listing-container"></div>
|
|
</div>
|
|
</div>
|
|
<div class="lobby-footer"><span class="app-version">v1.31.0</span><span>App Health</span><span>Helpdesk</span></div>
|
|
</div></div>
|
|
<script>
|
|
const liste = document.querySelector(".game-table-listing-container");
|
|
// Offene Tischfenster, Tischnummer -> Fenster. Jedes neue oder geschlossene Fenster
|
|
// ordnet alle im Raster neu an (bis 12: 4 x 3), Seitenverhältnis wie der Client.
|
|
const fenster = new Map();
|
|
const BREITE = 1000, HOEHE = 766;
|
|
|
|
function raster(n) {
|
|
const spalten = Math.ceil(Math.sqrt(n)), zeilen = Math.ceil(n / spalten);
|
|
const b = Math.min(BREITE, Math.floor(screen.availWidth / spalten),
|
|
Math.floor(screen.availHeight / zeilen * BREITE / HOEHE));
|
|
return {spalten, b, h: Math.floor(b * HOEHE / BREITE)};
|
|
}
|
|
// Geschlossene Fenster raus; ein Fenster, das per Find Seat auf einen anderen Tisch gewechselt hat,
|
|
// steht danach unter der neuen Tischnummer.
|
|
function nummerVon(w) {
|
|
try { return (new URLSearchParams(w.location.search).get("room") || "").split(" ").pop(); }
|
|
catch (e) { return ""; }
|
|
}
|
|
function aufraeumen() {
|
|
for (const [nr, w] of [...fenster]) {
|
|
fenster.delete(nr);
|
|
if (!w.closed) fenster.set(nummerVon(w) || nr, w);
|
|
}
|
|
}
|
|
function anreihen() {
|
|
aufraeumen();
|
|
const r = raster(fenster.size);
|
|
[...fenster.values()].forEach((w, i) => {
|
|
w.resizeTo(r.b, r.h);
|
|
w.moveTo(screen.availLeft + (i % r.spalten) * r.b,
|
|
screen.availTop + Math.floor(i / r.spalten) * r.h);
|
|
});
|
|
}
|
|
setInterval(() => { if ([...fenster.values()].some(w => w.closed)) anreihen(); }, 1000);
|
|
|
|
function zeile(t) {
|
|
const r = document.createElement("div");
|
|
r.className = "table-row";
|
|
r.dataset.tableId = t.id;
|
|
r.innerHTML = `<div class="game-info"></div><div class="avg-stack"></div>
|
|
<div class="players"><span class="player-count"></span><div class="table-seat-progress"></div></div>
|
|
<div class="features"><button class="button button-module__button___jwIJR button-module__primary___C1vVV coinpoker-join-content">Join</button></div>`;
|
|
r.querySelector(".game-info").textContent = t.id;
|
|
r.querySelector("button").addEventListener("click", () => {
|
|
const nummer = t.id.split(" ").pop();
|
|
aufraeumen();
|
|
const offen = fenster.get(nummer);
|
|
if (offen && !offen.closed) { offen.focus(); return; }
|
|
const r = raster(fenster.size + 1);
|
|
fenster.set(nummer, window.open("table.html?room=" + encodeURIComponent(t.id), "tisch-" + nummer,
|
|
`popup=yes,width=${r.b},height=${r.h}`));
|
|
anreihen();
|
|
});
|
|
r.addEventListener("click", () => {
|
|
for (const z of liste.children) z.classList.toggle("selected", z === r);
|
|
});
|
|
return r;
|
|
}
|
|
|
|
async function laden() {
|
|
try {
|
|
const tische = await (await fetch("/api/tische")).json();
|
|
for (const t of tische) {
|
|
let r = liste.querySelector(`[data-table-id="${CSS.escape(t.id)}"]`);
|
|
if (!r) { r = zeile(t); liste.appendChild(r); }
|
|
r.querySelector(".avg-stack").textContent = t.schnitt;
|
|
r.querySelector(".player-count").textContent = `${t.spieler}/6`;
|
|
const sitze = r.querySelector(".table-seat-progress");
|
|
sitze.innerHTML = Array.from({length: 6}, (_, i) =>
|
|
`<span class="table-seat-progress__seat table-seat-progress__seat--${i < t.spieler ? "normal" : "empty"}"></span>`).join("");
|
|
}
|
|
} catch (e) { /* Server weg - nichts zu tun */ }
|
|
}
|
|
laden();
|
|
setInterval(laden, 1500);
|
|
</script>
|
|
</body>
|
|
</html>
|