{@title}
+{@message}
+{@hint}
+ +diff --git a/assets/css/app.css b/assets/css/app.css index 38997b9..9abf639 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -23,6 +23,7 @@ @import "./components/_board.css"; @import "./components/_promotion.css"; @import "./pages/_legal.css"; +@import "./pages/_error.css"; @source "../css"; @source "../js"; diff --git a/assets/css/pages/_error.css b/assets/css/pages/_error.css new file mode 100644 index 0000000..1a9a84c --- /dev/null +++ b/assets/css/pages/_error.css @@ -0,0 +1,60 @@ +.error-page { + width: min(760px, calc(100% - 48px)); + margin: 0 auto; + padding: 100px 0 130px; + text-align: center; +} + +.error-code { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 68px; + padding: 7px 16px; + border: 1px solid var(--color-hairline); + border-radius: 999px; + color: var(--color-coral-text); + font-size: 12px; + font-weight: 700; + letter-spacing: .16em; +} + +.error-page h1 { + max-width: 640px; + margin: 28px auto 0; + font-size: clamp(40px, 5.5vw, 60px); + line-height: 1.02; +} + +.error-page p { + max-width: 48ch; + margin: 18px auto 0; + color: var(--color-muted); + font-size: 16px; + line-height: 1.7; +} + +.error-page .error-hint { + margin-top: 10px; + font-size: 13px; +} + +.error-actions { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + gap: 12px; + margin-top: 34px; +} + +@media (max-width: 650px) { + .error-page { + width: calc(100% - 36px); + padding: 64px 0 90px; + } + + .error-page h1 { + font-size: clamp(34px, 10vw, 44px); + } +} diff --git a/lib/chesstrainer_web/components/layouts.ex b/lib/chesstrainer_web/components/layouts.ex index 1866a6b..c17cbec 100644 --- a/lib/chesstrainer_web/components/layouts.ex +++ b/lib/chesstrainer_web/components/layouts.ex @@ -239,9 +239,10 @@ defmodule ChesstrainerWeb.Layouts do @doc """ Provides the system / light / dark colour-mode switch. - The click handling and `aria-checked` syncing live in the script in - `root.html.heex`, which runs before paint and also on pages without LiveView - (the landing page uses the marketing bundle). + The click handling and `aria-checked` syncing live in `theme_script.html.heex`, + which runs before paint and also on pages without LiveView (the landing page + uses the marketing bundle). Error pages include it explicitly because they do + not render through the root layout. """ def colour_mode_toggle(assigns) do ~H""" diff --git a/lib/chesstrainer_web/components/layouts/root.html.heex b/lib/chesstrainer_web/components/layouts/root.html.heex index 1224b41..680bd10 100644 --- a/lib/chesstrainer_web/components/layouts/root.html.heex +++ b/lib/chesstrainer_web/components/layouts/root.html.heex @@ -3,6 +3,7 @@
+ <.live_title @@ -63,79 +64,7 @@ src={assigns[:js_entry] || ~p"/assets/js/app.js"} > - +{@message}
+{@hint}
+ +