Every text-[color:var(--ink)]/50, border-[color:var(--ink)]/10 and
bg-[color:var(--ink)]/5 in the templates compiled to nothing. Tailwind v3
cannot put an opacity on an arbitrary var() colour, so all 538 of them were
dropped from output.css without a word. Meta text rendered at full ink, card
borders fell back to Tailwind's default grey (bright white rings at night),
and the washes, backdrops and hover pills simply weren't there, on the news
site, the casino and the adventure pages alike.
The palette is now written once per phase and casino room as bare rgb
channels (--ink-rgb and friends), the plain vars are built from them, and
tailwind.config.js exposes ink, muted, accent, warn and card as real colours.
The classes are text-ink/80, border-ink/10, bg-accent/20 now, and they compile.
Restoring the intended opacities as-is would have traded flat for illegible:
ink at 50% measures 2.7 to 2.9:1 on the lit phases. So secondary text gets
its own colour, --muted, per phase and per casino room, taken as faint as it
can go while still clearing 4.5:1 on both the card and the page. Everything
that was ink at 35 to 70% is text-muted. The 20-30% ones are separators and
empty-cell dashes and stay faint.
The bg-theme-* chips carry white text everywhere they appear, and eight of
them measured 2.5 to 3.2:1. Same hues, taken just dark enough to pass (4.6 to
4.7:1). eu, lego and adventure already passed and are unchanged, and the
underline and border colours keep the old pastels since they carry no text.
Static files came out of the embedded FS with no Last-Modified, no ETag and
no Cache-Control, so every page view downloaded the stylesheet and every
script in full, and the service worker's "cheap 304" never happened. Each
file is hashed once now. Templates link through {{asset}}, which appends
?v=<hash>; a request naming the current hash is served immutable for a year,
and everything else gets the hash as its ETag and revalidates to a 304. The
service worker serves versioned URLs cache-first, drops older versions of the
same file as new ones land, and moves to cache v6.
119 lines
6.3 KiB
HTML
119 lines
6.3 KiB
HTML
{{define "layout"}}<!doctype html>
|
|
<html lang="en" data-room="{{.Room.Slug}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{block "title" .}}{{.Room.Name}}{{end}}</title>
|
|
<meta name="robots" content="noindex">
|
|
|
|
{{/* What the casino looks like when somebody pastes it into a chat window.
|
|
noindex keeps it out of a search engine and does not keep it out of a link
|
|
preview: those are two different bots and only one of them is reading this.
|
|
The image is drawn by games_og.go and follows the clock, so a link shared
|
|
after six unfurls with the neon on. */}}
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:site_name" content="{{.Room.Name}}">
|
|
<meta property="og:title" content="{{block "og_title" .}}{{.Room.Name}}{{end}}">
|
|
<meta property="og:description" content="{{block "og_desc" .}}Blackjack, hold'em, UNO, trivia, hangman and solitaire, played for real gogobee euros. Sign in and pull up a chair.{{end}}">
|
|
<meta property="og:url" content="{{.URL}}">
|
|
<meta property="og:image" content="{{.OGImage}}">
|
|
<meta property="og:image:width" content="1200">
|
|
<meta property="og:image:height" content="630">
|
|
<meta property="og:image:alt" content="{{.Room.Name}}: two cards and a stack of chips on the felt.">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="description" content="Blackjack, hold'em, UNO, trivia, hangman and solitaire, played for real gogobee euros.">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="{{asset "/static/css/output.css"}}">
|
|
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpolygon points='16,3 27,9.5 27,22.5 16,29 5,22.5 5,9.5' fill='%23f2b53d' stroke='%232b2118' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E" type="image/svg+xml">
|
|
<meta name="theme-color" content="#17231d">
|
|
<script>
|
|
// Which room you're standing in, from your clock rather than the server's:
|
|
// Casinopolis in daylight, Casino Night Zone once the lights come on at six.
|
|
// Same rule as roomAt() in games_pages.go — keep the two in step.
|
|
//
|
|
// The server already painted its best guess into the markup, so this only
|
|
// corrects a player whose evening isn't the server's.
|
|
(function () {
|
|
var ROOMS = {
|
|
"casinopolis": "Casinopolis",
|
|
"casino-night": "Casino Night Zone",
|
|
};
|
|
function roomAt(h) { return (h >= 6 && h < 18) ? "casinopolis" : "casino-night"; }
|
|
function apply() {
|
|
var slug = roomAt(new Date().getHours());
|
|
// The palette can be set from <head> — the sign can't: this script runs
|
|
// before the header exists. So set the attribute now (no flash of the
|
|
// wrong room) and always re-stamp the name, which is a no-op until the
|
|
// header is there to stamp. Bailing out early when the slug already
|
|
// matches would leave the server's name under the browser's palette.
|
|
document.documentElement.dataset.room = slug;
|
|
document.querySelectorAll("[data-room-name]").forEach(function (el) {
|
|
el.textContent = ROOMS[slug];
|
|
});
|
|
}
|
|
apply();
|
|
document.addEventListener("DOMContentLoaded", apply);
|
|
setInterval(apply, 60000);
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body class="min-h-screen bg-[color:var(--bg)] text-ink">
|
|
<div class="pointer-events-none fixed inset-0 -z-10 cs-room" aria-hidden="true"></div>
|
|
|
|
<header class="mx-auto max-w-5xl px-4 pt-6 pb-4 sm:pt-10">
|
|
<div class="flex items-center justify-between gap-3">
|
|
<a href="/games" class="group flex min-w-0 items-center gap-3">
|
|
{{template "_comb" .}}
|
|
<span class="min-w-0">
|
|
<span data-room-name class="block font-display text-2xl sm:text-3xl font-bold leading-none tracking-tight">{{.Room.Name}}</span>
|
|
</span>
|
|
</a>
|
|
|
|
{{if .User}}
|
|
<a href="/auth/logout" title="Signed in as {{.User.Display}} — sign out"
|
|
class="inline-flex shrink-0 items-center gap-2 rounded-full bg-card px-2.5 py-1.5 text-sm font-semibold shadow-pete border-2 border-ink/10 hover:bg-ink/5 transition">
|
|
<span class="grid h-6 w-6 place-items-center rounded-full bg-accent text-xs font-bold text-[#20180c]">{{.User.Initial}}</span>
|
|
<span class="hidden sm:inline max-w-[7rem] truncate">{{.User.Display}}</span>
|
|
</a>
|
|
{{else}}
|
|
{{/* Nobody is signed in, which on any page but the front door can't happen. */}}
|
|
<a href="/auth/login?next=/games"
|
|
class="inline-flex shrink-0 items-center rounded-full bg-accent px-4 py-1.5 text-sm font-bold text-[#20180c] shadow-pete hover:-translate-y-0.5 transition">
|
|
Sign in
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</header>
|
|
|
|
<main class="mx-auto max-w-5xl px-4 pb-20">
|
|
{{block "main" .}}{{end}}
|
|
</main>
|
|
|
|
<footer class="mx-auto max-w-5xl px-4 pb-10 text-center text-xs text-muted">
|
|
Play for what you can lose. Cash out whenever you like.
|
|
</footer>
|
|
|
|
<!-- The room's noise. Loaded here rather than per-table because every table
|
|
wants it and none of them owns it, and because it has to be defined before
|
|
casino-fx.js — which reaches for it on every chip it throws. `defer` runs
|
|
these in document order, so that's guaranteed. -->
|
|
<script src="{{asset "/static/js/casino-sfx.js"}}" defer></script>
|
|
{{block "scripts" .}}{{end}}
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* The house mark: a honeycomb cell struck like a chip. Stands in for a logo,
|
|
and deliberately isn't a face — nobody is watching you play. */}}
|
|
{{define "_comb"}}
|
|
<span class="cs-comb grid h-11 w-11 shrink-0 place-items-center transition-transform group-hover:-rotate-6" aria-hidden="true">
|
|
<svg viewBox="0 0 32 32" class="h-11 w-11">
|
|
<polygon points="16,2.5 27.5,9.25 27.5,22.75 16,29.5 4.5,22.75 4.5,9.25"
|
|
fill="var(--accent)" stroke="var(--ink)" stroke-width="2.5" stroke-linejoin="round"/>
|
|
<polygon points="16,9 21.5,12.25 21.5,18.75 16,22 10.5,18.75 10.5,12.25"
|
|
fill="none" stroke="var(--ink)" stroke-width="1.75" stroke-linejoin="round" opacity="0.5"/>
|
|
</svg>
|
|
</span>
|
|
{{end}}
|