diff --git a/plan/daily-challenge.md b/plan/daily-challenge.md index 168d70a..4ed227a 100644 --- a/plan/daily-challenge.md +++ b/plan/daily-challenge.md @@ -226,6 +226,13 @@ of those is the real design question rather than the plumbing: sets itself up the same way there. - [x] **Ten challenges**, balanced on battle value, each verified to load in real MegaMek. +- [x] **The challenge is on the masthead**, as the second half of the Play + button: one split control, the way into a game with the day's fight on + its end. It was an address with no link anywhere on the bar, reached + only from the card on the front page, which put the one thing here a + player can do without an opponent behind having scrolled to find it. The + segment is open signed out, like the card - pressing Play on a challenge + is what asks for an account. - [x] **The archive**, at `#daily`: every challenge whose day has come, with what was on the card, playable and explicitly not scored. - [x] **A way to play it.** Play is on the card and on every archive row. It diff --git a/web/src/chrome.ts b/web/src/chrome.ts index 76aa774..3142314 100644 --- a/web/src/chrome.ts +++ b/web/src/chrome.ts @@ -21,8 +21,6 @@ export type Route = | "about" | `about/${AboutPageId}` | "lobby" - // An address with no masthead link, reached from the front page's daily - // challenge card. See destinations.ts's EXTRA_ROUTES. | "daily"; const navLinks = new Map(); diff --git a/web/src/destinations.ts b/web/src/destinations.ts index e9cc432..32060c3 100644 --- a/web/src/destinations.ts +++ b/web/src/destinations.ts @@ -60,6 +60,16 @@ export type Destination = { * layout's markup for this link and nothing about who may reach it. */ readonly prominent?: boolean; + /** + * Drawn joined to the destination before it, as the second half of one + * split control rather than as a link of its own. + * + * A rendering flag like `prominent`, and it only means anything directly + * after one: the pair is a filled button with a smaller segment on its + * end, which is why the group it sits in is the only one the bar draws + * without a gap between its links. + */ + readonly attached?: boolean; }; /** @@ -102,6 +112,17 @@ export const NAV_GROUPS: readonly NavGroup[] = [ signedIn: true, prominent: true, }, + // The day's fight, on the end of the button that starts a game. It was + // an address with no link on the bar - reached only from the card on + // the front page - which put the one thing here a player can do without + // an opponent behind having scrolled to find it. Open signed out, like + // the card: pressing Play on a challenge is what asks for an account. + { + id: "daily", + href: "/#daily", + label: "Daily", + attached: true, + }, ], }, { @@ -203,21 +224,9 @@ export function isAllowed(route: string, signedIn: boolean): boolean { * About. Blog is not one: those are pages the build wrote, and the router * never runs on them. */ -/** - * Addresses the app answers that no masthead link points at. - * - * The bar is a curated list of destinations, and the daily-challenge archive - * is not one: it is reached from the card on the front page, which is where - * anybody who cares about it already is. It still needs to be a real address — - * a past challenge is a thing to link to — so it is a route without being a - * destination. - */ -const EXTRA_ROUTES = ["daily"] as const; - const HASH_ROUTES = new Set([ ...DESTINATIONS.filter((d) => d.href?.startsWith("/#")).map((d) => d.id), ...ABOUT_ROUTES, - ...EXTRA_ROUTES, ]); /** The addresses the app itself is served at. Everything else is a page. */ diff --git a/web/src/layouts/Base.astro b/web/src/layouts/Base.astro index 9365923..444818b 100644 --- a/web/src/layouts/Base.astro +++ b/web/src/layouts/Base.astro @@ -175,6 +175,12 @@ const cardSize = image === DEFAULT_CARD ? { width: 1200, height: 630 } : null; is the same either way: this HTML is one file behind every address, so it cannot be built per reader. + A group whose second destination is `attached` is one split + control - the filled way into a game, with the day's challenge + on its end - so it is drawn without the gap the other groups + have between their links. Two links rather than a button and a + menu: both halves go somewhere, and there is nothing to open. + A destination that is under construction is a , not a disabled : there is no address behind it, so there is nothing to link to, nothing to focus and nothing to disable. @@ -187,7 +193,13 @@ const cardSize = image === DEFAULT_CARD ? { width: 1200, height: 630 } : null; } { NAV_GROUPS.map((group) => ( -