Skip to content

Commit 30cb0bb

Browse files
committed
feat(demystify): rebuild as a feature module with a hub, deep-linked entries and per-genre art
Replace the single DemystifiedGenrePage with src/pages/demystify/: one block parser shared by every file, a shell for the chrome, and pages for the hub and the genre collection. - /demystify is now a real hub reading public/demystify/index.txt instead of redirecting to /demystify/genre - genre entries get their own routes (/demystify/genre/:entryId), so they are deep-linkable, back-button-able and prerendered (506 docs, up from 496) - fix nested <button> inside <button> in the index rows - fix the parser dropping any value written inline after `breakdown:` - drive the audition state from real media events instead of a 1.5s timeout, and release the audio element and AudioContext on unmount - collapse four copies of the genre index into public/demystify/genre/index.txt - replace the shared template ASCII art with per-genre pieces and fix the eurodance box, whose third row was 3 chars short - discoverRoutes reads the demystify text files, so new collections and entries are picked up without code changes - add Demystify to the sidebar and a back-to-fezcode link on the hub 22 tests cover the parser, the fetch cache and both pages.
1 parent 09f88d1 commit 30cb0bb

32 files changed

Lines changed: 2200 additions & 1218 deletions

pages/discoverRoutes.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,44 @@ function storyBookRoutes() {
8686
return out;
8787
}
8888

89+
/**
90+
* /demystify is driven entirely by text files: public/demystify/index.txt
91+
* registers the collections, and each collection's index.txt registers its
92+
* entries. Reading them here means a new collection or entry is prerendered
93+
* and sitemapped without touching this file.
94+
*/
95+
function demystifyRoutes() {
96+
const out = new Set();
97+
const root = join(PUBLIC, 'demystify');
98+
const registry = join(root, 'index.txt');
99+
if (!existsSync(registry)) return out;
100+
101+
const idsIn = (file) => {
102+
const ids = [];
103+
for (const line of readFileSync(file, 'utf8').split(/\r?\n/)) {
104+
const m = line.match(/^id:\s*(\S+)/);
105+
if (m) ids.push(m[1]);
106+
}
107+
return ids;
108+
};
109+
110+
out.add('/demystify');
111+
for (const collection of idsIn(registry)) {
112+
const index = join(root, collection, 'index.txt');
113+
if (!existsSync(index)) continue;
114+
out.add(`/demystify/${collection}`);
115+
for (const entry of idsIn(index)) {
116+
out.add(`/demystify/${collection}/${entry}`);
117+
}
118+
}
119+
return out;
120+
}
121+
89122
export function discoverAllRoutes() {
90123
const all = new Set(staticRoutes);
91124
for (const r of blogRoutes()) all.add(r);
92125
for (const r of logsRoutes()) all.add(r);
93126
for (const r of storyBookRoutes()) all.add(r);
127+
for (const r of demystifyRoutes()) all.add(r);
94128
return Array.from(all);
95129
}

public/demystify/genre.txt

Lines changed: 0 additions & 199 deletions
This file was deleted.

public/demystify/genre/acidhouse.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ breakdown:
1414
Pioneered in Chicago and embraced by UK Summer of Love. Demystified: built entirely around turning the 303 filter resonance knobs to produce squelchy psychedelic bass textures.
1515

1616
ascii:
17-
+-----------------------------------------+
18-
| (:-) ACID HOUSE 303 RESONANCE (-:) |
19-
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
20-
| o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o |
21-
+-----------------------------------------+
17+
┌──────────────────────────────────────────┐
18+
│ CUTOFF ▁▂▃▅▇█▇▅▃▂▁▂▃▅▇█▇▅▃▂▁▂▃▅▇█ │
19+
│ RESO ╱╲ ╱╲ ╱╲ ╱╲ │
20+
│ SEQ █·█··█·█··█·█··█·█··█·█·· │
21+
│ ── SQUELCH ── TB-303 ── TR-909 ── 125 ── │
22+
└──────────────────────────────────────────┘
2223

2324
examples:
2425
- Phuture - Acid Tracks (1987) | The origin track of Chicago Acid House, 11 minutes of 303 filter tweaks

public/demystify/genre/britpop.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ breakdown:
1414
Celebrated British identity in response to US grunge. Demystified: rewrote 60s Kinks & Beatles melody craft with 90s swagger, loud amplifiers, and terrace chant choruses.
1515

