Files
pokerfreak/mock/seiten/table.html
T
mmintelandClaude Opus 5.5 c20ac5af58 Vorab-Knopf Call mit Betrag in der zweiten Zeile, Abstand zwischen Haken und Text
Wie im Client: "Call" und darunter, was ein Call jetzt kostete (hoechster
Einsatz minus der eigene, hoechstens der eigene Stack); Haken links mit
Abstand, Schrift leichter. Faelle: test_vorab_call_zeigt_den_betrag_unter_dem_text,
test_vorab_haken_steht_mit_abstand_vor_dem_text (beide vorher rot).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:33:30 +01:00

849 lines
54 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{TITEL}}</title>
<!-- Nachbildung des gemalten Unity-Tisches. Alle Stellen sind Anteile des FENSTERRAHMENS
(mock/vorlage/README.md), nicht der Seite - so rechnet auch hand/click.py.
Am Tisch gemessen (mock/vorlage/tisch-geometrie.md, Fenster 820x628):
+ freier Platz 1: 0.140/0.235 2: 0.485/0.185 3: 0.868/0.239 4: 0.868/0.622
5: 0.497/0.787 6: 0.107/0.61 (Seitennummern; Client: 3, 4, 5, 6, 1, 2)
voller Tisch Join Wait List 0.720/0.951 Find Seat 0.902/0.951
Buy-in-Dialog Min 0.377/0.611 Mitte 0.500/0.611 Max 0.624/0.611 Buy-In 0.500/0.847
Schliessen 0.674/0.151 "Claim Chips" 0.613/0.261 (nur bei offenen Chips)
Der rote Knopf heisst "Buy-In" (freier Platz, Nachkauf) oder "Join Wait List"
(Find Seat am vollen Tisch). Betrag beim Öffnen: freier Platz Max, Wartelisten-
Dialog Min, Nachkauf Min - gekauft wird, was im Feld steht.
Fensterkreuz des Spiels 0.972/0.024 (schliesst das Tischfenster). Im Chrome des Klons liegt
die Titelleiste des Betriebssystems über der Seite: bei 0.024 (rund 15 px) trifft
ein Mausklick sie, nicht die Seite. Das Kreuz sitzt deshalb bei x 0.972 und so
hoch, wie die Seite reicht (0.0223 der Seitenhoehe unter ihrem Rand, data-min-top) - ohne
Titelleiste ist es genau 0.024. Abweichung nur in y, nur im Klon.
Sit Out / I'm Back: im Menü hinter "•••" (0.032/0.881), Eintrag "Sit Out All" bzw. "I'm Back" bei 0.110/0.798
(hand/sitzen.py MENUE, SITOUT_MENUE), nur wenn wir sitzen.
Wer am eigenen Platz das Fensterkreuz drückt, steht auf: game.leave_Seat, Stack zurück ins Guthaben.
Nachkauf: kein eigener Knopf. Auf dem eigenen Platz sitzt ein kleines "+" an der Stelle des
freien-Platz-+ (PLUS), solange der Stack unter dem Max-Buy-in liegt; Klick öffnet den Dialog.
Find Seat am vollen Tisch bleibt am Tisch und öffnet den Wartelisten-Dialog.
Profil-Dialog (Vorfall 29.10.2026, archiv/mitschrieb/vorfall-profil-dialog.png): Fläche x 0.265-0.735, y 0.068-0.975,
Kopfzeile "Profile" y 0.068-0.16, Kreuz 0.704/0.113. Der ganze Tisch dahinter ist abgedunkelt, der Dialog
schluckt ALLE Klicks (auch auf Fold/Call/Raise darunter); nur das Kreuz schliesst, "Save" nicht.
Öffnet, wenn die Maus >= 0,6 s über einem besetzten Sitzschild ruht (Mitte +- 0.075/0.10) oder per
POST /api/profil. Das Fensterkreuz des Spiels bleibt darüber (es gehört dem Betriebssystem).
Mit --profil- (Befund 18:1x): Hover öffnet nur das KOMPAKTE Profil (Ringe neben dem Schild, die Leiste
bleibt frei, Klicks gehen durch), erst ein Klick aufs fremde Sitzschild das grosse; das kompakte geht zu, sobald
die Maus das Schild verlässt. -->
<style>
/* Masse: ALLES in Anteilen des FENSTERRAHMENS (mit Titelleiste), nie in Pixeln und nie in vw/vh.
anordnen() setzt --fw/--fh (Rahmenbreite/-hoehe), --rand und --oben (Seitenrand, Titelleiste) in
Pixeln; --b ist ein Prozent der Rahmenbreite, --h ein Prozent der Rahmenhoehe. "calc(var(--b) * 12.5)"
heisst also 12,5 % der Breite des Fensters - wie die Stellen (data-fx/data-fy) und wie sie hand/ rechnet.
Haarlinien (Rand, Umriss bis 3 px) bleiben Pixel. Quellen der Masse: mock/vorlage/tisch-geometrie-gerendert.md */
html { --fw: 0px; --fh: 0px; --rand: 0px; --oben: 0px; --b: calc(var(--fw) / 100); --h: calc(var(--fh) / 100); }
html, body { margin: 0; height: 100%; overflow: hidden; }
/* Eindruck (Farben, Verlaeufe, Formen) nach Pixelproben der Vorlagebilder; alles selbst gezeichnet mit CSS,
keine Bilder, keine Avatare, kein Logo. Pruefung: tests/tischlayout_spec.py, Abschnitt "Eindruck". */
body { background: radial-gradient(ellipse at 50% 42%, #1b1c2c 0%, #121320 55%, #0b0c14 100%); color: #eee;
font: calc(var(--h) * 2.4) / 1.2 Roboto, Arial, sans-serif; position: relative; }
.filz { position: absolute; left: calc(var(--b) * 6.1 - var(--rand)); top: calc(var(--h) * 20.3 - var(--oben));
width: calc(var(--b) * 87.8); height: calc(var(--h) * 63.3); box-sizing: border-box; border-radius: 50%;
background: radial-gradient(ellipse at 50% 46%, #17614a 0%, #145040 45%, #0f4332 72%, #0a3226 100%);
border: calc(var(--b) * 2.85) solid #171a20;
box-shadow: 0 0 calc(var(--b) * 1.4) calc(var(--b) * .15) rgba(60, 105, 150, .45),
0 calc(var(--h) * 1.2) calc(var(--h) * 3) rgba(0, 0, 0, .55),
inset 0 0 calc(var(--b) * 7) rgba(0, 0, 0, .42), inset 0 0 0 3px rgba(0, 0, 0, .55); }
.stelle { position: absolute; transform: translate(-50%, -50%); }
/* Sitzschild: die Platte (Name, Chips) ist das Element; der Avatar steckt dahinter, das Kennzeichen
(Fold, Check, All-in) sitzt auf ihrer linken oberen Ecke. Die Plattenform ist ein Vieleck (::before). */
.platz { width: calc(var(--b) * 13.9); height: calc(var(--h) * 7.4); text-align: center; }
.platz .name { position: relative; box-sizing: border-box; width: 100%; height: 100%;
display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
font-size: calc(var(--h) * 2.6); white-space: nowrap; filter: drop-shadow(0 calc(var(--h) * .5) calc(var(--h) * .6) rgba(0, 0, 0, .5)); }
.platz .name::before { content: ""; position: absolute; inset: 0; z-index: -1;
background: linear-gradient(#26282c 0%, #1b1c1f 14%, #17181a 55%, #131415 100%);
clip-path: polygon(6% 0, 94% 0, 100% 20%, 98% 86%, 93% 100%, 7% 100%, 2% 86%, 0 20%); }
.platz .name > div:first-child { max-width: 94%; overflow: hidden; text-overflow: ellipsis; color: #ecedee; }
.platz .chips { color: #f6b82b; font-weight: 700; font-size: calc(var(--h) * 3); width: 76%;
border-top: 1px solid rgba(255, 255, 255, .14); margin-top: calc(var(--h) * .2); padding-top: calc(var(--h) * .1); }
.platz .avatar { position: absolute; z-index: -1; left: 50%; top: calc(var(--h) * -12.3); width: calc(var(--b) * 11.3);
aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; box-sizing: border-box;
background: radial-gradient(ellipse 42% 36% at 50% 98%, #20121a 96%, transparent 100%),
radial-gradient(ellipse 15% 15% at 50% 36%, #20121a 96%, transparent 100%),
radial-gradient(circle at 50% 30%, #6a2a35, #2c1118 80%);
border: 2px solid #46323b; box-shadow: inset 0 0 calc(var(--b) * 1.2) rgba(0, 0, 0, .6); }
.platz.dran .avatar { box-shadow: 0 0 calc(var(--b) * 1.6) calc(var(--b) * .4) rgba(79, 209, 255, .7), inset 0 0 calc(var(--b) * 1.2) rgba(0, 0, 0, .6); }
/* die Rueckseiten der Gegnerkarten: stecken hinter der Platte, fuellen die Luecke zum Avatar */
.platz .rueck { position: absolute; z-index: -1; pointer-events: none; box-sizing: border-box; top: calc(var(--h) * -6.2);
left: calc(50% - var(--b) * 5.6); width: calc(var(--b) * 6.6); height: calc(var(--h) * 10); transform-origin: 50% 100%; transform: rotate(-5deg);
border-radius: calc(var(--b) * .8); border: 1px solid #8a2a38; background-color: #5f141d;
background-image: repeating-linear-gradient(45deg, rgba(255, 150, 160, .13) 0 calc(var(--b) * .25), transparent calc(var(--b) * .25) calc(var(--b) * 1.1)),
repeating-linear-gradient(-45deg, rgba(255, 150, 160, .13) 0 calc(var(--b) * .25), transparent calc(var(--b) * .25) calc(var(--b) * 1.1)),
linear-gradient(#6f1a26, #4c0c17); }
.platz .rueck + .rueck { left: calc(50% - var(--b) * 1); transform: rotate(5deg); }
/* Zeitbalken unter der Platte des Spielers am Zug; --rest (0..1) setzt uhrTicken */
.platz.dran::after { content: ""; position: absolute; left: 15%; width: 70%; top: calc(100% + var(--h) * .6); height: calc(var(--h) * .9);
border-radius: calc(var(--h) * .5);
background: linear-gradient(90deg, #b3f8f9, #e8fcfe) 0 0 / calc(var(--rest, 1) * 100%) 100% no-repeat, #0f1418; }
.platz .aktion { position: absolute; left: 0; top: calc(var(--h) * -3.4); background: #15705d; color: #fff; font-weight: 700;
font-size: calc(var(--h) * 2); padding: calc(var(--h) * .3) calc(var(--b) * .9); border-radius: calc(var(--b) * .5); z-index: 1;
text-transform: uppercase; letter-spacing: .03em; }
.platz .aktion[data-a="allin"] { background: #ce0000; }
.platz .aktion[data-a="fold"] { background: #1f2b2b; color: #8d9a9a; }
.platz .aktion[data-a="call"] { background: #1e7a4a; }
.platz .aktion[data-a="raise"], .platz .aktion[data-a="bet"] { background: #c47a14; }
.platz .aktion:empty { display: none; }
.platz.gefoldet { opacity:.45; }
.platz.dran .name { filter: drop-shadow(0 0 3px #4fd1ff) drop-shadow(0 calc(var(--h) * .5) calc(var(--h) * .6) rgba(0, 0, 0, .5)); }
.einsatz { position: absolute; background: #0c3127; color: #fff; border-radius: calc(var(--h) * 4); padding: calc(var(--h) * .35) calc(var(--b) * 1.5);
font-size: calc(var(--h) * 3.1); line-height: 1.1; white-space: nowrap; }
/* der rote Chip steht ueber dem Betrag und schiebt ihn nicht */
.einsatz::before { content: ""; position: absolute; left: 50%; bottom: 100%; margin-bottom: calc(var(--h) * .5); transform: translateX(-50%);
width: calc(var(--b) * 3.6); height: calc(var(--h) * 2.8); border-radius: 50%;
background: radial-gradient(ellipse at 50% 50%, #e8333d 0 34%, #fbeaea 35% 46%, #d1222e 47% 100%);
box-shadow: 0 calc(var(--h) * .5) 0 #8c1219; }
.uhr { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(var(--b) * 4.6); aspect-ratio: 1;
border-radius: 50%; border: 3px solid #d4202c; background: radial-gradient(circle at 40% 35%, #ffffff, #e9e9ec);
color: #14110f; font-weight: 700; font-size: calc(var(--h) * 2.5); line-height: 1; }
.uhr.knapp { background: #ffe0e0; color: #a80d18; }
.uhr[hidden] { display: none; }
.handnr { position: absolute; left: calc(var(--b) * 1.5); top: calc(var(--h) * 1.6); color: #778; font-size: calc(var(--h) * 1.9); }
.platz-frei { width: calc(var(--b) * 8.5); aspect-ratio: 1; box-sizing: border-box; border-radius: 50%; border: 2px solid #24262b;
background: radial-gradient(circle at 50% 40%, #202227, #131417); color: #9a9b9a; font-size: calc(var(--h) * 7); font-weight: 300;
line-height: 1; cursor: pointer; padding: 0;
box-shadow: 0 calc(var(--h) * .6) calc(var(--h) * 1.6) rgba(0, 0, 0, .55), inset 0 0 calc(var(--b) * 1.5) rgba(0, 0, 0, .5); }
.platz-frei:hover { color: #d8d9d8; border-color: #3a3d44; }
.platz-frei:active { filter: brightness(.8); }
.pot { background: #113a2e; color: #fff; border-radius: calc(var(--h) * 4); padding: calc(var(--h) * .5) calc(var(--b) * 1.8);
font-size: calc(var(--h) * 2.9); white-space: nowrap; }
.pot[hidden] { display: none; }
.pot b { color: #3d9be9; font-weight: 600; }
/* Dealer-Knopf: rotes Sechseck mit weissem D neben der Platte des Gebers (zustand.geber) */
.geber { display: flex; align-items: center; justify-content: center; width: calc(var(--b) * 3.2); aspect-ratio: 1; color: #fff;
font-weight: 800; font-size: calc(var(--h) * 2.8); line-height: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
background-color: #d9261c; background-image: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .38), transparent 55%);
clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.karten { display: flex; gap: calc(var(--b) * .8); }
/* das Board hat fuenf feste Plaetze: die erste Karte bleibt stehen, wenn Turn und River kommen */
#board { width: calc(var(--b) * 37.05); justify-content: flex-start; }
#eigene .karten { gap: calc(var(--b) * -1); justify-content: center; }
/* Karte: grosser Wert oben links, kleine Farbe darunter, grosse Farbe unten rechts (::after, aus data-f) */
.karte { position: relative; background: #f5f6f5; color: #14110f; border-radius: calc(var(--b) * .9); width: calc(var(--b) * 6.77);
height: calc(var(--h) * 12.5); font: 700 calc(var(--h) * 4.6) / 1 "Arial Narrow", "Roboto Condensed", Arial, sans-serif; flex: none;
box-shadow: 0 calc(var(--h) * .3) calc(var(--h) * .8) rgba(0, 0, 0, .45); }
.karte b { position: absolute; left: 7%; top: 1%; font-weight: 700; letter-spacing: -.04em; }
.karte i { position: absolute; left: 9%; top: 40%; font-style: normal; font-size: calc(var(--h) * 3.2); }
.karte::after { content: attr(data-f); position: absolute; right: 8%; bottom: 3%; font-size: calc(var(--h) * 5.8); }
.karte.rot { color: #b51e22; }
.aktionsleiste button { position: absolute; transform: translate(-50%, -50%); border: 1px solid #2a2c31; border-radius: calc(var(--b) * 1);
background-color: #17171a; background-image: linear-gradient(rgba(255, 255, 255, .04), rgba(0, 0, 0, .1));
color: #fff; font: 600 calc(var(--h) * 2.2) Roboto, Arial, sans-serif; cursor: pointer;
white-space: nowrap; padding: 0; box-shadow: 0 calc(var(--h) * .4) calc(var(--h) * .8) rgba(0, 0, 0, .4); }
.aktionsleiste button:hover { background-color: #26272c; border-color: #3c3e46; }
.aktionsleiste button:active { background-color: #0f0f11; box-shadow: inset 0 calc(var(--h) * .3) calc(var(--h) * .6) rgba(0, 0, 0, .6); }
.aktionsleiste .haken { color: #8e8e90; font-weight: 700; }
/* Vorab-Knopf wie im Bild: Haken links mit Abstand, Text mittig, ein Betrag darunter */
.aktionsleiste button:has(.haken) { display: flex; align-items: center; justify-content: center; gap: calc(var(--b) * 1.3);
font-weight: 500; }
.aktionsleiste .text { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.aktionsleiste .text small { font-size: inherit; font-weight: inherit; }
.aktionsleiste .an .haken { color: #3ddc84; }
.aktionsleiste .gross { width: calc(var(--b) * 12.5); height: calc(var(--h) * 6.4); }
.aktionsleiste .klein { width: calc(var(--b) * 4.6); height: calc(var(--h) * 4.6); font-size: calc(var(--h) * 2); }
.aktionsleiste .fold { background: linear-gradient(#b8383f, #8a2229); border-color: #5c1519; }
.aktionsleiste .call { background: linear-gradient(#35965a, #1f6a3b); border-color: #164a29; }
.aktionsleiste .raise { background: linear-gradient(#cf9a2c, #946814); border-color: #6b4a0c; }
.aktionsleiste .fold:hover, .aktionsleiste .call:hover, .aktionsleiste .raise:hover { filter: brightness(1.15); }
.aktionsleiste .fold:active, .aktionsleiste .call:active, .aktionsleiste .raise:active { filter: brightness(.85); }
.aktionsleiste .an { border-color: #2e7d4f; }
.betrag { position: absolute; transform: translate(-50%, -50%); box-sizing: border-box; width: calc(var(--b) * 9); height: calc(var(--h) * 4.4);
text-align: center; font-size: calc(var(--h) * 2.4); background: #0d0f15; color: #fff; border: 1px solid #333; border-radius: calc(var(--b) * .7); }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: none; }
/* Der Dialog ist eine durchsichtige Fläche über dem ganzen Fenster; jedes Element mit data-fx
sitzt an seiner gemessenen Stelle (anordnen()). Keine Klassen ausser denen der Seite. */
.sfs-buy-in-modal { position: absolute; inset: 0; display: none; }
.sfs-buy-in-modal [data-fx] { position: absolute; transform: translate(-50%, -50%); margin: 0; }
.sfs-buy-in-header,.sfs-buy-in-body,.sfs-buy-in-body-range-buttons,
.sfs-buy-in-modal-button-container { display: contents; } /* nur Gruppen, ohne eigene Fläche */
.sfs-buy-in-modal-container { width: calc(var(--b) * 40); height: calc(var(--h) * 82); background: #1b1e29; border-radius: calc(var(--b) * 1.5); }
.sfs-buy-in-heading { font-size: calc(var(--h) * 3.2); font-weight: 700; }
.sfs-buy-in-header-game-info { color: #99a; white-space: nowrap; font-size: calc(var(--h) * 2.2); }
.sfs-buy-in-balance-container { display: flex; gap: calc(var(--b) * 1); white-space: nowrap; font-size: calc(var(--h) * 2.4); }
.sfs-buy-in-user-balance { color: #f5c542; font-weight: 700; }
.sfs-slider-range-value { width: calc(var(--b) * 30); box-sizing: border-box; padding: calc(var(--h) * 1.2); font-size: calc(var(--h) * 2.9); text-align: center;
background: #0d0f15; color: #fff; border: 1px solid #333; border-radius: calc(var(--b) * .7); }
.sfs-buy-in-body-min-range,.sfs-buy-in-body-mid-range,.sfs-buy-in-body-max-range,
.sfs-buy-in-modal-button,.sfs-buy-in-modal-header-button {
background: #2b3045; color: #fff; border: 0; border-radius: calc(var(--b) * .7); padding: 0; cursor: pointer;
font: inherit; white-space: nowrap; width: calc(var(--b) * 10); height: calc(var(--h) * 5.4); }
.sfs-buy-in-modal-header-button { background: #a5791d; font-size: calc(var(--h) * 2.1); width: calc(var(--b) * 12); height: calc(var(--h) * 4.5); }
.sfs-buy-in-modal-button { background: #d4202c; font-weight: 700; width: calc(var(--b) * 30); height: calc(var(--h) * 7); }
.sfs-buy-in-body-error { color: #ff6b6b; min-height: 1em; font-size: calc(var(--h) * 1.9); white-space: nowrap; }
.common-dialog-cross-icon { cursor: pointer; font-size: calc(var(--h) * 3.5); line-height: 1; text-align: center;
width: calc(var(--b) * 3.4); height: calc(var(--h) * 4.4); display: flex; align-items: center; justify-content: center; }
.sfs-buy-in-body-container-text { color: #99a; font-size: calc(var(--h) * 2.1); white-space: nowrap; }
.nachkauf { border: 2px solid #e9f6ec; border-radius: 50%; width: calc(var(--b) * 3.8); aspect-ratio: 1; box-sizing: border-box; padding: 0; z-index: 5;
background: radial-gradient(circle at 50% 35%, #46c768, #1f8f3e); box-shadow: 0 calc(var(--h) * .5) calc(var(--h) * 1) rgba(0, 0, 0, .5); color: #fff; font: 700 calc(var(--h) * 3.2) / 1 Roboto, Arial; cursor: pointer; }
.spielkreuz { background: #232634; color: #ccc; border-radius: calc(var(--b) * .7); width: calc(var(--b) * 3.2); height: calc(var(--h) * 3.5);
line-height: calc(var(--h) * 3.5); text-align: center; cursor: pointer; font-size: calc(var(--h) * 2.9); }
.sitoutknopf { background: #262a36; color: #fff; border: 0; border-radius: calc(var(--b) * 1); padding: calc(var(--h) * 1) calc(var(--b) * 1.7);
font: 600 calc(var(--h) * 2.2) Roboto, Arial, sans-serif; cursor: pointer; white-space: nowrap; }
/* Sit Out steckt hinter dem "..."-Knopf (31.10. am Tisch gemessen): der Knopf unten
links oeffnet ein Menue, darin "Sit Out Next Hand" / "Sit Out All". */
.menueknopf { background: linear-gradient(#d6d6d6, #8c8c8c); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .55); border: 1px solid #6e6e6e; border-radius: calc(var(--b) * 2.5); width: calc(var(--b) * 4); height: calc(var(--h) * 3.2);
font: 700 calc(var(--h) * 2.2) / 1 Roboto, Arial; cursor: pointer; padding: 0; }
.menueintrag { background: #17181d; border: 1px solid #333; border-radius: calc(var(--b) * .7); color: #e8e8ee;
padding: calc(var(--h) * .8) calc(var(--b) * 1.5); font: calc(var(--h) * 2.1) Roboto, Arial, sans-serif; cursor: pointer; white-space: nowrap;
z-index: 1500; }
.turnierleiste { position: absolute; left: calc(var(--b) * 1.5); top: calc(var(--h) * 4.5); color: #9ab; font-size: calc(var(--h) * 1.9); }
.guthaben { position: absolute; right: calc(var(--b) * 8); top: calc(var(--h) * 1.6); color: #99a; font-size: calc(var(--h) * 2.1); }
.guthaben b { color: #f5c542; }
/* Profil-Dialog: Fläche in Anteilen des Fensters (profilAnordnen), alles darin in Anteilen der Fläche */
.kompakt { background: #17181d; border: 1px solid #333; border-radius: calc(var(--b) * 1.2); padding: calc(var(--h) * 1) calc(var(--b) * 1.2);
font-size: calc(var(--h) * 1.9);
pointer-events: none; z-index: 900; white-space: nowrap; }
.kompakt[hidden] { display: none; }
.kompakt b { color: #2e86f5; margin-right: calc(var(--b) * .7); }
.profil-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.68); z-index: 1000; display: none; }
.profil { position: absolute; container-type: inline-size; background: #17181d; border-radius: 3.2cqw;
overflow: hidden; color: #e8e8ea; font-family: Roboto, Arial, sans-serif; user-select: none; }
.profil > * { position: absolute; box-sizing: border-box; }
.p-kopf { left: 0; top: 0; width: 100%; height: 10.1%; border-bottom:.3cqw solid #b3261e;
background: linear-gradient(#141010 0%, #2a1212 55%, #5e1a14 100%); }
.p-titel { left: 0; top: 0; width: 100%; height: 10.1%; display: flex; align-items: center; justify-content: center;
font-size: 5.2cqw; font-weight: 700; color: #fff; }
.p-info { left: 6.5%; top: 5%; transform: translate(-50%, -50%); width: 5.2cqw; height: 5.2cqw; border:.35cqw solid #e8e8ea;
border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 3.2cqw; font-weight: 700; }
.profil-kreuz { left: 93.4%; top: 4.96%; transform: translate(-50%, -50%); font-size: 6cqw; line-height: 1;
color: #e7625b; cursor: pointer; padding: 1cqw; }
.p-person { left: 0; top: 10.1%; width: 100%; height: 14%; background: #1d1e24; }
.p-avatar { left: 3.7%; top: 12.4%; width: 13.3%; aspect-ratio: 1; border-radius: 50%; border:.5cqw solid #6b5b73;
background: radial-gradient(circle at 50% 35%, #8a7a92, #3b3342); }
.p-name { left: 19.5%; top: 16.6%; transform: translateY(-50%); font-size: 4.2cqw; font-weight: 500; white-space: nowrap; }
.p-telefon { left: 90%; top: 16.6%; transform: translate(-50%, -50%); width: 6cqw; height: 6cqw; border-radius: 1cqw;
background: #2a2b31; display: flex; align-items: center; justify-content: center; font-size: 3.4cqw; color: #bbb; }
.p-tabs { left: 0; top: 24.2%; width: 100%; height: 6.2%; display: flex; background: #0e0e11; }
.p-tab { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 3.4cqw; color: #9a9a9f;
border-bottom:.5cqw solid transparent; cursor: pointer; }
.p-tab.an { background: #1d1e24; color: #fff; border-bottom-color: #d4202c; }
.p-lifetime { left: 3.6%; top: 31.9%; width: 21.7%; height: 5.3%; background: #202127; border-radius: 1cqw;
display: flex; align-items: center; padding-left: 1.8cqw; font-size: 3.2cqw; gap: 1.6cqw; }
.p-power { left: 63%; top: 31.5%; font-size: 2.2cqw; color: #aaa; line-height: 1.15; }
.p-power b { display: block; font-size: 3.6cqw; color: #eee; font-weight: 500; }
.p-zeile { left: 3%; width: 94%; height: 1px; background: #2a2b31; }
.p-kennzahl { width: 21%; transform: translateX(-50%); text-align: center; }
.p-kennzahl.z { font-size: 3.9cqw; font-weight: 500; }
.p-kennzahl.l { font-size: 3.1cqw; color: #9a9a9f; margin-top: 1.2cqw; }
.p-wtsd { left: 0; top: 66%; width: 100%; height: 8%; }
.p-wtsd > * { position: absolute; }
.p-balken { left: 20.8%; top: 69.5%; width: 59.1%; height: 1.2%; background: #1d2230; border-radius: 1cqw; overflow: hidden; }
.p-balken i { position: absolute; top: 0; bottom: 0; left: 0; background: #2e86f5; }
.p-balken u { position: absolute; top: 0; bottom: 0; background: #ee8f35; text-decoration: none; }
.p-notiz { left: 3.4%; top: 75.7%; width: 71.9%; height: 22.3%; background: #1d1e24; border-radius: 1cqw; }
.p-notiz textarea { position: absolute; left: 0; top: 0; width: 100%; height: 66%; background: transparent; border: 0;
color: #eee; font: 3.2cqw Roboto, Arial, sans-serif; padding: 2.5cqw 3cqw; resize: none; outline: 0; }
.p-zaehler { left: 6%; top: 94.3%; transform: translateY(-50%); font-size: 3.4cqw; color: #8d8d92; }
.p-save { left: 54.7%; top: 92%; width: 18.6%; height: 4.6%; background: #c8201c; color: #fff; border: 0; border-radius:.7cqw;
font: 600 3.8cqw Roboto, Arial, sans-serif; cursor: pointer; }
/* Trefferfläche des Kreuzes reicht nach unten: im Klon klickt der Läufer Anteile des Viewports, die Seite setzt
Anteile des Fensterrahmens samt Titelleiste (rund 30 px Unterschied oben) */
.profil-kreuz::before { content: ""; position: absolute; left: -2cqw; right: -2cqw; top: -2cqw; bottom: -9cqw; }
.p-farbe { width: 6.4cqw; height: 6.4cqw; border-radius: 50%; transform: translate(-50%, -50%); cursor: pointer; border:.5cqw solid transparent; }
.p-farbe.an { border-color: #fff; }
.p-powered,.p-power { pointer-events: none; }
</style>
</head>
<body>
<div class="filz"></div>
<div class="handnr" id="handnr"></div>
<div class="turnierleiste" id="turnier" hidden></div>
<div class="guthaben">Balance <b id="guthaben"></b></div>
<div id="plaetze"></div>
<div id="einsaetze"></div>
<div class="stelle uhr" id="uhr" hidden></div>
<div class="stelle pot" data-fx="0.5" data-fy="0.381" hidden><b>Pot</b> <span id="pot"></span></div>
<div class="stelle karten" id="board" data-fx="0.5" data-fy="0.471"></div>
<div class="stelle" id="eigene" data-fx="0.5" data-fy="0.79"><div class="karten"></div></div>
<div class="aktionsleiste" id="leiste"></div>
<button class="stelle menueknopf" id="menue" data-fx="0.032" data-fy="0.881" hidden>•••</button>
<button class="stelle menueintrag" id="sitout_next" data-fx="0.110" data-fy="0.768" hidden>Sit Out Next Hand</button>
<button class="stelle menueintrag" id="sitout" data-fx="0.110" data-fy="0.798" hidden>Sit Out All</button>
<button class="stelle sitoutknopf" id="joinnow" hidden>Join Now</button>
<div class="stelle spielkreuz" id="spielkreuz" role="button" data-fx="0.972" data-fy="0.024" data-min-top="0.0223" style="z-index:2000">×</div>
<!-- Spielerprofil: dunkler Grund über dem ganzen Fenster, die Fläche darin wie im Bild des Clients -->
<div class="profil-backdrop" id="profil">
<div class="profil" id="profilfeld">
<div class="p-kopf"></div>
<div class="p-titel">Profile</div>
<div class="p-info">i</div>
<div class="profil-kreuz" id="profilkreuz" role="button" aria-label="close">✕</div>
<div class="p-person"></div>
<div class="p-avatar"></div>
<div class="p-name" id="p-name"></div>
<div class="p-telefon">▯</div>
<div class="p-tabs"><div class="p-tab an" data-tab="stats">Game Stats</div><div class="p-tab" data-tab="beat">Bad Beat Counter</div></div>
<div class="p-lifetime">Lifetime <span>▾</span></div>
<div class="p-power">Powered By<b>PokerIntel &#8250;</b></div>
<div class="p-kennzahl" style="left:12.9%;top:41.2%"><div class="z" id="s-vpip"></div><div class="l">VPIP</div></div>
<div class="p-kennzahl" style="left:36.2%;top:41.2%"><div class="z" id="s-pfr"></div><div class="l">PFR</div></div>
<div class="p-kennzahl" style="left:59.6%;top:41.2%"><div class="z" id="s-threeBet"></div><div class="l">3-BET</div></div>
<div class="p-kennzahl" style="left:83.1%;top:41.2%"><div class="z" id="s-foldToThreeBet"></div><div class="l">Fold to 3-Bet</div></div>
<div class="p-zeile" style="top:51.2%"></div>
<div class="p-kennzahl" style="left:12.9%;top:53.2%"><div class="z" id="s-cbet"></div><div class="l">C-BET</div></div>
<div class="p-kennzahl" style="left:36.2%;top:53.2%"><div class="z" id="s-foldToCbet"></div><div class="l">Fold to C-Bet</div></div>
<div class="p-kennzahl" style="left:59.6%;top:53.2%"><div class="z" id="s-steal"></div><div class="l">Steal</div></div>
<div class="p-kennzahl" style="left:83.1%;top:53.2%"><div class="z" id="s-checkRaise"></div><div class="l">Check/Raise</div></div>
<div class="p-zeile" style="top:63.3%"></div>
<div class="p-wtsd">
<div style="left:5.9%;top:50%;color:#ee8f35;font-size:3.4cqw;transform:translateY(-10%)">WTSD ⓘ</div>
<div id="s-wtsd" style="left:20.8%;top:8%;color:#2e86f5;font-size:3.4cqw"></div>
<div id="s-wsd" style="left:76%;top:8%;color:#2e86f5;font-size:3.4cqw"></div>
<div style="left:84%;top:50%;color:#2e86f5;font-size:3.4cqw;transform:translateY(-10%)">WSD ⓘ</div>
</div>
<div class="p-balken"><i id="b-wtsd"></i><u id="b-wsd"></u></div>
<div class="p-notiz"><textarea id="p-notiz" maxlength="250" placeholder="Take player note here..."></textarea></div>
<div class="p-zaehler" id="p-zaehler">0/250</div>
<button class="p-save" id="p-save">Save</button>
<div class="p-farbe" data-farbe="" style="left:82.5%;top:78%;border:.5cqw solid #fff;background:transparent">⌀</div>
<div class="p-farbe" data-farbe="red" style="left:91.6%;top:78%;background:#e0373a"></div>
<div class="p-farbe" data-farbe="yellow" style="left:82.5%;top:83.9%;background:#e5e51b"></div>
<div class="p-farbe" data-farbe="blue" style="left:91.6%;top:83.9%;background:#1a63c6"></div>
<div class="p-farbe" data-farbe="pink" style="left:82.5%;top:89.8%;background:#cc2b8e"></div>
<div class="p-farbe" data-farbe="teal" style="left:91.6%;top:89.8%;background:#18bcb3"></div>
<div class="p-farbe" data-farbe="orange" style="left:82.5%;top:95.7%;background:#fa7c1b"></div>
<div class="p-farbe" data-farbe="green" style="left:91.6%;top:95.7%;background:#10b050"></div>
</div>
</div>
<!-- kompaktes Profil (nur --profil-): klein, neben dem Schild, nimmt keine Klicks -->
<div class="stelle kompakt" id="kompakt" hidden></div>
<div class="dialog-backdrop"></div>
<div class="sfs-buy-in-modal">
<div class="sfs-buy-in-modal-container" data-fx="0.5" data-fy="0.51"></div>
<div class="sfs-buy-in-header">
<h2 class="sfs-buy-in-heading" data-fx="0.5" data-fy="0.17">Buy-In</h2>
<div class="common-dialog-cross-icon" role="button" aria-label="close" data-fx="0.674" data-fy="0.151">×</div>
</div>
<div class="sfs-buy-in-header-game-info" data-fx="0.5" data-fy="0.215">{{TITEL}}</div>
<div class="sfs-buy-in-balance-container" data-fx="0.43" data-fy="0.261">
<div class="sfs-buy-in-balance-label">Balance</div>
<div class="sfs-buy-in-user-balance"></div>
</div>
<button class="sfs-buy-in-modal-header-button" data-fx="0.613" data-fy="0.261" hidden>Claim Chips</button>
<div class="sfs-buy-in-body">
<div class="sfs-buy-in-body-container-text" data-fx="0.5" data-fy="0.34" hidden></div>
<input class="sfs-slider-range-value" data-fx="0.5" data-fy="0.45" inputmode="numeric">
<div class="sfs-buy-in-body-range-buttons">
<button class="sfs-buy-in-body-min-range" data-fx="0.377" data-fy="0.611">Min</button>
<button class="sfs-buy-in-body-mid-range" data-fx="0.500" data-fy="0.611">Mid</button>
<button class="sfs-buy-in-body-max-range" data-fx="0.624" data-fy="0.611">Max</button>
</div>
<div class="sfs-buy-in-body-error" data-fx="0.5" data-fy="0.70"></div>
</div>
<div class="sfs-buy-in-modal-button-container">
<button class="sfs-buy-in-modal-button" data-fx="0.500" data-fy="0.847">Buy-In</button>
</div>
</div>
<script>
const RAUM = "{{RAUM}}";
// Stelle des + je freiem Platz (Anteil des Fensterrahmens), Nummern der Seite. Wie hand/sitzen.py PLUS.
const PLUS = {1: [0.140, 0.235], 2: [0.485, 0.185], 3: [0.868, 0.239],
4: [0.868, 0.622], 5: [0.497, 0.787], 6: [0.107, 0.61]};
// Sitzschilder (Name, Chips, Einsatz, Uhr): nicht neu vermessen, die Schätzungen von früher.
const SCHILD = {1: [0.14, 0.24], 2: [0.50, 0.20], 3: [0.86, 0.27],
4: [0.88, 0.66], 5: [0.50, 0.84], 6: [0.12, 0.64]};
// So steht das Schild (Mitte der Namensplatte) im Bild des Clients (mock/vorlage/bild-tisch-im-spiel.png,
// abgelesen, Anteile des Rahmens). SCHILD oben bleibt das Trefferfeld fuer Hover und Profil (Mitte von
// Avatar und Platte, wie hand/sitzen.py); die Platte liegt im Feld (Spec tischlayout_spec.py).
const PLATTE = {1: [0.138, 0.318], 2: [0.500, 0.237], 3: [0.862, 0.318],
4: [0.881, 0.712], 5: [0.500, 0.890], 6: [0.118, 0.714]};
// Wo der Einsatz vor dem Platz liegt (Bild): 1, 4, 5 abgelesen, 3 und 6 gespiegelt, 2 (oben) nicht gemessen.
const UHR_ABSTAND = 0.105;
// Dealer-Knopf: Versatz von der Mitte der Platte (Anteile des Rahmens). 2 und 3 am Bild abgelesen, 1 gespiegelt zu 3,
// 4, 5, 6 geschaetzt (zur Tischmitte hin).
const GEBER = {1: [0.085, 0.075], 2: [0.082, 0.020], 3: [-0.085, 0.075],
4: [-0.090, -0.080], 5: [0.095, -0.100], 6: [0.090, -0.080]};
const EINSATZ = {1: [0.266, 0.357], 2: [0.500, 0.330], 3: [0.734, 0.357],
4: [0.755, 0.659], 5: [0.586, 0.695], 6: [0.245, 0.659]};
// Sit Out / I'm Back: im Klon ein Menue wie am Tisch (die Stellen stehen als data-fx/fy an
// den Knoepfen - 0.032/0.881 Menue, 0.110/0.798 "Sit Out All", 31.10. gemessen).
let MENUE_AUF = false;
// Zurueck aus dem Sitout: "Join Now", am lebenden Tisch gemessen (hand/sitzen.py ZURUECK)
const JOIN_NOW = [0.913, 0.971];
const START = new URLSearchParams(location.search);
const PROFIL_ZWEISTUFIG = "{{PROFIL_ZWEISTUFIG}}" === "1";
const HEADLESS = "{{HEADLESS}}" === "1"; // ohne Fensterrahmen: Stellen als Anteil des Viewports
window.name = "tisch-" + RAUM.split(" ").pop(); // das Fenster heisst nach seinem Tisch
// Die drei Zustände der Aktionsleiste (README; "vorab" wie in bild-tisch-im-spiel.png)
const LEISTE = {
zug: z => [["Fold", 0.66, 0.94, "gross fold", "fold"],
[z.call ? "Call " + z.call: "Check", 0.80, 0.94, "gross call", "call"],
["Raise" + (z.raise ? " " + z.raise: ""), 0.93, 0.94, "gross raise", "raise"],
["33%", 0.616, 0.86, "klein", "v33"], ["50%", 0.677, 0.86, "klein", "v50"],
["75%", 0.735, 0.86, "klein", "v75"], ["Max", 0.784, 0.86, "klein", "vmax"]],
vorab: z => [["✓ Call Any", 0.79, 0.876, "gross", "callany"],
["✓ X/F", 0.66, 0.95, "gross", "xf"],
["✓ Call" + (vorabCall(z) ? "\n" + betrag(vorabCall(z)) : ""), 0.80, 0.95, "gross", "vcall"]],
voll: () => [["Find Seat", 0.902, 0.951, "gross", "findseat"],
["Join Wait List", 0.720, 0.951, "gross", "waitlist"]],
keine: () => [],
};
const FARBE = {HEARTS: "♥", DIAMONDS: "♦", CLUBS: "♣", SPADES: "♠"};
const WERT = {TWO: "2", THREE: "3", FOUR: "4", FIVE: "5", SIX: "6", SEVEN: "7", EIGHT: "8",
NINE: "9", TEN: "10", JACK: "J", QUEEN: "Q", KING: "K", ACE: "A"};
let zustand = null, leisteSchluessel = "", vorab = new Set();
// Was ein Call jetzt kostete (Vorab-Knopf, Bild: "Call / 77,680"): hoechster Einsatz minus der eigene,
// hoechstens der eigene Stack. ANNAHME: so rechnet der Client; im Bild ist es der All-in-Call.
function vorabCall(z) {
const zahl = v => typeof v === "number" ? v : 0;
const ich = (z.sitze || []).find(s => s.nr === z.held_sitz);
if (!ich) return 0;
const hoechster = Math.max(0, ...z.sitze.map(s => zahl(s.einsatz)));
return Math.max(0, Math.min(hoechster - zahl(ich.einsatz), zahl(ich.chips)));
}
// --- Maus ----------------------------------------------------------------------------------------
// Wo die Seite die Maus zuletzt sah (Pixel des Viewports) - nur fuer das Hover-Profil unten.
const maus = {x: null, y: null};
addEventListener("mousemove", e => { maus.x = e.clientX; maus.y = e.clientY; hoverPruefen(); }, true);
// --- Profil: Hover auf ein Sitzschild ------------------------------------------------------------
// Ruht die Maus >= HOVER_S ununterbrochen über einem besetzten Sitzschild (Mitte +- SCHILD_HALB, Anteile des
// Fensters), öffnet das Profil dieses Spielers. Nach dem Öffnen gilt der Platz als "gesehen": erst wenn der
// Maus ihn verlassen hat, kann er wieder öffnen (der Client öffnet beim Hineinfahren).
const SCHILD_HALB = [0.075, 0.10], HOVER_S = 0.6;
let hoverSitz = null, hoverSeit = 0, hoverTimer = null, hoverGesperrt = null, kompaktZu = false;
function schildUnter(x, y) {
if (!zustand) return null;
const r = rahmen(), fx = (x + r.rand) / r.w, fy = (y + r.oben) / r.h;
for (const s of zustand.sitze) {
if (!s.name || !SCHILD[s.nr]) continue;
const m = SCHILD[s.nr];
if (Math.abs(fx - m[0]) <= SCHILD_HALB[0] && Math.abs(fy - m[1]) <= SCHILD_HALB[1]) return s.nr;
}
return null;
}
function hoverPruefen() {
clearTimeout(hoverTimer); hoverTimer = null;
if (maus.x === null) return;
const nr = schildUnter(maus.x, maus.y);
if (nr !== hoverGesperrt) hoverGesperrt = null; // Platz verlassen: wieder frei
if (PROFIL_ZWEISTUFIG && zustand && zustand.dialog === "profil_kompakt" && zustand.profil
&& nr !== zustand.profil.sitz && !kompaktZu) { // das kompakte geht mit der Maus
kompaktZu = true;
senden("/api/profil", {zu: true}).then(() => { kompaktZu = false; laden(); });
}
const blockiert = dialogOffen() || (typeof modal !== "undefined" && modal.style.display === "block");
const ziel = blockiert || nr === null || nr === hoverGesperrt ? null: nr;
if (ziel !== hoverSitz) { hoverSitz = ziel; hoverSeit = Date.now(); }
if (hoverSitz === null) return;
const rest = hoverSeit + HOVER_S * 1000 - Date.now();
if (rest > 0) { hoverTimer = setTimeout(hoverPruefen, rest + 5); return; }
hoverGesperrt = hoverSitz;
const sitz = hoverSitz; hoverSitz = null;
profilOeffnen(sitz);
}
async function profilOeffnen(sitz, art = "hover") {
const r = await senden("/api/profil", {sitz, art});
if (r.ok) laden();
}
// Der Fensterrahmen aus den Massen des Fensters (rein): headless ist die Seite der Rahmen; sonst der
// Rahmen aussen (outerWidth/outerHeight), Rand links, rechts und unten gleich, der Rest oben ist die Titelleiste.
function rahmenAus(headless, aussenB, aussenH, innenB, innenH) {
if (headless) return {w: innenB, h: innenH, rand: 0, oben: 0};
const w = aussenB || innenB, h = aussenH || innenH;
const rand = Math.max(0, (w - innenB) / 2);
return {w, h, rand, oben: Math.max(0, h - innenH - rand)};
}
function rahmen() { return rahmenAus(HEADLESS, outerWidth, outerHeight, innerWidth, innerHeight); }
window.__rahmen = () => rahmen(); // hand/tischklick.py rechnet Klickpunkte mit demselben Rahmen
function masseSetzen(r) { // die Masse des CSS (--b, --h) sind Anteile dieses Rahmens
const s = document.documentElement.style;
s.setProperty("--fw", r.w + "px"); s.setProperty("--fh", r.h + "px");
s.setProperty("--rand", r.rand + "px"); s.setProperty("--oben", r.oben + "px");
}
function setzeStelle(el, fx, fy, r = rahmen()) {
el.style.left = (fx * r.w - r.rand) + "px";
let oben = fy * r.h - r.oben;
if (el.dataset.minTop) oben = Math.max(oben, +el.dataset.minTop * innerHeight); // nie über den Seitenrand hinaus
el.style.top = oben + "px";
}
function anordnen(r = rahmen()) {
masseSetzen(r);
for (const el of document.querySelectorAll("[data-fx]")) setzeStelle(el, +el.dataset.fx, +el.dataset.fy, r);
profilAnordnen(r);
}
masseSetzen(rahmen()); // vor dem ersten Zeichnen: die Masse stehen
function karte(k) {
const d = document.createElement("div");
d.className = "karte" + (k.suit === "HEARTS" || k.suit === "DIAMONDS" ? " rot": "");
const farbe = FARBE[k.suit] || "?";
d.dataset.f = farbe; // die grosse Farbe unten rechts malt das CSS (::after) aus data-f
d.innerHTML = "<b></b><i></i>";
d.querySelector("b").textContent = WERT[k.value] || "?";
d.querySelector("i").textContent = farbe; // textContent der Karte bleibt "Wert+Farbe"
return d;
}
async function senden(pfad, daten) {
const r = await fetch(pfad, {method: "POST", body: JSON.stringify(Object.assign({room: RAUM}, daten))});
return r.json();
}
function plaetzeZeichnen() {
const box = document.getElementById("plaetze"), einsaetze = document.getElementById("einsaetze");
box.textContent = ""; einsaetze.textContent = "";
for (const s of zustand.sitze) {
let el;
if (s.name) {
el = document.createElement("div");
el.className = "stelle platz" + (s.nr === zustand.held_sitz ? " held": "")
+ (zustand.uhr && zustand.uhr.sitz === s.nr ? " dran": "")
+ (s.aktion === "Fold" ? " gefoldet": "");
// Gegnerkarten (Rueckseiten) nur in einer laufenden Hand, bei Gegnern, die weder gefoldet haben noch aussitzen
const imSpiel = zustand.pot !== null && s.nr !== zustand.held_sitz && !/fold|sitting/i.test(s.aktion || "");
el.innerHTML = '<div class="avatar"></div>' + (imSpiel ? '<div class="rueck"></div><div class="rueck"></div>': "")
+ '<div class="name"><div></div><div class="chips"></div></div><div class="aktion"></div>';
el.dataset.nr = s.nr;
el.querySelector(".name div").textContent = s.name;
el.querySelector(".chips").textContent = betrag(s.chips);
el.querySelector(".aktion").textContent = s.aktion || "";
el.querySelector(".aktion").dataset.a = (s.aktion || "").toLowerCase().replace(/[^a-z]/g, ""); // Farbe der Etikette
if (s.einsatz) { // Einsatz liegt zwischen Platz und Mitte
const e = document.createElement("div");
e.className = "stelle einsatz"; e.textContent = betrag(s.einsatz);
e.dataset.fx = EINSATZ[s.nr][0]; e.dataset.fy = EINSATZ[s.nr][1];
einsaetze.appendChild(e);
}
if (s.nr === zustand.held_sitz && zustand.buyin.nachkauf_max > 0) { // Nachkauf: + an der Stelle des freien +
const n = document.createElement("button");
n.className = "stelle nachkauf"; n.textContent = "+";
n.dataset.fx = PLUS[s.nr][0]; n.dataset.fy = PLUS[s.nr][1];
n.addEventListener("click", () => { if (!dialogOffen()) nachkaufOeffnen(); });
box.appendChild(n);
}
if (PROFIL_ZWEISTUFIG && s.nr !== zustand.held_sitz) // Klick aufs fremde Schild: das grosse Profil
el.addEventListener("click", () => { if (!dialogOffen()) profilOeffnen(s.nr, "klick"); });
} else if (zustand.held_sitz === null) {
el = document.createElement("button"); // ohne Hülle: der Text gehört dem Knopf
el.className = "stelle platz-frei"; el.textContent = "+"; el.dataset.nr = s.nr;
el.addEventListener("click", () => { if (!dialogOffen()) platzWaehlen(s.nr); });
} else continue;
const stelle = s.name ? PLATTE[s.nr]: PLUS[s.nr];
el.dataset.fx = stelle[0]; el.dataset.fy = stelle[1];
box.appendChild(el);
}
const geber = zustand.geber, sitzt = geber && zustand.sitze.some(s => s.nr === geber && s.name);
if (sitzt) { // Dealer-Knopf neben der Platte des Gebers, zur Mitte hin
const d = document.createElement("div");
d.className = "stelle geber"; d.textContent = "D";
d.dataset.fx = PLATTE[geber][0] + GEBER[geber][0]; d.dataset.fy = PLATTE[geber][1] + GEBER[geber][1];
box.appendChild(d);
}
}
function leisteZeichnen() {
const box = document.getElementById("leiste");
const knoepfe = LEISTE[zustand.leiste](zustand);
const schluessel = zustand.leiste + JSON.stringify(knoepfe.map(k => k[0]));
if (schluessel === leisteSchluessel) return;
leisteSchluessel = schluessel;
box.textContent = "";
for (const [text, fx, fy, art, name] of knoepfe) {
const b = document.createElement("button");
if (text.startsWith("✓ ")) { // der Haken ist ein eigenes Zeichen (grau, angehakt gruen); der Text bleibt gleich
const h = document.createElement("span"), t = document.createElement("span");
h.className = "haken"; h.textContent = "✓";
const [zeile, betragZeile] = text.slice(1).split("\n");
t.className = "text"; t.append(document.createTextNode(zeile));
if (betragZeile) { const s = document.createElement("small"); s.textContent = betragZeile; t.append(s); }
b.append(h, t);
} else b.textContent = text;
b.className = art; b.dataset.fx = fx; b.dataset.fy = fy;
if (vorab.has(name)) b.classList.add("an");
b.addEventListener("click", () => klick(name, b));
box.appendChild(b);
}
if (zustand.leiste === "zug") {
const f = document.createElement("input");
f.className = "betrag"; f.dataset.fx = 0.873; f.dataset.fy = 0.855; f.value = zustand.raise || "";
box.appendChild(f);
}
}
function klick(name, knopf) {
if (dialogOffen()) return; // ein offener Dialog schluckt alles darunter (auch per Skript)
if (name === "findseat") { findSeat(); return; }
if (name === "waitlist") return; // der untere Knopf "Join Wait List" tut nichts; erst Find Seat öffnet den Dialog
if (["fold", "call", "raise"].includes(name)) { senden("/api/aktion", {aktion: name}); return; }
if (name.startsWith("v") && zustand.leiste === "zug") {
const f = document.querySelector(".betrag");
if (f) f.value = name === "vmax" ? "Max": name.slice(1) + "%";
return;
}
if (zustand.leiste === "vorab") { // Vorauswahl: nur Haken umschalten, wie im Client
vorab.has(name) ? vorab.delete(name): vorab.add(name);
knopf.classList.toggle("an");
}
}
// Find Seat am vollen Tisch: bleibt am Tisch und öffnet den Wartelisten-Dialog (Betrag Min).
async function findSeat() {
const r = await senden("/api/findseat", {});
if (r.ok) { modus = "warteliste"; dialogOeffnen("Buy-In"); }
}
function zeichnen() {
plaetzeZeichnen();
leisteZeichnen();
const board = document.getElementById("board");
board.textContent = "";
for (const k of zustand.board) board.appendChild(karte(k));
const eigene = document.querySelector("#eigene .karten");
eigene.textContent = "";
for (const k of zustand.karten) eigene.appendChild(karte(k));
const so = document.getElementById("sitout");
const mn = document.getElementById("menue");
mn.hidden = zustand.held_sitz === null;
so.hidden = zustand.held_sitz === null || !MENUE_AUF;
document.getElementById("sitout_next").hidden = so.hidden;
so.textContent = zustand.sitout ? "I'm Back": "Sit Out All";
const jn = document.getElementById("joinnow");
jn.hidden = zustand.held_sitz === null || !zustand.sitout;
jn.dataset.fx = JOIN_NOW[0]; jn.dataset.fy = JOIN_NOW[1];
document.querySelector(".pot").hidden = zustand.pot === null;
document.getElementById("pot").textContent = betrag(zustand.pot);
const tl = document.getElementById("turnier"), tu = zustand.turnier;
tl.hidden = !tu; // Turnier-Modus: Level, Blinds, Ante, Feld
if (tu) tl.textContent = (zustand.aus ? "Busted, Platz " + tu.platz + " - ": "") + "Level " + tu.level + " "
+ tu.sb + "/" + tu.bb + " ante " + tu.ante + " - " + tu.feld + "/" + tu.gesamt + " (bezahlt " + tu.bezahlt + ")";
document.getElementById("handnr").textContent = zustand.hand ? "Hand #" + zustand.hand: "";
document.getElementById("guthaben").textContent = zahl(zustand.buyin.konto);
const uhr = document.getElementById("uhr");
uhr.hidden = !(zustand.uhr && zustand.uhr.sitz);
if (!uhr.hidden) { // über dem Namen dessen, der dran ist
const pl = PLATTE[zustand.uhr.sitz]; // neben der Platte, zur Mitte hin
uhr.dataset.fx = pl[0] + (pl[0] < 0.5 ? UHR_ABSTAND: -UHR_ABSTAND); uhr.dataset.fy = pl[1];
}
uhrTicken();
profilZeichnen();
anordnen();
}
function uhrTicken() { // die Uhr läuft zwischen zwei Abfragen weiter
const u = zustand && zustand.uhr, el = document.getElementById("uhr");
if (!u || el.hidden) return;
const uebrig = Math.max(0, u.frist - (Date.now() / 1000 - u.start) * u.faktor), rest = Math.ceil(uebrig);
el.textContent = rest;
el.classList.toggle("knapp", rest <= 5);
const dran = document.querySelector(".platz.dran"); // der Zeitbalken unter der Platte laeuft leer
if (dran) dran.style.setProperty("--rest", u.frist > 0 ? Math.min(1, uebrig / u.frist): 1);
}
async function laden() {
try {
const neu = await (await fetch("/api/zustand?room=" + encodeURIComponent(RAUM))).json();
if (JSON.stringify(neu) !== JSON.stringify(zustand)) { zustand = neu; zeichnen(); }
if (zustand.wechsel) { location.href = "/table.html?room=" + encodeURIComponent(zustand.wechsel); return; } // Tischwechsel
const an = zustand.angebot; // Warteliste: Platz frei geworden und für uns reserviert
if (an && an.nr !== angebotNr) { angebotNr = an.nr; buyinOeffnen(an.sitz); }
if (START.get("sitz")) { const nr = +START.get("sitz"); START.delete("sitz"); platzWaehlen(nr); }
} catch (e) { /* Server weg */ }
}
// --- Buy-in ---------------------------------------------------------------
const modal = document.querySelector(".sfs-buy-in-modal");
const feld = document.querySelector(".sfs-slider-range-value");
const fehler = document.querySelector(".sfs-buy-in-body-error");
let gewaehlt = null, modus = "sitzen", angebotNr = null; // modus: sitzen | warteliste | nachkauf
const zahl = n => Number(n).toLocaleString("en-US");
// Betraege am Tisch wie der Client (bild-tisch-im-spiel.png): "77,680", ab einer Million "1.97M".
// ANNAHME: zwei Nachkommastellen, Nullen weg ("1M"). Text (schon formatiert) bleibt, wie er ist.
const betrag = n => typeof n !== "number" ? (n ?? "")
: n >= 1e6 ? (n / 1e6).toFixed(2).replace(/\.?0+$/, "") + "M" : zahl(n);
const stackInfo = document.querySelector(".sfs-buy-in-body-container-text");
const claim = document.querySelector(".sfs-buy-in-modal-header-button");
const bestaetigen = document.querySelector(".sfs-buy-in-modal-button");
// Grenzen des Dialogs: beim Hinsetzen und auf der Warteliste Min/Max des Tischs, beim Nachkauf bis zur Obergrenze
function grenzen() {
const b = zustand.buyin;
if (modus !== "nachkauf") return {min: b.min, max: Math.min(b.max, b.konto)};
const max = Math.min(b.nachkauf_max, b.konto);
return {min: Math.min(b.bb, max), max};
}
// Vorbelegung beim Öffnen (am Tisch beobachtet): freier Platz Max, Warteliste Min; Nachkauf Min (Klon-Annahme)
function voreinstellung() {
return modus === "sitzen" ? grenzen().max: grenzen().min;
}
// Für Werkzeuge, die per Bildschirm klicken: Mitte eines Elements als Anteil des Fensterrahmens
window.stelleVon = sel => {
const el = document.querySelector(sel), r = rahmen();
if (!el || !el.offsetParent) return null;
const k = el.getBoundingClientRect();
return [(k.left + k.width / 2 + r.rand) / r.w, (k.top + k.height / 2 + r.oben) / r.h];
};
function buyinOeffnen(nr) {
gewaehlt = nr; modus = "sitzen";
dialogOeffnen("Buy-In");
}
// Klick auf ein freies +: der Platz wird reserviert (game.reserve_Seat), dann öffnet der Dialog
async function platzWaehlen(nr) {
await senden("/api/reservieren", {sitz: nr});
buyinOeffnen(nr);
}
function nachkaufOeffnen() {
modus = "nachkauf";
dialogOeffnen("Add Chips");
}
function dialogOeffnen(titel) {
const b = zustand.buyin;
document.querySelector(".sfs-buy-in-heading").textContent = titel;
document.querySelector(".sfs-buy-in-user-balance").textContent = zahl(b.konto);
stackInfo.hidden = modus !== "nachkauf";
stackInfo.textContent = "Stack " + zahl(b.stack ?? 0) + " · bis " + zahl(b.max);
claim.hidden = !b.claim_offen; // "Claim Chips" nur, solange die Chips offen sind (jeder Dialog)
bestaetigen.textContent = modus === "warteliste" ? "Join Wait List": "Buy-In";
feld.value = zahl(voreinstellung());
fehler.textContent = "";
modal.style.display = "block";
document.querySelector(".dialog-backdrop").style.display = "block";
anordnen();
}
function buyinSchliessen() {
modal.style.display = "none";
document.querySelector(".dialog-backdrop").style.display = "none";
}
document.querySelector(".sfs-buy-in-body-min-range").addEventListener("click", () => feld.value = zahl(grenzen().min));
document.querySelector(".sfs-buy-in-body-max-range").addEventListener("click", () => feld.value = zahl(grenzen().max));
document.querySelector(".sfs-buy-in-body-mid-range").addEventListener("click", () => {
const g = grenzen();
feld.value = zahl(Math.round((g.min + g.max) / 2));
});
claim.addEventListener("click", async () => {
const r = await senden("/api/claim", {});
if (!r.ok) return;
await laden();
document.querySelector(".sfs-buy-in-user-balance").textContent = zahl(zustand.buyin.konto);
claim.hidden = true;
feld.value = zahl(voreinstellung());
});
document.querySelector(".common-dialog-cross-icon").addEventListener("click", buyinSchliessen);
bestaetigen.addEventListener("click", async () => {
let betrag = Number(feld.value.replace(/[^0-9.]/g, "")); // gekauft wird, was im Feld steht
if (modus === "nachkauf") betrag = Math.min(betrag, zustand.buyin.nachkauf_max); // höchstens bis Max
const r = modus === "sitzen" ? await senden("/api/sitzen", {sitz: gewaehlt, betrag})
: modus === "warteliste" ? await senden("/api/warteliste", {betrag})
: await senden("/api/nachkauf", {betrag});
if (r.ok) { buyinSchliessen(); laden(); } else fehler.textContent = r.fehler || "Platz nicht frei";
});
// Fensterkreuz des Spiels: das Tischfenster schliesst. Greift window.close() nicht (nicht per Skript
// geöffnet), schliesst der Server das Ziel per CDP.
document.getElementById("joinnow").addEventListener("click", () => {
if (dialogOffen()) return;
senden("/api/sitout", {an: false}).then(laden);
});
document.getElementById("menue").addEventListener("click", () => {
if (dialogOffen()) return;
MENUE_AUF = !MENUE_AUF;
zeichnen();
});
document.getElementById("sitout").addEventListener("click", () => {
if (dialogOffen()) return;
MENUE_AUF = false;
senden("/api/sitout", {an: !zustand.sitout}).then(laden);
});
document.getElementById("sitout_next").addEventListener("click", () => {
if (dialogOffen()) return;
MENUE_AUF = false;
senden("/api/sitout", {an: true}).then(laden);
});
// Am eigenen Platz steht das Kreuz erst vom Platz auf (leave_Seat, Guthaben zurück), dann schliesst es:
// /api/schliessen schreibt quit_table (wie der Client) und schliesst das Ziel per CDP.
document.getElementById("spielkreuz").addEventListener("click", async () => {
if (zustand && zustand.held_sitz !== null) await senden("/api/verlassen", {});
try { await senden("/api/schliessen", {}); } catch (e) { /* Seite schon zu */ }
window.close();
});
// --- Profil-Dialog ----------------------------------------------------------------------------
window.__dialog = null; // "profil" | "profil_kompakt" | null - nur Prüfhilfe, der Laeufer liest das nicht (kein DOM am Tisch)
const PROFIL_FLAECHE = [0.265, 0.068, 0.735, 0.975];
let profilNr = null, profilFarbe = "";
const dialogOffen = () => !!(zustand && zustand.dialog === "profil"); // nur das grosse schluckt Klicks
function profilAnordnen(r = rahmen()) {
const f = document.getElementById("profilfeld");
f.style.left = (PROFIL_FLAECHE[0] * r.w - r.rand) + "px";
f.style.top = (PROFIL_FLAECHE[1] * r.h - r.oben) + "px";
f.style.width = ((PROFIL_FLAECHE[2] - PROFIL_FLAECHE[0]) * r.w) + "px";
f.style.height = ((PROFIL_FLAECHE[3] - PROFIL_FLAECHE[1]) * r.h) + "px";
}
function kompaktZeichnen() {
const el = document.getElementById("kompakt");
const d = zustand && zustand.dialog === "profil_kompakt" ? zustand.profil: null;
el.hidden = !d;
if (!d) return;
const st = d.stats, m = SCHILD[d.sitz] || [0.5, 0.5];
el.innerHTML = `<div>${d.name}</div><b>VPIP ${st.vpip}%</b><b>PFR ${st.pfr}%</b><b>3-BET ${st.threeBet}%</b><b>C-BET ${st.cbet}%</b>`;
setzeStelle(el, m[0] + (0.5 - m[0]) * 0.35, Math.min(m[1] - 0.12, 0.70)); // über dem Schild, nie auf der Leiste
}
function profilZeichnen() {
kompaktZeichnen();
const d = zustand && zustand.dialog === "profil" ? zustand.profil: null;
window.__dialog = d ? "profil": (zustand && zustand.dialog) || null;
document.getElementById("profil").style.display = d ? "block": "none";
if (!d) { profilNr = null; return; }
if (profilNr !== d.nr) { // frisch geöffnet: Werte und leeres Notizfeld
profilNr = d.nr; profilFarbe = "";
document.getElementById("p-name").textContent = d.name;
const st = d.stats;
for (const k of ["vpip", "pfr", "threeBet", "foldToThreeBet", "cbet", "foldToCbet", "steal", "checkRaise"])
document.getElementById("s-" + k).textContent = st[k] + "%";
document.getElementById("s-wtsd").textContent = st.wtsd + "%";
document.getElementById("s-wsd").textContent = st.wsd + "%";
document.getElementById("b-wtsd").style.width = st.wtsd + "%";
const w = document.getElementById("b-wsd");
w.style.left = Math.max(0, st.wtsd - 10) + "%"; w.style.width = Math.min(20, 100 - Math.max(0, st.wtsd - 10)) + "%";
document.getElementById("p-notiz").value = ""; profilZaehler();
for (const f of document.querySelectorAll(".p-farbe")) f.classList.toggle("an", f.dataset.farbe === "");
}
profilAnordnen();
}
function profilZaehler() {
document.getElementById("p-zaehler").textContent = document.getElementById("p-notiz").value.length + "/250";
}
async function profilSchliessen() {
await senden("/api/profil", {zu: true});
await laden();
}
// der Backdrop schluckt jeden Klick: nichts darunter reagiert, auch ein Klick daneben schliesst nicht
document.getElementById("profil").addEventListener("click", e => e.stopPropagation());
document.getElementById("profilkreuz").addEventListener("click", profilSchliessen);
document.getElementById("p-notiz").addEventListener("input", profilZaehler);
document.getElementById("p-save").addEventListener("click", () => {
senden("/api/profil", {speichern: true, note: document.getElementById("p-notiz").value, farbe: profilFarbe});
});
for (const f of document.querySelectorAll(".p-farbe")) f.addEventListener("click", () => {
profilFarbe = f.dataset.farbe;
for (const g of document.querySelectorAll(".p-farbe")) g.classList.toggle("an", g === f);
});
// Escape: die Seite meldet nur, die Wirkung entscheidet der Server. Ob Escape am Client schliesst, ist
// nicht gemessen; das entscheidet der Schalter (esc_schliesst).
addEventListener("keydown", e => {
if ((e.keyCode !== undefined ? e.keyCode : e.which) === 27) senden("/api/taste", {taste: "escape"}).then(laden);
});
addEventListener("resize", () => anordnen());
laden();
setInterval(laden, 250);
setInterval(uhrTicken, 100);
</script>
</body>
</html>