diff --git a/public/style.css b/public/style.css index c0a5ec8..375b21d 100644 --- a/public/style.css +++ b/public/style.css @@ -93,7 +93,8 @@ details summary { cursor: pointer; font-weight: 600; } .ring-bar .ring-home { color: var(--accent); font-weight: 700; } .ring-bar .ring-sites { display: inline-flex; gap: 12px; padding: 0 12px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } .ring-bar [aria-current='page'] { color: var(--text); } -@media (max-width: 640px) { .ring-bar .ring-sites, .ring-bar .ring-home span { display: none; } } +.ring-bar .ring-start { margin-left: auto; color: var(--accent); font-weight: 700; } +@media (max-width: 640px) { .ring-bar .ring-home span { display: none; } } /* ad.network */ .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0; } .card.pick { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; } diff --git a/src/ring.ts b/src/ring.ts index a7cbc1e..98a17e2 100644 --- a/src/ring.ts +++ b/src/ring.ts @@ -69,6 +69,7 @@ export function siteHref(site: RingSite, direct: boolean): string { return site.moshpit && !direct ? relayUrl(site.name) : `https://${site.name}/` } +/** The ring, the site you are on between its neighbours, random, and the way in for a builder (pit.world/start). */ export function ringBar(self: string, direct: boolean): string { const at = sites.findIndex((s) => s.name === self) const i = at < 0 ? 0 : at @@ -76,11 +77,14 @@ export function ringBar(self: string, direct: boolean): string { const next = sites[(i + 1) % sites.length]! const link = (s: RingSite, text = s.name) => `${esc(text)}` + const current = sites.find((s) => s.name === self) + const here = current ? link(current) : `${esc(self)}` return `` } diff --git a/test/app.test.ts b/test/app.test.ts index 3d47833..529887e 100644 --- a/test/app.test.ts +++ b/test/app.test.ts @@ -127,6 +127,7 @@ describe('ad.network', () => { expect(html).toContain('Ads, the simple way.') expect(html).toContain('href="/advertise"') expect(html).toContain('ring-bar') + expect(html).toContain('Start building here…') expect((await t.req('/help')).status).toBe(200) const sh = await t.req('/install.sh') expect(sh.headers.get('content-type')).toContain('shellscript')