1616
ascii:
17-
+-----------------------------------------+
18-
| [UK] BRITPOP ANTHEM SWAGGER [UK] |
19-
| ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ |
20-
| ======================================= |
21-
+-----------------------------------------+
17+
┌────────────────────────────────────────┐
18+
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
19+
│ │██│ │██│ │██│ │██│ │██│ │██│ │██│ │
20+
│ ┴──┴─┴──┴─┴──┴─┴──┴─┴──┴─┴──┴─┴──┴ │
21+
│ TERRACE CHORUS ─ JANGLE ─ RICKENBACKER │
22+
└────────────────────────────────────────┘
2223

2324
examples:
2425
- Oasis - Live Forever (1994) | Sky-scraping guitar solos, anthemic vocal melody, classic 90s British rock

public/demystify/genre/chiptune.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ breakdown:
1414
Crafted from early gaming hardware limitations. Demystified: sound programmers used rapid arpeggios to simulate chordal harmony on hardware with limited monophonic tone channels.
1515

1616
ascii:
17-
+-----------------------------------------+
18-
| [8BIT] CHIPTUNE PULSE WAVE [8BIT] |
19-
| _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ |
20-
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
21-
+-----------------------------------------+
17+
┌───────────────────────────────────────┐
18+
│ PULSE ▁▁▁▁████▁▁▁▁████▁▁▁▁████▁▁▁▁ │
19+
│ SQR ████▁▁▁▁████▁▁▁▁████▁▁▁▁████ │
20+
│ NOISE ░▒░▓░▒░░▓▒░▓░▒░░▓▒░▓░▒░░▓▒░ │
21+
│ ──── 2A03 ── 4 CHANNELS ── 8 BIT ──── │
22+
└───────────────────────────────────────┘
2223

2324
examples:
2425
- Anamanaguchi - Endless Fantasy (2013) | NES synth hardware mixed with modern pop-punk live drums

public/demystify/genre/drumbass.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ breakdown:
1414
Evolved out of UK rave sounds. Demystified: complex polyrhythmic drum manipulation combined with deep sub-woofer basslines and atmospheric synth stabs.
1515

1616
ascii:
17-
+-----------------------------------------+
18-
| [!!!] D&B AMEN BREAK 174 BPM [!!!] |
19-
| | | || | | || | | || | | || | | || | | |
20-
| _______________________________________ |
21-
+-----------------------------------------+
17+
┌─────────────────────────────────────────┐
18+
│ AMEN ██·█·██·█·█··██·█·██·█·█··██ │
19+
│ BREAK ▓▒░▓▒░▓▒░▓▒░▓▒░▓▒░▓▒░▓▒░▓▒░ │
20+
│ SUB ▇▇▇▇▇▇▁▁▁▁▁▁▇▇▇▇▇▇▁▁▁▁▁▁▇▇▇ │
21+
│ ────────────────────────────── 174 BPM │
22+
└─────────────────────────────────────────┘
2223

2324
examples:
2425
- Goldie - Inner City Life (1994) | Soulful vocals over hyper-edited jungle breakbeats

public/demystify/genre/eurodance.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ breakdown:
1414
Conquered European charts & global club floors. Demystified: driven by fast synth stabs, 4-on-the-floor kick drums, and unshakeable hooks designed for peak energy dancefloors.
1515

1616
ascii:
17-
+-----------------------------------------+
18-
| [>>>] EURODANCE 138 BPM PULSE [<<<] |
19-
| ||||||||||||||||||||||||||||||||||||||| |
20-
| /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ |
21-
+-----------------------------------------+
17+
┌───────────────────────────────────────────┐
18+
│ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ 4/4 KICK │
19+
│ █████ █████ █████ █████ │
20+
│ ──────────────────────────────── 138 BPM │
21+
│ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ SUPERSAW │
22+
│ ▁▃▅▇█▇▅▃▁▃▅▇█▇▅▃▁▃▅▇█▇▅▃▁▃▅▇█▇ EUPHORIA │
23+
└───────────────────────────────────────────┘
2224

2325
examples:
2426
- Snap! - Rhythm Is a Dancer (1992) | Classic Korg M1 organ lead, iconic 90s dance arrangement

0 commit comments

Comments
 (0)