diff --git a/hub/README.md b/hub/README.md index 793880e..afea3b1 100644 --- a/hub/README.md +++ b/hub/README.md @@ -1,9 +1,10 @@ # hub — the Spark! link-in-bio landing page -A single "linktree-style" page: dark hero with a rotating holographic Spark! logo, -a two-column grid of link cards in four groups, then social links. Built from -`design_handoff_spark_hub` (high-fidelity handoff — colours, type, spacing, copy and -animation timing are final-intent). +The front door to Spark!: a dark hero with the rotating holographic logo, three +tiles for the live platforms (Atlas, Data@Spark, Bounty Board), then an index of +every other link in four groups. Same design system as Atlas and Data@Spark +(Space Grotesk / IBM Plex, ink + Spark teal). The hologram and its timing come from +the original `design_handoff_spark_hub`; the 2026-12 redesign replaced the rest. Not to be confused with **`atlas/`**, the project portfolio. That directory was called `hub/` until this page took the name. @@ -26,13 +27,13 @@ is committed and is what ships. ``` `icon` must be a key of `ICONS` in the same file — `build.mjs` throws on an unknown -one rather than emitting a card with a blank tile. Set `featured: true` for the teal -emphasis treatment; the handoff uses it on exactly one card and it stops meaning -anything if that changes. +one rather than emitting a card with a blank tile. The three platform tiles are +`PLATFORMS` in the same file; each `art` must be a key of `ART` in `build.mjs`. A link +whose href is also a platform's is left out of the index (it is already a tile). -**9 of 12 links still point at `#`.** They are the handoff's realistic placeholders. -`node build.mjs` prints which ones on every run, so it stays visible rather than -becoming permanent. The three real ones today: the Project Portfolio (`atlas`), +**Links still pointing at `#` render as plain text with a "Soon" tag**, not as links +that go nowhere; socials pointing at `#` are hidden. `node build.mjs` prints both +lists on every run, so they stay visible rather than becoming permanent. The three real ones today: the Project Portfolio (`atlas`), GitHub, and bu.edu/spark. ## Why a build step for a static page diff --git a/hub/build.mjs b/hub/build.mjs index b2ba546..fa34912 100644 --- a/hub/build.mjs +++ b/hub/build.mjs @@ -8,7 +8,7 @@ // cold phone connection, and broken with JS off. // So the data is a list, and the artifact is plain HTML. index.html is committed. import { writeFileSync, mkdirSync, copyFileSync, rmSync } from "node:fs"; -import { GROUPS, SOCIALS, ICONS, TAGLINE, SPIN_DURATION } from "./links.mjs"; +import { GROUPS, PLATFORMS, SOCIALS, ICONS, TAGLINE, SPIN_DURATION } from "./links.mjs"; // Escape anything that reaches an HTML text node or attribute. The copy contains // "&" and "×" today, and a future link title is exactly where an unescaped @@ -18,30 +18,66 @@ const esc = (s) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c]) ); -const card = (l) => { - const icon = ICONS[l.icon]; - if (!icon) throw new Error(`Unknown icon "${l.icon}" on link "${l.title}"`); - // External links get rel=noopener. target=_blank is deliberately NOT set: this is - // a navigation hub, and hijacking the user's tab decision is rude. - const ext = /^https?:\/\//i.test(l.href); - return ` - - - ${esc(l.title)} - ${esc(l.desc)} +const isExt = (href) => /^https?:\/\//i.test(href); +// A "#" href is a placeholder (see links.mjs). It renders as plain text with a +// "soon" tag rather than as a link that goes nowhere. +const isLive = (href) => href && href !== "#"; +const slug = (s) => s.toLowerCase().replace(/[^a-z]+/g, "-"); + +// Small CSS/SVG pictures of what each platform is. Decorative: aria-hidden. +const ART = { + atlas: ``, + data: ``, + bounty: ``, +}; + +const platform = (p, i) => { + if (!ART[p.art]) throw new Error(`Unknown art "${p.art}" on platform "${p.name}"`); + return ` + ${ART[p.art]} + + 0${i + 1}${esc(p.what)} + ${esc(p.name)} + ${esc(p.desc)} + ${esc(p.host)} - `; }; -const group = (g) => `
-

${esc(g.title)}

-${g.blurb ? `

${esc(g.blurb)}

\n` : ""} -${g.links.map(card).join("\n")} +const row = (l) => { + const icon = ICONS[l.icon]; + if (!icon) throw new Error(`Unknown icon "${l.icon}" on link "${l.title}"`); + const inner = ` + ${esc(l.title)}${esc(l.desc)}`; + // target=_blank is deliberately NOT set: this is a navigation hub, and hijacking + // the user's tab decision is rude. + return isLive(l.href) + ? `
  • + ${inner} +
  • ` + : `
  • + ${inner} + Soon
  • `; +}; + +const platformHrefs = new Set(PLATFORMS.map((p) => p.href.replace(/\/$/, ""))); +const group = (g) => { + const links = g.links.filter((l) => !platformHrefs.has(l.href.replace(/\/$/, ""))); + if (!links.length) return ""; + const id = `grp-${slug(g.title)}`; + return `
    +

    ${esc(g.title)}

    +${g.blurb ? `

    ${esc(g.blurb)}

    \n` : ""}
    `; +}; -const social = (s) => - ` ${s.svg}${esc(s.label)}`; +// Socials still pointing at "#" are left out: an icon that goes nowhere is worse +// than no icon. build.mjs lists them below so they are not forgotten. +const social = (s) => ` ${s.svg}${esc(s.label)}`; const html = `