Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions hub/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down
159 changes: 120 additions & 39 deletions hub/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,30 +18,66 @@ const esc = (s) =>
({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[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 ` <a class="card${l.featured ? " is-featured" : ""}" href="${esc(l.href)}"${ext ? ' rel="noopener"' : ""}>
<span class="card-icon" aria-hidden="true">${icon}</span>
<span class="card-text">
<span class="card-title">${esc(l.title)}</span>
<span class="card-desc">${esc(l.desc)}</span>
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: `<span class="art art-atlas" aria-hidden="true">${"<span></span>".repeat(6)}</span>`,
data: `<span class="art art-data" aria-hidden="true">${["#8a3b6f", "#7a5a12", "#a3372a", "#2f5ea8", "#3d7a2a", "#5b4a9e", "#a8325e", "#9a4a14"]
.map((c, i) => `<span style="--c:${c};--w:${[46, 72, 88, 60, 78, 92, 54, 80][i]}%"></span>`)
.join("")}</span>`,
bounty: `<span class="art art-bounty" aria-hidden="true"><span class="tag">$</span><span class="tag">$</span><span class="tag">$</span></span>`,
};

const platform = (p, i) => {
if (!ART[p.art]) throw new Error(`Unknown art "${p.art}" on platform "${p.name}"`);
return ` <a class="platform" href="${esc(p.href)}"${isExt(p.href) ? ' rel="noopener"' : ""}>
${ART[p.art]}
<span class="platform-body">
<span class="platform-kicker"><span>0${i + 1}</span>${esc(p.what)}</span>
<span class="platform-name">${esc(p.name)}</span>
<span class="platform-desc">${esc(p.desc)}</span>
<span class="platform-host">${esc(p.host)} <span aria-hidden="true">&rarr;</span></span>
</span>
<span class="card-arrow" aria-hidden="true">&rarr;</span>
</a>`;
};

const group = (g) => ` <section class="group" aria-labelledby="grp-${esc(g.title.toLowerCase().replace(/[^a-z]+/g, "-"))}">
<h2 class="group-title" id="grp-${esc(g.title.toLowerCase().replace(/[^a-z]+/g, "-"))}">${esc(g.title)}</h2>
${g.blurb ? ` <p class="group-blurb">${esc(g.blurb)}</p>\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 = `<span class="row-icon" aria-hidden="true">${icon}</span>
<span class="row-text"><span class="row-title">${esc(l.title)}</span><span class="row-desc">${esc(l.desc)}</span></span>`;
// target=_blank is deliberately NOT set: this is a navigation hub, and hijacking
// the user's tab decision is rude.
return isLive(l.href)
? ` <li><a class="row" href="${esc(l.href)}"${isExt(l.href) ? ' rel="noopener"' : ""}>
${inner}
<span class="row-go" aria-hidden="true">&rarr;</span></a></li>`
: ` <li><span class="row is-soon">
${inner}
<span class="row-soon">Soon</span></span></li>`;
};

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 ` <section class="group" aria-labelledby="${id}">
<h3 class="group-title" id="${id}">${esc(g.title)}</h3>
${g.blurb ? ` <p class="group-blurb">${esc(g.blurb)}</p>\n` : ""} <ul class="rows">
${links.map(row).join("\n")}
</ul>
</section>`;
};

const social = (s) =>
` <a class="social" href="${esc(s.href)}"${/^https?:/i.test(s.href) ? ' rel="noopener"' : ""}>${s.svg}${esc(s.label)}</a>`;
// 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) => ` <a class="social" href="${esc(s.href)}"${isExt(s.href) ? ' rel="noopener"' : ""}>${s.svg}<span>${esc(s.label)}</span></a>`;

const html = `<!doctype html>
<!-- GENERATED by build.mjs from links.mjs — do not edit by hand.
Expand All @@ -52,36 +88,79 @@ const html = `<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BU Spark! — Hub</title>
<meta name="description" content="${esc(TAGLINE)}">
<meta name="theme-color" content="#101315">
<link rel="icon" href="assets/spark-logo.png">
<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=Bebas+Neue&family=Montserrat:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<style>:root { --spin-duration: ${SPIN_DURATION}; }</style>
</head>
<body>
<div class="page">
<header class="hero">
<div class="hero-glow" aria-hidden="true"></div>
<div class="holo-float">
<div class="holo-flicker">
<img class="holo-img" src="assets/spark-logo.png" alt="" width="150" height="150">
<header class="top">
<div class="wrap top-in">
<a class="brand" href="./"><img src="assets/spark-logo.png" alt="" width="30" height="30"><span class="brand-name">BU Spark!</span><span class="brand-sub">Hub</span></a>
<a class="top-link" href="https://www.bu.edu/spark/" rel="noopener">bu.edu/spark <span aria-hidden="true">&#8599;</span></a>
</div>
</header>

<main>
<section class="hero">
<div class="hero-grid" aria-hidden="true"></div>
<div class="wrap hero-in">
<div class="hero-copy">
<p class="eyebrow">Boston University &middot; Tech incubator</p>
<h1>Student-built.<br>Client-tested.<br><span class="hl">Out in the world.</span></h1>
<p class="lede">${esc(TAGLINE)}</p>
<div class="ctas">
<a class="btn btn-primary" href="${esc(PLATFORMS[0].href)}" rel="noopener">See what students built <span aria-hidden="true">&rarr;</span></a>
<a class="btn btn-ghost" href="#find-your-way">Find your way in</a>
</div>
</div>
<div class="holo">
<div class="holo-ring" aria-hidden="true"></div>
<div class="holo-float"><div class="holo-flicker"><img class="holo-img" src="assets/spark-logo.png" alt="" width="200" height="200"></div></div>
<div class="holo-floor" aria-hidden="true"></div>
</div>
</div>
</section>

<section class="platforms-sec" aria-labelledby="platforms-h">
<div class="wrap">
<div class="sec-head">
<h2 id="platforms-h">The Spark! platforms</h2>
<p>Three live sites, one family. Same people, same projects, seen three ways.</p>
</div>
<div class="platforms">
${PLATFORMS.map(platform).join("\n")}
</div>
</div>
<div class="holo-floor" aria-hidden="true"></div>
<h1 class="wordmark">BU SPARK<span class="bang">!</span></h1>
<p class="tagline">${esc(TAGLINE)}</p>
</header>
</section>

<nav class="groups" aria-label="Spark! links">
${GROUPS.map(group).join("\n")}
</nav>
<section class="index-sec" id="find-your-way" aria-labelledby="index-h">
<div class="wrap">
<div class="sec-head">
<h2 id="index-h">Find your way in</h2>
<p>Programs, roles, events and ways to partner.</p>
</div>
<div class="groups">
${GROUPS.map(group).filter(Boolean).join("\n")}
</div>
</div>
</section>
</main>

<nav class="socials" aria-label="Social links">
${SOCIALS.map(social).join("\n")}
</nav>
<p class="byline">bu.edu/spark &middot; Boston University</p>
</div>
<footer class="foot">
<div class="wrap foot-in">
<div>
<p class="foot-mark">BU SPARK<span>!</span></p>
<p class="foot-by">Boston University &middot; <a href="https://www.bu.edu/spark/" rel="noopener">bu.edu/spark</a></p>
</div>
<nav class="socials" aria-label="Social links">
${SOCIALS.filter((s) => isLive(s.href)).map(social).join("\n")}
</nav>
</div>
</footer>
</body>
</html>
`;
Expand Down Expand Up @@ -109,4 +188,6 @@ for (const [from, to] of [
const n = GROUPS.flatMap((g) => g.links).length;
console.log(`index.html + dist/ written — ${GROUPS.length} groups, ${n} links, ${SOCIALS.length} socials`);
const placeholders = GROUPS.flatMap((g) => g.links).filter((l) => l.href === "#").map((l) => l.title);
if (placeholders.length) console.log(` ${placeholders.length} still pointing at "#": ${placeholders.join(", ")}`);
if (placeholders.length) console.log(` ${placeholders.length} still pointing at "#" (shown as "Soon"): ${placeholders.join(", ")}`);
const deadSocials = SOCIALS.filter((s) => !isLive(s.href)).map((s) => s.label);
if (deadSocials.length) console.log(` ${deadSocials.length} socials hidden until they have a link: ${deadSocials.join(", ")}`);
Loading
Loading