landing page (#63)

* remove daisyui and rebuild styles

* very basic setup of new design - missing components etc

* basic navbar with reusable landing components

* basic puzzle of the day

* update todos

* update todos

* add curated landing puzzle cards with selectable board (#55)

* update with footer

* add button to solve today's puzzle

* Make landing page a dead view

Render the home page from PageController with a static board preview, link puzzle cards and CTAs to public-code play routes, count puzzles from the DB, and add a global footer.

* Serve a marketing-only JS bundle on the landing page

Build a small marketing entry point with phoenix_html and the plain-DOM navbar, select it on controller-rendered pages, and keep the full LiveView bundle for LiveView pages.

* Add landing page SEO metadata

Replace the Phoenix default title with a descriptive Lucid Chess title, and add description, canonical, Open Graph, and Twitter card tags to the landing page.

* Complete the hero copy block

Add the spark icon primitive and the Endgames, made clear eyebrow. The primary CTA keeps linking to the active puzzle rather than scrolling to the board.

* Add a persisted global daily puzzle

Assign one endgame per UTC day in a daily_puzzles table with a unique date, preferring endgames unused in the last 30 days and falling back to any. Concurrent first requests insert with on-conflict-ignore and read the winning row. The landing board now shows the daily puzzle.

* remove unused CSS, nav links, time pill

* allow devices to connect to dev server by changing IP address to 0.0.0.0

* Restore the colour-mode switch and add a dark palette

* Use brand colour tokens on the play page

* self host fonts  - closes issue #62

* begin splitting CSS into modules

* remove hover on hero chessboard, split more css modules

* remove interactivity from hero chessboard

* update todo
This commit is contained in:
2026-11-05 13:52:14 +01:00
committed by GitHub
parent fd6277ef92
commit 93806b9ab2
60 changed files with 2253 additions and 11028 deletions
+4 -2
View File
@@ -19,18 +19,20 @@
// Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
import "phoenix_html";
// Plain-DOM mobile navigation (works on controller and LiveView pages).
import "./nav";
// Establish Phoenix Socket and LiveView configuration.
import { Socket } from "phoenix";
import { LiveSocket } from "phoenix_live_view";
import { hooks as colocatedHooks } from "phoenix-colocated/chesstrainer";
import topbar from "../vendor/topbar";
import { ChessBoard } from "./hooks/chessBoard";
import { CopyFen } from "./hooks/copyFen"
import { CopyFen } from "./hooks/copyFen";
let Hooks = {
...colocatedHooks,
ChessBoard,
CopyFen
CopyFen,
};
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content");
+4
View File
@@ -0,0 +1,4 @@
// JavaScript for controller-rendered (non-LiveView) pages such as the landing
// page. Keep this small: no Phoenix Socket, LiveView, hooks, or topbar.
import "phoenix_html";
import "./nav";
+43
View File
@@ -0,0 +1,43 @@
// Plain-DOM mobile navigation. It lives outside the LiveView hook system so it
// also runs on controller-rendered pages such as the landing page.
const WRAP = ".nav-wrap";
const TOGGLE = ".menu-button";
const LINKS = ".nav-links";
const setOpen = (open) => {
const wrap = document.querySelector(WRAP);
const links = wrap?.querySelector(LINKS);
const button = wrap?.querySelector(TOGGLE);
if (!links) return;
links.classList.toggle("open", open);
button?.setAttribute("aria-expanded", String(open));
};
document.addEventListener("click", (event) => {
const target = event.target instanceof Element ? event.target : null;
if (!target) return;
if (target.closest(TOGGLE)) {
const links = document.querySelector(LINKS);
setOpen(!links?.classList.contains("open"));
return;
}
if (target.closest(`${LINKS} a`)) {
setOpen(false);
return;
}
if (!target.closest(WRAP)) {
setOpen(false);
}
});
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") {
setOpen(false);
}
});