跳到正文
VibeFather
免费注册

用这个模板做的 2 个案例

同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。

关于这个模板

这个模板是一个单页音乐课程,让访客亲手弹奏来学习音程与和弦。页面以稳定的节奏沿一条长滚动条展开:先讲一个简短概念,再配一个动手操作的小组件,然后完成一个小目标,点亮一条亮黄色进度条,并让页头的进度计数加一。课程包含一架可用鼠标、触屏或电脑键盘演奏的两个八度钢琴,一个可拖动或点击旋转的五度圈,一个支持九种和弦性质的和弦构建器,以及一个八轮练耳测验,最后给出结果卡片。所有声音都用 Web Audio API 在浏览器里合成,因此没有音频文件需要授权或托管。它适合音乐老师、在线课程创作者、夜校,以及想要一套可复用的“边玩边学”页面模式的开发者。视觉风格像夜晚的舞台:深紫外底色,珊瑚色和酸性黄色点缀,十二个音级颜色按五度圈顺序分配,因此听起来相关的调在视觉上也相关。这些颜色在钢琴键、五度圈扇形、和弦标签和测验反馈中保持一致,并由一份共享状态把它们串起来。把五度圈转到 G,和弦构建器、钢琴和底部停靠栏都会跟着变。要改编它,改品牌、课程主题、目标人群、起始调和讲师即可。小组件保持原样,而文案、小目标任务、和弦列表和测验轮次都放在一个内容文件里,所以为 beatmaker 做一门七和弦课程只需花一个下午改写,而不用写新代码。如果你只想要免费课程,结尾的讲师部分和课程详情可以删掉。

模板提示词

在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。

# Music Theory Interactive Lesson

Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else.

## Brief
Build a single-page interactive music theory lesson for [BRAND], an invented evening music school, on the topic '[LESSON_TOPIC]'. The page is one long scroll that repeats a fixed rhythm: short concept, hands-on widget, small win. It contains a playable two-octave piano voiced by Web Audio oscillators, a rotating SVG circle of fifths, a chord builder that lights notes and names intervals, an eight-round ear-training quiz with a score, and a closing section about the instructor and the school. All widgets read one shared state, and twelve pitch-class colors stay consistent everywhere, so color itself teaches the relationships. Copy below is written for the default values. If the values change, rewrite all copy in the one content file to fit them, and keep the widgets, layout, colors and motion exactly the same.

- Audience: [AUDIENCE]. They may not read staff notation and may not own an instrument; a laptop keyboard or a phone is enough.
- Goal: Within ten seconds the visitor presses a key, hears it and sees the theory respond. By the end of the page they can name common intervals and chords by ear, have earned four small wins and a quiz score, and know what the [BRAND] evening course offers.
- Tone: Playful, bold and plainspoken, like a good teacher on a small stage at night. Short sentences. Describes how things sound in everyday words. Never academic, never cute for its own sake.

## Stack
- Framework: Vite 5 + React 18 + TypeScript
- Styling: Tailwind CSS 3.4
- Libraries: react (MIT), react-dom (MIT), motion (MIT), lucide-react (ISC), @fontsource-variable/unbounded (OFL-1.1), @fontsource-variable/figtree (OFL-1.1), @fontsource-variable/jetbrains-mono (OFL-1.1), vite (MIT), @vitejs/plugin-react (MIT), tailwindcss (MIT), postcss (MIT), autoprefixer (MIT), typescript (Apache-2.0)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
  - vite.config.ts: set base to './' and build.sourcemap to false. Import Motion from 'motion/react'.
  - File layout: src/content.ts (all copy, sample data, win tasks, quiz rounds), src/theory.ts (note tables, scales, chord spelling), src/audio.ts (Web Audio engine), src/store.tsx (React context plus useReducer, no state library), src/components/ (Piano, CircleOfFifths, IntervalPicker, ChordBuilder, ChordShape, Quiz, WinBar, Dock, TopBar), src/App.tsx. Images in public/images/.
  - Add the colors and fonts from the Design section to tailwind.config theme.extend under the names given there, and export the same pitch color table from src/theory.ts as a typed array indexed by pitch class 0 to 11.
  - Note tables: DEFAULT_NAMES by pitch class = C, Db, D, Eb, E, F, F#, G, Ab, A, Bb, B. Write accidentals with plain # and b characters everywhere, with no music glyphs. FIFTHS_ORDER clockwise from the top = C, G, D, A, E, B, F#, Db, Ab, Eb, Bb, F. RELATIVE_MINORS in the same order = Am, Em, Bm, F#m, C#m, G#m, D#m, Bbm, Fm, Cm, Gm, Dm.
  - Scale spelling table: C = C D E F G A B; G = G A B C D E F#; D = D E F# G A B C#; A = A B C# D E F# G#; E = E F# G# A B C# D#; B = B C# D# E F# G# A#; F# = F# G# A# B C# D# E#; Db = Db Eb F Gb Ab Bb C; Ab = Ab Bb C Db Eb F G; Eb = Eb F G Ab Bb C D; Bb = Bb C D Eb F G A; F = F G A Bb C D E. Key signatures: C none; G 1 sharp; D 2 sharps; A 3 sharps; E 4 sharps; B 5 sharps; F# 6 sharps; Db 5 flats; Ab 4 flats; Eb 3 flats; Bb 2 flats; F 1 flat.
  - Chord spelling function: start from the root name, take the letter that many steps up for each degree (2nd +1, 3rd +2, 4th +3, 5th +4, 7th +6), then add the # or b characters needed to hit the pitch class. Double flats are written bb, for example Ebdim = Eb Gb Bbb.
  - src/audio.ts: create one AudioContext lazily inside the first pointerdown or keydown handler and call resume() there; never touch audio on page load. Graph: voices to a lowpass BiquadFilter (3200 Hz, Q 0.6), to a master GainNode (0.7), to a DynamicsCompressor, to destination. Each voice is a triangle oscillator at the note frequency plus a sine an octave up at gain 0.25, through a voice gain with attack 0.008 s to peak 0.5, decay 0.25 s to sustain 0.28 and release 0.35 s. Equal temperament with A4 = 440 Hz. Limit to 10 voices and steal the oldest. Mute ramps the master gain to 0 over 20 ms and back to 0.7 on unmute.
  - Playback helpers in src/audio.ts: playNote(midi, ms); playMelodic(midis) with 450 ms between notes, then all notes together for 900 ms; strum(midis) with 45 ms between notes and a 1200 ms hold; playScale(midis) with 170 ms between notes; tick(midi), a 60 ms note at gain 0.15. Each helper also reports notes on and off to the store, so every piano lights in sync. Each one takes a silent flag that skips this reporting; quiz playback uses it until the round is answered, so the dock cannot give away the answer.
  - src/store.tsx state: selectedKey (index into FIFTHS_ORDER, starts at [START_KEY]), activeNotes (set of midi numbers now sounding), interval {rootMidi, semitones: 7}, chord {rootName, quality: 'major'}, lastEvent {label, midis, playback}, wins [false, false, false, false], muted false, heroPlayed (last two midi notes pressed on the hero piano). The dock, top bar and all pianos read from this one store.
  - Linking rules: (1) changing selectedKey sets interval.rootMidi to the tonic in octave 4 and sets chord.rootName to the tonic, keeping the quality. (2) Choosing a root chip or quality in the chord builder rotates the circle: for major, dominant 7th, major 7th, augmented and sus chords, to the root's own wedge; for minor, minor 7th and diminished chords, to the major key whose inner wedge has that root (root + 3 half steps). This rotation must not overwrite the chord that triggered it, so pass a source flag. (3) Diatonic chord chips in the circle panel set the chord builder and keep the circle where it is. (4) A press on the hero piano sets selectedKey to that pitch class. A press on the Chapter 1 piano sets interval.rootMidi to that pitch class in octave 4 and leaves selectedKey alone. Presses on other pianos only play and pulse the matching circle wedge.
  - Keyboard map on window keydown, ignoring e.repeat, any modifier key, and focus inside an input: A=C, W=C#, S=D, E=D#, D=E, F=F, T=F#, G=G, Y=G#, H=A, U=A#, J=B, K=C up an octave, O=C# up, L=D up, P=D# up, ;=E up, '=F up. Base octave starts at 4; Z sets it to 4 and X sets it to 5; notes above B5 are ignored. The press counts as a press on the piano of the hero or chapter now in view (tracked with IntersectionObserver); anywhere else it only plays the note.
  - npm scripts: dev, build (tsc --noEmit && vite build), preview. Add public/favicon.svg, a 12-wedge pinwheel in the note colors, and a plain title '[BRAND] | [LESSON_TOPIC]'.

## Variables
- [BRAND] — School or course brand (default: "Overtone Night School"). An invented name. Shown in the top bar, the instructor section, the final band and the footer.
- [LESSON_TOPIC] — Lesson topic (default: "Intervals and chords"). Sets the hero eyebrow and the chapter copy. The piano, circle, chord builder and quiz stay; reorder the chord list and quiz rounds to suit.
- [AUDIENCE] — Who the lesson is for (default: "Beginners who play by ear and want to name what they hear"). Shapes the hero lead and the FAQ.
- [START_KEY] — Starting key (default: "C"). One of C, G, D, A, E, B, F#, Db, Ab, Eb, Bb, F. The circle, interval root and chord builder open here.
- [INSTRUCTOR_NAME] — Instructor name (default: "Marisol Adeyemi"). An invented person. Swap the portrait for your own photo if you use a real name.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/music-theory-interactive-lesson in the footer (default: yes; delete this line to remove it)

The copy under Pages & Sections is written for the default values. If your values differ, rewrite every headline, paragraph, label and image for them — same length, tone and structure. Layout, colors, type and motion stay as described.
Keep all copy, image paths and links in one content file (for example `src/content.ts`), keyed by section, so the content can be swapped later without touching components.

## Design
### Colors
- stage `#1B0B4B` — Deep ultraviolet page ground; hero scrim tint and odd chapters
- pit `#120634` — Darkest ground for the top bar, dock and footer, and the ink on all bright fills
- curtain `#2A0F73` — Saturated violet ground for even chapters
- panel `#351A8C` — Widget panels and cards
- coral `#FF5A47` — Electric coral: secondary buttons, wrong answers, final band, chapter 1 accent. Must appear large in the hero
- acid `#E6FF2E` — Acid yellow: primary buttons, win bars, correct answers, circle pointer, focus rings. Must appear large in the hero
- text `#F6F1FF` — Body and heading text on dark grounds
- muted `#C9BEF2` — Secondary text on dark grounds
- ivory-key `#F1EBFF` — Pale lilac natural piano keys
- pc-C `#FF5A47` — Pitch class C
- pc-G `#FF8A2B` — Pitch class G
- pc-D `#FFC21F` — Pitch class D
- pc-A `#E6FF2E` — Pitch class A
- pc-E `#8CF23C` — Pitch class E
- pc-B `#2EE87F` — Pitch class B
- pc-Gb `#1FE5C4` — Pitch class F#/Gb
- pc-Db `#29C9FF` — Pitch class C#/Db
- pc-Ab `#6FA3FF` — Pitch class G#/Ab
- pc-Eb `#A98BFF` — Pitch class D#/Eb
- pc-Bb `#E872FF` — Pitch class A#/Bb
- pc-F `#FF5CB0` — Pitch class F

### Typography
- Display: headlines, chapter numerals, chord and key names. Weight 800, line-height 1.04, letter-spacing -0.02em.: Unbounded Variable (OFL), weights 500/800
- Text: body at 18px desktop and 16px mobile, line-height 1.55; buttons at weight 700.: Figtree Variable (OFL), weights 400/500/700
- Mono: note names on keys, half-step counts, score, key caps, small labels at 12 to 14px, uppercase with 0.08em tracking where labels are words.: JetBrains Mono Variable (OFL), weights 500/700

### Layout & motion
- Spacing: Base unit 8px. Page container max width 1320px with 40px side gutters on desktop and 16px on mobile. Chapters use 120px vertical padding on desktop and 72px on mobile. Widget panels use 32px padding on desktop and 16px on mobile. Gaps between panel groups are 24px.
- Radius: Panels 28px, cards 20px, buttons and chips fully round (999px), piano keys square at the top and 10px at the bottom on naturals, 6px at the bottom on sharps.
- Motion: Stage beam: on every press of a hero piano key, a vertical beam in that note's color rises from the key to the top of the hero, 2 key-widths wide with a linear gradient fading to transparent, scaleY 0 to 1 in 120 ms, then fades out over 600 ms. Several beams may overlap. This is the signature effect.
- Motion: Key press: a pressed key moves down 3px in 60 ms, its fill becomes the pitch color and it gains a soft outer glow in that color. On release it returns over 140 ms.
- Motion: Circle rotation: Motion spring with stiffness 180 and damping 22 to the nearest 30-degree snap, taking the shortest path. While dragging, the rotation follows the pointer directly and a tick() plays each time a new wedge crosses the pointer. Wedge labels counter-rotate to stay upright.
- Motion: Win bar: the dashed outline fills from left to right with acid yellow in 350 ms, the check icon pops in with a spring (scale 0.4 to 1), and the top bar's win count bumps to scale 1.2 and back.
- Motion: Chord change: chips animate in with a 40 ms stagger, moving up 8px and fading in; the chord shape polygon morphs to its new vertices with a spring (stiffness 140, damping 18).
- Motion: Scroll reveal: chapter text and panels move up 24px and fade in once over 500 ms as they enter the viewport.
- Motion: Idle hero: on load, a 2.4 s wave of light passes left to right across the piano's color strips, once only, with no sound.
- Motion: With prefers-reduced-motion: no beams, wave or scroll reveals. The circle jumps to its position with no spring, and key presses only change color. Sound and all widgets still work.
- Imagery: A stage at night. Four matching photographs in one shoot style (ultraviolet haze, coral key light, thin acid yellow accent) set the mood for the hero, the instructor, the evening class and the final band. Everything interactive is drawn in SVG and HTML: the piano, circle, chord shape and color strips. Instruments carry no maker names.

## Pages & Sections
### [BRAND] | [LESSON_TOPIC] (`index.html`)
1. **Shared layout: top bar and dock** — Top bar: left, a 24px pinwheel of twelve note-colored wedges plus '[BRAND]' in Unbounded 500. Center, anchor links 'Intervals' (#intervals), 'Circle' (#circle), 'Chords' (#chords), 'Quiz' (#quiz). Right, a mono pill showing '0/4 wins' that counts up and a round sound button using Lucide Volume2 or VolumeX with the visible label 'Sound on' or 'Sound off'. Dock: a fixed bottom bar with a static mini keyboard showing the notes now lit or sounding, a mono readout of lastEvent.label such as 'C major chord: C E G' or 'G major scale' or 'E4', a round Lucide Play button that replays lastEvent, and the same sound button. Before any event the readout says 'Press any key'.
   Layout: Top bar is sticky, 64px tall on desktop and 56px on mobile, pit background at 85% opacity with backdrop blur. On mobile hide the center links and the 'Sound on' label, keeping the icon and win pill. Dock is 64px tall on desktop and 56px on mobile, with a pit background and a 1px panel-colored top border. Mini keyboard is an SVG 336x40 on desktop and 150x32 on mobile. Body gets matching bottom padding so the dock never covers content.
   Motion: The dock slides up 200 ms after the hero leaves the viewport (IntersectionObserver) and slides away when the hero returns. The dock's mini keys change color instantly.
2. **Hero** — Mono eyebrow in acid: '[LESSON_TOPIC] · a free lesson from [BRAND]'. Headline with forced breaks: 'Press a key. / Hear why / it works.' with 'Hear why' in acid and the rest in text color. Lead: 'For beginners who play by ear and want to name what they hear. Four short chapters, about 20 minutes, no sign-up.' Primary button 'Start the lesson' (acid, links to #intervals). Secondary button 'Jump to the quiz' (coral fill with pit ink, links to #quiz). Mono chips under the buttons on desktop only: '4 chapters', '20 minutes', 'Keyboard, mouse or touch'. Right side: the circle of fifths. Below everything: the full two-octave piano from C4 to B5, with a one-line live readout directly above it. Readout before any press: 'Press any key, or try A S D F G H J on your keyboard.' After one press: 'E4. Now press another key.' After two: 'E4 to B4: perfect fifth, 7 half steps.' using the interval names from Chapter 1. Count the distance in either direction. Beyond an octave, name the interval reduced to within an octave and add 'plus an octave'. The same note twice reads 'E4 again: same note.'
   Layout: Min height 100svh. Full-bleed background photo hero-stage.webp with object-fit cover and a scrim: linear gradient from pit at 88% on the left to stage at 45% on the right, and pit at 90% over the bottom 40%. Add a large blurred coral radial glow (600px) behind the circle and an acid glow (360px) at the top-left corner of the photo, both clearly visible. At 1440x900: two columns above the piano, left 58% holding the text with headline font-size clamp(36px, 4.6vw, 66px), right 42% holding a 440px circle centered. The piano spans the full container at the bottom of the screen, height clamp(170px, 23vh, 210px), so the whole composition fits inside 900px with no scrolling. Mobile at 390x844: single column in the order eyebrow, headline, lead, primary button only, 216px circle (outer ring only), readout, then piano in two rows (C4 to B4, then C5 to B5), each row 88px tall with 7 natural keys spanning the full width. All of it must fit within about 844px.
   Motion: Stage beams on every press, plus the idle wave on load. The first press also makes the circle turn to that pitch class, so the composition visibly responds. Headline lines reveal with a 60 ms stagger on load.
3. **Piano component (used in the hero and all four chapters)** — 24 keys, C4 to B5. Natural keys are ivory-key with a 14px color strip at the bottom in their pitch color, and show the note letter in mono above the strip in pit ink. Sharps are pit with an 8px color strip, and show their name only when lit. Lit notes (scale, interval or chord) fill with the pitch color and display the spelling from the current scale or chord, such as F# in G major or Eb in C minor. Notes sounding right now get the glow as well. Show the computer key letter in a tiny mono cap on each key on desktop when a hover-capable pointer is present, with the current octave mapping.
   Layout: A rounded pit tray with 12px padding. Naturals are each 1/14 of the width; sharps are 62% of a natural's width and 62% of the height, centered on the gap with the usual slight offset. Chapter pianos are 180px tall on desktop. On mobile, two rows of 7 naturals, 110px tall per row, with an 8px gap.
   Motion: Use Pointer Events without setPointerCapture: track each pointerId to a midi note so multi-touch chords work, and let mouse glissando use elementFromPoint on pointermove. Apply touch-action: none on the keys. Each key is a real button with aria-label such as 'C sharp 4'; Enter or Space plays it.
4. **Color key band** — Small heading: 'Every note has a color.' Line: 'It keeps that color on this whole page. Neighbors in this row are a perfect fifth apart, so colors that look close also sound close.' Then 12 round chips in FIFTHS_ORDER, filled with their pitch color and named in mono with pit ink. Tapping a chip plays that note in octave 4.
   Layout: Full-width pit band with 48px vertical padding. On desktop the text sits left in 4 columns and the 12 chips run in one row in the remaining 8 columns, each 56px wide. On mobile the text stacks above a 6-by-2 grid of chips.
   Motion: Chips scale to 1.12 with a spring when played.
5. **Chapter 1: Intervals (id intervals)** — Outlined numeral '01' in coral. Title: 'Intervals are distances.' Concept: 'An interval is the gap between two notes, counted in half steps. One half step is the very next key, black or white. Count seven from C and you land on G.' Second line: 'Each gap has its own feel. Learn the feel first and the names follow.' Widget: 12 chips in order, each with mono half-step number, short name and feel: 1 Minor second, tense like a held breath; 2 Major second, a step forward; 3 Minor third, soft and a little sad; 4 Major third, bright and settled; 5 Perfect fourth, open like a call; 6 Tritone, restless and wants to move; 7 Perfect fifth, wide and stable; 8 Minor sixth, bittersweet; 9 Major sixth, warm and open; 10 Minor seventh, bluesy and unresolved; 11 Major seventh, dreamy, almost home; 12 Octave, the same note, higher. Selecting a chip calls playMelodic on root and upper note. Below the chips a large readout such as 'C to G · 7 half steps' in Unbounded with the two notes in their colors, then the piano. Pressing a piano key makes it the new bottom note. Helper: 'Press any key to move the bottom note.' Win task: 'Small win: play a perfect fifth. Press any key, then the key seven half steps above it.' On success, for two consecutive presses on this piano exactly 7 apart: 'Win 1. You found a perfect fifth: C up to G.' using the real notes.
   Layout: 12-column grid. Left 4 columns are sticky at top 96px and hold a 120px outlined numeral (transparent fill, 2px stroke), the title at 44px and the concept. Right 8 columns hold a panel-colored widget panel: chips in a 4-by-3 grid, then readout, then piano. Win bar spans the full container below, 72px tall, dashed 2px acid outline with the Lucide Trophy icon and task text. Chapter ground is stage. On mobile, one column, chips in a 2-by-6 grid with the feel text hidden until selected, and the left column is not sticky. An SVG arc above the piano joins root and upper note, labeled '7 half steps'; on mobile, when the two notes fall on different rows, replace the arc with a pill above the piano.
   Motion: The arc draws in with pathLength over 300 ms in the upper note's color. Selected chip fills with that note's color. Scroll reveal on the left text and panel.
6. **Chapter 2: Circle of fifths (id circle)** — Outlined numeral '02' in acid. Title: 'Fifths go in a circle.' Concept: 'Start anywhere and climb by perfect fifths. After twelve steps you are back where you began. Each step clockwise adds one sharp to the key; each step the other way adds one flat.' Second line: 'Keys next to each other share almost all their notes, which is why they sound like family.' Circle: SVG viewBox 600x600, center 300,300. Outer ring radius 200 to 290 with 12 wedges for the major keys in FIFTHS_ORDER, each 30 degrees with a 1.5 degree gap, filled in pitch color. Inner ring radius 130 to 200 with RELATIVE_MINORS in the same pitch color as their own root. Center disc radius 124 in pit, showing the selected key name in Unbounded with its signature in mono underneath ('3 sharps'), and acting as a play button for the scale. A fixed acid triangle above the ring marks the selected key at 12 o'clock. Selected, neighboring majors and the three neighboring minors stay at full fill with pit ink; all other wedges drop to 28% fill opacity with text-colored labels. Info panel: key name 'A major'; line 'Relative minor: F# minor'; signature 'Sharps: F# C# G#'; 7 scale note chips in color; 'Play scale' button (acid); 7 diatonic chord chips labeled I, ii, iii, IV, V, vi, vii° with the chord name beneath, such as 'V · E'. Tapping a chord chip strums it and sets the chord builder. Piano below shows the scale lit. Drag anywhere on the ring to turn it, tap a wedge to bring it to the top, or use Left and Right arrow keys when focused (role slider, aria-valuetext 'A major, 3 sharps'). Win task: 'Small win: turn the circle to the key with three sharps.' On success, from a user turn in this chapter: 'Win 2. A major: three sharps, F#, C# and G#.'
   Layout: Mirrored: widget left in 8 columns, text right in 4 columns, on the curtain ground. Inside the panel, a 520px circle sits left with the info panel right, and the piano spans the full panel below. On mobile, one column with text first, a 340px circle, then info, then piano. Hero uses the same component at 440px; at 216px on mobile it hides the inner ring. Win bar spans the full container below.
   Motion: Spring rotation with ticks as described in Design. Touch-action none on the ring. Selected wedge grows its outer radius to 298. Pressing a note on any piano pulses the matching wedge to full opacity for 300 ms.
7. **Chapter 3: Chord builder (id chords)** — Outlined numeral '03' in pc-F pink. Title: 'Stack notes, change the mood.' Concept: 'A chord is three or more notes played together. Move one note by one half step and the whole mood flips.' Widget: Root row with 12 color chips in chromatic order using DEFAULT_NAMES. Quality row with 9 chips: Major (0 4 7, bright and settled), Minor (0 3 7, soft and inward), Diminished (0 3 6, tight and unstable), Augmented (0 4 8, floating and unresolved), Sus2 (0 2 7, open, neither happy nor sad), Sus4 (0 5 7, leaning, wants to land), Dominant 7th (0 4 7 10, restless, pushes home), Major 7th (0 4 7 11, warm and dreamy), Minor 7th (0 3 7 10, mellow and smooth). Result block: large chord name 'C major' in Unbounded, mood line, note chips in color (C E G), each with interval label below (Root, Major 3rd, Perfect 5th; others Major 2nd, Minor 3rd, Perfect 4th, Diminished 5th, Augmented 5th, Minor 7th, Major 7th), then a mono formula 'Half steps: 4 + 3'. 'Strum' button (acid). Chord shape: 240px SVG ring of 12 dots in FIFTHS_ORDER with a polygon joining the chord's notes, filled in the root color at 35% with an acid stroke; caption 'The same chord type makes the same shape in every key.' Piano below with the chord lit, root in octave 4 and other notes above. Progressions row: 'Try it in [the selected key]' with three buttons, 'I V vi IV', 'ii V I', 'I IV V'. Each plays its chords in the selected key at 700 ms per chord, updating the chord block and piano as it goes. Any change of root or quality strums automatically. Win task: 'Small win: turn a major chord into a minor one.' On success, when quality changes from major to minor on the same root: 'Win 3. You lowered one note by a half step, E to Eb, and the mood changed.' using the real notes.
   Layout: Same left-text, right-panel layout as Chapter 1 on the stage ground. In the panel: root row full width, quality row full width in a 3-by-3 grid; then a two-column row with result block left and chord shape right; then piano; then progressions. On mobile, one column, root chips in a 6-by-2 grid, quality chips in a 2-column grid, chord shape 200px centered under the result.
   Motion: Chip stagger and polygon morph as described in Design. Triads repeat the last vertex so the polygon always has 4 points to morph between.
8. **Chapter 4: Ear-training quiz (id quiz)** — Outlined numeral '04' in pc-Gb teal. Title: 'Now use your ears.' Line: 'Eight rounds. Listen, then answer. You can replay each sound as often as you like.' Start button 'Start the quiz' (acid). Rounds in this data shape in content.ts, shuffled per attempt, with a random root between C4 and G4. 1 interval Major third, options Minor third, Major third, Perfect fourth, Perfect fifth; note 'A major third: four half steps, bright and settled.' 2 interval Perfect fifth, options Perfect fourth, Perfect fifth, Major sixth, Octave; note 'A perfect fifth: seven half steps, wide and stable.' 3 chord Major, options Major, Minor, Diminished, Augmented; note 'A major chord: a major third with a minor third on top.' 4 interval Minor third, options Minor third, Major third, Perfect fifth, Minor seventh; note 'A minor third: three half steps, soft and a little sad.' 5 chord Minor, options Major, Minor, Diminished, Augmented; note 'A minor chord: same outer notes as major, with the middle note a half step lower.' 6 interval Octave, options Perfect fifth, Major sixth, Minor seventh, Octave; note 'An octave: twelve half steps, the same note name, higher.' 7 interval Perfect fourth, options Major second, Perfect fourth, Tritone, Perfect fifth; note 'A perfect fourth: five half steps, open like a call.' 8 chord Dominant 7th, options Major 7th, Dominant 7th, Minor 7th, Sus4; note 'A dominant seventh: a major chord with a minor seventh on top, restless and ready to move.' Each round: a large round 'Play the sound' button with Lucide Play icon, mono 'Round 3 of 8 · Score 2', an 8-segment bar, 4 answer buttons. The piano stays hidden until the round is answered, so it cannot give away the answer; then it shows the notes in their colors. While a round is unanswered, the dock readout says 'Quiz: listen and answer' and its mini keyboard stays unlit. On answering, the chosen button turns acid with Lucide Check if right, or coral with Lucide X if wrong, and the right answer also turns acid. Show the note and a 'Next round' button. If muted, show 'Sound is off' with an inline 'Turn sound on' button in place of the play button. Results card: big score '6/8'; title 0 to 3 'Warming up', 4 to 6 'Your ears are waking up', 7 to 8 'Sharp ears'; a list of missed rounds, each with a replay button; 'Play again' (acid) reshuffles. Finishing eight rounds earns win 4: 'Win 4. You trained your ears for eight rounds.'
   Layout: A single centered panel with max width 880px on the curtain ground, with numeral and title centered above. The play button is 96px across and centered. Answer buttons in a single row of 4 on desktop and 2-by-2 on mobile, 64px tall. Segment bar spans the panel width; each segment fills acid for right and coral for wrong. Results card replaces the round view at the same size, with the score at 120px on desktop and 72px on mobile in Unbounded, in acid.
   Motion: Rounds slide left and fade in 250 ms using AnimatePresence. Wrong answers shake 6px twice in 240 ms. The play button emits an expanding ring in coral while sound plays. The results score counts up from 0 over 600 ms.
9. **Keep this: cheat sheet** — Heading: 'Keep this page open while you play.' Two lists. Left 'Intervals' with all 12 from Chapter 1: half-step count, name and feel. Right 'Chords' with all 9 qualities: name, half-step formula and mood. Every row has a small play button that plays it from the selected key's tonic and updates the dock.
   Layout: Stage ground, two columns on desktop and one on mobile. Rows are 52px tall with thin panel-colored dividers. The half-step number sits in mono in a 32px round chip tinted with the color of the note it lands on from the current tonic.
   Motion: Row hover background changes to panel in 120 ms.
10. **Instructor and school** — Eyebrow: 'Who wrote this lesson'. Heading: 'Taught by [INSTRUCTOR_NAME].' Bio: '[INSTRUCTOR_NAME] spent eleven years playing keys in touring bands before opening [BRAND] above a bike shop at 418 Marlow Street, Eastfield. She teaches the way she learned: by ear first, with the names right after.' Stats: '2,140 students since the first class', '10 seats per room', '86% finish all six classes'. Course heading: 'Six evenings on real keyboards.' Facts: 'Tuesdays and Thursdays, 7:30 to 9:00 pm', 'Room 2B, 418 Marlow Street', '$186 for all six, or $34 drop-in'. Numbered classes: 1 Intervals by ear; 2 Triads and inversions; 3 Keys and the circle; 4 Seventh chords; 5 Common progressions; 6 Write your own eight bars. Quotes: 'I stopped guessing at chords after two weeks. Now I name them on the bus.' Theo Lindqvist, night-shift nurse. 'I had played for years without knowing why anything worked. Class three fixed that.' Priya Venkataraman, wedding band guitarist.
   Layout: Curtain ground. Row 1: instructor-portrait.webp left in 5 columns at 3:4 with 28px radius and a 6px coral offset block behind it, bio and 3 large stats right in 7 columns. Row 2: evening-class.webp left in 6 columns at 4:3 with 28px radius, and on the right the course facts and a 2-by-3 grid of numbered class cards in panel color. Row 3: two quote cards side by side, with one acid fill and pit ink and one coral fill and pit ink. Stack everything on mobile.
   Motion: Scroll reveal only.
11. **FAQ** — Heading: 'Before you ask.' Q 'Do I need a piano?' A 'No. A laptop keyboard, a mouse or a phone screen is enough. If you own a keyboard, try each exercise on it afterward.' Q 'Do I have to read music?' A 'No. This lesson uses note names and half steps only, with no staff notation.' Q 'I hear nothing. What now?' A 'Browsers keep sound off until your first tap, so press a key once. Then check the Sound button at the top and the silent switch on your phone.' Q 'What does the evening course add?' A 'Real keyboards, a teacher listening to you, and live ear training in a room of ten. You also leave with eight bars you wrote yourself.'
   Layout: Stage ground, max width 880px, native details and summary rows with a Lucide Plus icon that rotates into a cross. First item open by default.
   Motion: Answer height animates over 200 ms; the icon rotates 45 degrees.
12. **Final band and footer** — Coral band heading in pit ink: 'Come play it in the room.' Line: 'New groups start the first Tuesday of each month. Call or write to save a seat.' Contact as text, with no form: '(555) 014-2277' and '[email protected]', rewritten for the brand when it changes. Button 'Replay the quiz' (pit fill with text color) links to #quiz. Footer in pit: [BRAND], address, hours 'Office open Monday to Friday, 4 to 7 pm', anchor links, 'All sounds in this lesson are made live in your browser.', then the optional [CREDIT] link.
   Layout: Band is full-bleed coral with a two-column layout: text left at 55%, keys-closeup.webp right at 45%, full band height with no radius, on desktop. On mobile the photo sits above the text at 16:9. Footer is 3 columns on desktop and stacked on mobile, with padding that clears the dock.
   Motion: Scroll reveal on the heading only.

## Assets
- image: Download https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/hero-stage.webp to public/images/hero-stage.webp. Alt: 'An empty small club stage at night, hazy with ultraviolet light and crossed by a coral beam'. Used as the hero background. Generated by VibeFather with qwen-image-3.0-pro, redistributable with this template.
- image: Download https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/instructor-portrait.webp to public/images/instructor-portrait.webp. Alt: 'The instructor at a keyboard on a small stage, seen from behind under violet and coral light'. A fictional AI-generated person, used in the instructor section as a placeholder to swap for a real photo. Generated by VibeFather with qwen-image-3.0-pro, redistributable with this template.
- image: Download https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/evening-class.webp to public/images/evening-class.webp. Alt: 'Adult students seen from behind, practicing at small keyboards in a dim violet rehearsal room'. Used beside the course facts. Generated by VibeFather with qwen-image-3.0-pro, redistributable with this template.
- image: Download https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/keys-closeup.webp to public/images/keys-closeup.webp. Alt: 'A close view of piano keys glowing under coral and ultraviolet stage light'. Used in the final band. Generated by VibeFather with qwen-image-3.0-pro, redistributable with this template.
- image: Draw all interactive graphics in code as inline SVG or HTML: piano, circle of fifths, chord shape ring, stage beams, mini keyboard, pinwheel mark and favicon. Original work for this template; note them as code-drawn in ASSETS.md.
- icon: Lucide icons through the lucide-react package (ISC): Volume2, VolumeX, Play, Check, X, Plus, Trophy, RotateCcw.
- font: Self-host Unbounded, Figtree and JetBrains Mono through the listed @fontsource-variable packages (OFL-1.1), imported in src/main.tsx. List each one in ASSETS.md.

## Don'ts
- No backend: no server code, API routes, databases, auth, third-party APIs, analytics, or forms that submit anywhere. The contact details are plain text.
- Static output only in dist/, built with npm run build, using relative asset paths (Vite base './'). Minified, no source maps, no src/ copied into dist/, total under 20 MB.
- Keep this as one page, index.html. In-page links use anchors (#quiz); any link to a file uses a file name, never a bare directory.
- Self-host every font through the listed Fontsource packages. Never load fonts from fonts.googleapis.com, fonts.gstatic.com or any other CDN. No CDN script or link tags. Download every image into the project; never hotlink.
- Keep all copy, sample data, win tasks and quiz rounds in src/content.ts. When variable values change, rewrite that file so no default brand, person or topic remains. The widgets, layout, colors and motion stay the same.
- No audio files of any kind: no samples, recordings or sound fonts. All sound is synthesized in the browser with oscillators.
- Do not create or resume an AudioContext before a user gesture, and never autoplay sound on load. The page must run with zero console errors or warnings at 1440x900 and 390x844.
- No instrument maker names or logos on the piano, in images or anywhere else.
- No melodies, riffs or chord charts from existing songs, as examples or in the quiz, and no 'sounds like the start of' song references. Use only intervals, scales and generic progressions.
- No lesson text, diagrams or exercise wording from existing theory sites, books or courses. Use the copy in this prompt.
- No commercial music notation fonts, no staff notation, and no music glyph characters; write accidentals as # and b.
- No Aceternity UI, Tailwind Plus or other restricted UI library source, and no audio or piano component libraries; write the widgets yourself.
- No likeness of real musicians or teachers. The instructor image shows a fictional AI-generated person. No named mascots or characters from music education apps or games.
- No off-white or cream page sections. The whole page stays on the ultraviolet and violet grounds, apart from the coral band.
- Respect prefers-reduced-motion as described in Design, and keep body text at WCAG AA contrast. Never put text-colored labels on bright note colors; use pit ink #120634 there.
- No horizontal page scrolling at any width, and no fixed dock covering the piano or answer buttons.
- List every third-party file in ASSETS.md at the project root with path, source URL, author and license. No mention of VibeFather inside the site except the optional [CREDIT] footer link.

---
— Prompt by VibeFather · https://vibefather.ai/t/music-theory-interactive-lesson · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# 乐理互动课程

完全按照以下描述构建此网站。将 [VARIABLES] 替换为你自己的值;其余内容保持不变。

## 简介
为 [BRAND](一所虚构的夜间音乐学校)构建一个单页交互式乐理课程,主题为“[LESSON_TOPIC]”。页面是一段长滚动,重复固定的节奏:简短概念、动手小工具、小小成就。页面包含一架由 Web Audio 振荡器发声的可弹奏双八度钢琴、一个旋转的 SVG 五度圈、一个会点亮音符并命名音程的和弦构建器、一个带评分的八轮听力训练测验,以及一个关于讲师和学校的收尾部分。所有小工具读取同一份共享状态,十二个音级颜色在各处保持一致,因此颜色本身就在传授音程关系。以下文案按默认值撰写。如果这些值发生变化,请在一个内容文件中重写所有文案以适配它们,并保持小工具、布局、颜色和动效完全不变。

- 受众:[AUDIENCE]。他们可能不识五线谱,也可能没有乐器;一台笔记本电脑键盘或一部手机就足够。
- 目标:访客在十秒内按下琴键,听到声音并看到乐理作出响应。到页面结束时,他们能凭听觉说出常见音程和和弦的名称,已获得四个小小成就和一个测验分数,并了解 [BRAND] 晚间课程提供什么。
- 语气:俏皮、大胆、直白,像一位在夜晚小舞台上的好老师。句子简短。用日常语言描述声音听起来如何。绝不学术化,绝不为了可爱而可爱。

## 技术栈
- 框架:Vite 5 + React 18 + TypeScript
- 样式:Tailwind CSS 3.4
- 库:react (MIT)、react-dom (MIT)、motion (MIT)、lucide-react (ISC)、@fontsource-variable/unbounded (OFL-1.1)、@fontsource-variable/figtree (OFL-1.1)、@fontsource-variable/jetbrains-mono (OFL-1.1)、vite (MIT)、@vitejs/plugin-react (MIT)、tailwindcss (MIT)、postcss (MIT)、autoprefixer (MIT)、typescript (Apache-2.0)
- 构建:`npm run build` → 静态文件输出到 `dist/`。无后端、无服务端代码、无外部 API。
- 设置:
  - vite.config.ts:将 base 设为 './',build.sourcemap 设为 false。从 'motion/react' 导入 Motion。
  - 文件布局:src/content.ts(所有文案、示例数据、胜利任务、测验轮次)、src/theory.ts(音符表、音阶、和弦拼写)、src/audio.ts(Web Audio 引擎)、src/store.tsx(React context 加 useReducer,不使用状态库)、src/components/(Piano、CircleOfFifths、IntervalPicker、ChordBuilder、ChordShape、Quiz、WinBar、Dock、TopBar)、src/App.tsx。图片放在 public/images/。
  - 将设计部分中的颜色和字体按给定名称添加到 tailwind.config 的 theme.extend 中,并从 src/theory.ts 导出相同的音高颜色表,作为按音级 0 到 11 索引的类型化数组。
  - 音符表:按音级的 DEFAULT_NAMES = C、Db、D、Eb、E、F、F#、G、Ab、A、Bb、B。所有地方都用普通 # 和 b 字符书写变音记号,不使用音乐符号。从顶部顺时针的 FIFTHS_ORDER = C、G、D、A、E、B、F#、Db、Ab、Eb、Bb、F。相同顺序的 RELATIVE_MINORS = Am、Em、Bm、F#m、C#m、G#m、D#m、Bbm、Fm、Cm、Gm、Dm。
  - 音阶拼写表:C = C D E F G A B;G = G A B C D E F#;D = D E F# G A B C#;A = A B C# D E F# G#;E = E F# G# A B C# D#;B = B C# D# E F# G# A#;F# = F# G# A# B C# D# E#;Db = Db Eb F Gb Ab Bb C;Ab = Ab Bb C Db Eb F G;Eb = Eb F G Ab Bb C D;Bb = Bb C D Eb F G A;F = F G A Bb C D E。调号:C 无;G 1 个升号;D 2 个升号;A 3 个升号;E 4 个升号;B 5 个升号;F# 6 个升号;Db 5 个降号;Ab 4 个降号;Eb 3 个降号;Bb 2 个降号;F 1 个降号。
  - 和弦拼写函数:从根音名开始,每个音级向上取相应步数的字母(2 度 +1,3 度 +2,4 度 +3,5 度 +4,7 度 +6),然后添加所需的 # 或 b 字符以达到该音级。重降写作 bb,例如 Ebdim = Eb Gb Bbb。
  - src/audio.ts:在首次 pointerdown 或 keydown 处理程序中惰性创建一个 AudioContext,并在那里调用 resume();页面加载时绝不触碰音频。图:各声部 → 低通 BiquadFilter(3200 Hz,Q 0.6)→ 主 GainNode(0.7)→ DynamicsCompressor → destination。每个声部是一个音符频率的三角波振荡器加上一个高八度的正弦波(增益 0.25),通过声部增益,起音 0.008 s 到峰值 0.5,衰减 0.25 s 到延音 0.28,释放 0.35 s。十二平均律,A4 = 440 Hz。限制为 10 个声部,抢占最旧的。静音时在 20 ms 内将主增益渐变到 0,取消静音时恢复到 0.7。
  - src/audio.ts 中的播放辅助函数:playNote(midi, ms);playMelodic(midis),音符之间间隔 450 ms,然后所有音符一起持续 900 ms;strum(midis),音符之间间隔 45 ms,保持 1200 ms;playScale(midis),音符之间间隔 170 ms;tick(midi),一个 60 ms 的音符,增益 0.15。每个辅助函数还向 store 报告音符的开和关,以便每个钢琴同步点亮。每个都接受一个 silent 标志来跳过此报告;测验播放使用它直到该轮被回答,这样 dock 就无法泄露答案。
  - src/store.tsx 状态:selectedKey(FIFTHS_ORDER 的索引,从 [START_KEY] 开始)、activeNotes(当前发声的 midi 编号集合)、interval {rootMidi, semitones: 7}、chord {rootName, quality: 'major'}、lastEvent {label, midis, playback}、wins [false, false, false, false]、muted false、heroPlayed(在 hero 钢琴上按下的最后两个 midi 音符)。dock、顶栏和所有钢琴都从这个单一 store 读取。
  - 链接规则:(1) 更改 selectedKey 将 interval.rootMidi 设置为第 4 八度的主音,并将 chord.rootName 设置为主音,保持品质不变。(2) 在和弦构建器中选择根音芯片或品质会旋转圆圈:对于大调、属 7 和弦、大 7 和弦、增和弦和挂留和弦,旋转到根音自己的扇区;对于小调、小 7 和弦和减和弦,旋转到其内部扇区具有该根音的大调(根音 + 3 个半音)。此旋转不得覆盖触发它的和弦,因此传递一个 source 标志。(3) 圆圈面板中的自然音阶和弦芯片设置和弦构建器并保持圆圈位置不变。(4) 在 hero 钢琴上按下会将 selectedKey 设置为该音级。在 Chapter 1 钢琴上按下会将 interval.rootMidi 设置为第 4 八度的该音级,并保持 selectedKey 不变。在其他钢琴上按下仅播放并脉冲匹配的圆圈扇区。
  - 窗口 keydown 上的键盘映射,忽略 e.repeat、任何修饰键以及输入框内的焦点:A=C、W=C#、S=D、E=D#、D=E、F=F、T=F#、G=G、Y=G#、H=A、U=A#、J=B、K=C 高一个八度、O=C# 高、L=D 高、P=D# 高、;=E 高、'=F 高。基础八度从 4 开始;Z 将其设为 4,X 将其设为 5;高于 B5 的音符被忽略。按下算作在当前视图中的 hero 或 chapter 钢琴上按下(用 IntersectionObserver 跟踪);在其他任何地方仅播放音符。
  - npm 脚本:dev、build(tsc --noEmit && vite build)、preview。添加 public/favicon.svg,一个使用音符颜色的 12 扇区风车,以及一个纯标题 '[BRAND] | [LESSON_TOPIC]'。

## 变量
- [BRAND] — 学校或课程品牌(默认:"Overtone Night School")。一个虚构名称。显示在顶部栏、讲师部分、最终横幅和页脚中。
- [LESSON_TOPIC] — 课程主题(默认:"Intervals and chords")。设置主视觉眉题和章节文案。钢琴、圆圈、和弦构建器和测验保持不变;根据需要重新排列和弦列表和测验轮次。
- [AUDIENCE] — 课程面向的人群(默认:"Beginners who play by ear and want to name what they hear")。影响主视觉引导语和 FAQ。
- [START_KEY] — 起始调(默认:"C")。可选 C、G、D、A、E、B、F#、Db、Ab、Eb、Bb、F 之一。圆圈、音程根音和和弦构建器从此处开始。
- [INSTRUCTOR_NAME] — 讲师姓名(默认:"Marisol Adeyemi")。一个虚构人物。如果使用真实姓名,请将肖像替换为你自己的照片。
- [CREDIT] — 在页脚保留一个小型 "Template by VibeFather" 链接指向 https://vibefather.ai/t/music-theory-interactive-lesson(默认:是;删除此行即可移除)

页面与区块下的文案是为默认值编写的。如果你的值不同,请为它们重写每个标题、段落、标签和图片——保持相同的长度、语气和结构。布局、颜色、字体和动效保持所述不变。
将所有文案、图片路径和链接放在一个内容文件中(例如 `src/content.ts`),按区块作为键,以便日后无需改动组件即可替换内容。

## 设计
### 颜色
- stage `#1B0B4B` — 深紫外色页面底色;hero 遮罩色调与奇数章节
- pit `#120634` — 顶栏、dock 和页脚的最深底色,以及所有亮色填充上的文字色
- curtain `#2A0F73` — 偶数章节的高饱和紫罗兰底色
- panel `#351A8C` — 小组件面板与卡片
- coral `#FF5A47` — 电光珊瑚色:次要按钮、错误答案、最终条带、第 1 章强调色。必须在 hero 中大面积出现
- acid `#E6FF2E` — 酸性黄:主要按钮、胜利条、正确答案、圆形指针、焦点环。必须在 hero 中大面积出现
- text `#F6F1FF` — 深色底色上的正文与标题文字
- muted `#C9BEF2` — 深色底色上的次要文字
- ivory-key `#F1EBFF` — 淡丁香色的自然钢琴键
- pc-C `#FF5A47` — 音级 C
- pc-G `#FF8A2B` — 音级 G
- pc-D `#FFC21F` — 音级 D
- pc-A `#E6FF2E` — 音级 A
- pc-E `#8CF23C` — 音级 E
- pc-B `#2EE87F` — 音级 B
- pc-Gb `#1FE5C4` — 音级 F#/Gb
- pc-Db `#29C9FF` — 音级 C#/Db
- pc-Ab `#6FA3FF` — 音级 G#/Ab
- pc-Eb `#A98BFF` — 音级 D#/Eb
- pc-Bb `#E872FF` — 音级 A#/Bb
- pc-F `#FF5CB0` — 音级 F

### 字体排印
- 展示字体:标题、章节数字、和弦与调名。字重 800,行高 1.04,字距 -0.02em。:Unbounded Variable(OFL),字重 500/800
- 正文字体:桌面端正文 18px、移动端 16px,行高 1.55;按钮字重 700。:Figtree Variable(OFL),字重 400/500/700
- 等宽字体:琴键上的音名、半音数、得分、键帽、12 至 14px 的小标签,标签为单词时使用大写并加 0.08em 字距。:JetBrains Mono Variable(OFL),字重 500/700

### 布局与动效
- 间距:基础单位 8px。页面容器最大宽度 1320px,桌面端两侧留白 40px,移动端 16px。章节在桌面端使用 120px 垂直内边距,移动端 72px。小组件面板在桌面端使用 32px 内边距,移动端 16px。面板组之间的间距为 24px。
- 圆角:面板 28px,卡片 20px,按钮与标签完全圆角(999px),钢琴键顶部为直角、白键底部 10px、黑键底部 6px。
- 动效:舞台光束:每次按下 hero 钢琴键时,一道该音符颜色的垂直光束从琴键升至 hero 顶部,宽度为 2 个键宽,带线性渐变淡出至透明,scaleY 从 0 到 1 用时 120 ms,随后在 600 ms 内淡出。多道光束可以重叠。这是标志性效果。
- 动效:按键:按下的琴键在 60 ms 内下移 3px,其填充变为该音级颜色,并带有该颜色的柔和外发光。松开后在 140 ms 内复位。
- 动效:圆形旋转:使用 Motion 弹簧,刚度 180、阻尼 22,吸附到最近的 30 度,走最短路径。拖动时,旋转直接跟随指针,每当新的扇形越过指针时播放一次 tick()。扇形标签反向旋转以保持直立。
- 动效:胜利条:虚线轮廓在 350 ms 内以酸性黄从左向右填充,对勾图标以弹簧效果弹出(scale 0.4 到 1),顶栏的胜利计数弹到 scale 1.2 再恢复。
- 动效:和弦变化:标签以 40 ms 错峰动画进入,上移 8px 并淡入;和弦形状多边形以弹簧效果(刚度 140,阻尼 18)变形到新的顶点。
- 动效:滚动显现:章节文字与面板在进入视口时上移 24px 并淡入一次,用时 500 ms。
- 动效:hero 待机:加载时,一道 2.4 s 的光波从左向右扫过钢琴的色条,仅一次,无声音。
- 动效:在 prefers-reduced-motion 下:无光束、光波或滚动显现。圆形无弹簧直接跳到其位置,按键仅改变颜色。声音和所有小组件仍然可用。
- 图像:夜晚的舞台。四张风格统一的照片(紫外薄雾、珊瑚色主光、细酸性黄点缀)为 hero、讲师、晚间课程和最终条带定下基调。所有可交互元素均以 SVG 和 HTML 绘制:钢琴、圆形、和弦形状和色条。乐器不带有制作者名称。

## 页面与区块
### [BRAND] | [LESSON_TOPIC] (`index.html`)
1. **共享布局:顶栏与停靠栏** — 顶栏:左侧,一个 24px 的风车图案,由十二个音符色楔形组成,加上 Unbounded 500 字体的 '[BRAND]'。中间,锚点链接 'Intervals'(#intervals)、'Circle'(#circle)、'Chords'(#chords)、'Quiz'(#quiz)。右侧,一个等宽字体胶囊显示 '0/4 wins' 并递增计数,以及一个圆形声音按钮,使用 Lucide Volume2 或 VolumeX,可见标签为 'Sound on' 或 'Sound off'。停靠栏:固定底部栏,包含一个静态迷你键盘,显示当前点亮或发声的音符,一个等宽字体读数显示 lastEvent.label,例如 'C major chord: C E G' 或 'G major scale' 或 'E4',一个圆形 Lucide Play 按钮用于重放 lastEvent,以及同样的声音按钮。在任何事件之前,读数显示 'Press any key'。
   布局:顶栏为粘性定位,桌面端高 64px,移动端高 56px,pit 背景 85% 不透明度并带背景模糊。移动端隐藏中间链接和 'Sound on' 标签,保留图标和胜利胶囊。停靠栏桌面端高 64px,移动端高 56px,带 pit 背景和 1px 面板色顶部边框。迷你键盘桌面端为 SVG 336x40,移动端为 150x32。Body 获得匹配的底部内边距,使停靠栏永不覆盖内容。
   动效:停靠栏在 hero 离开视口后 200 ms 滑入(IntersectionObserver),hero 返回时滑走。停靠栏的迷你键立即变色。
2. **Hero** — 等宽字体 acid 色眉题:'[LESSON_TOPIC] · a free lesson from [BRAND]'。标题强制换行:'Press a key. / Hear why / it works.',其中 'Hear why' 为 acid 色,其余为文本色。导语:'For beginners who play by ear and want to name what they hear. Four short chapters, about 20 minutes, no sign-up.' 主按钮 'Start the lesson'(acid 色,链接到 #intervals)。次按钮 'Jump to the quiz'(coral 填充配 pit 墨色,链接到 #quiz)。按钮下方的等宽字体标签仅在桌面端显示:'4 chapters'、'20 minutes'、'Keyboard, mouse or touch'。右侧:五度圈。所有内容下方:完整的两个八度钢琴,从 C4 到 B5,正上方有一行实时读数。任何按键前的读数:'Press any key, or try A S D F G H J on your keyboard.' 按一次后:'E4. Now press another key.' 按两次后:'E4 to B4: perfect fifth, 7 half steps.' 使用第 1 章的音程名称。以任一方向计算距离。超过一个八度时,将音程缩减到一个八度内并加上 'plus an octave'。同一个音两次读数 'E4 again: same note.'
   布局:最小高度 100svh。全出血背景照片 hero-stage.webp,object-fit cover 并带遮罩:线性渐变从左侧 pit 88% 到右侧 stage 45%,以及底部 40% 区域 pit 90%。在圆圈后方添加一个大的模糊 coral 径向光晕(600px),在照片左上角添加一个 acid 光晕(360px),两者都清晰可见。在 1440x900 下:钢琴上方两列,左列 58% 放置文本,标题字号 clamp(36px, 4.6vw, 66px),右列 42% 放置一个 440px 的圆圈居中。钢琴横跨容器全宽位于屏幕底部,高度 clamp(170px, 23vh, 210px),使整个构图在 900px 内无需滚动即可容纳。移动端 390x844:单列,顺序为眉题、标题、导语、仅主按钮、216px 圆圈(仅外环)、读数,然后钢琴分两行(C4 到 B4,然后 C5 到 B5),每行高 88px,7 个自然键横跨全宽。所有内容必须在约 844px 内容纳。
   动效:每次按键时舞台光束,加上加载时的空闲波浪。第一次按键还使圆圈转到该音级,因此构图可见地响应。标题行在加载时以 60 ms 交错显现。
3. **钢琴组件(用于 hero 和全部四个章节)** — 24 个键,C4 到 B5。自然键为 ivory-key,底部有 14px 色条,颜色为其音高色,并在色条上方以等宽字体 pit 墨色显示音符字母。升号为 pit 色,带 8px 色条,仅在点亮时显示其名称。点亮的音符(音阶、音程或和弦)填充音高色,并显示当前音阶或和弦的拼写,例如 G 大调中的 F# 或 C 小调中的 Eb。正在发声的音符也获得光晕。在桌面端且存在支持悬停的指针时,在每个键上以微小等宽字体帽显示计算机键字母,并带当前八度映射。
   布局:一个圆角 pit 托盘,12px 内边距。自然键各占宽度的 1/14;升号为自然键宽度的 62% 和高度的 62%,居中于间隙并带通常的轻微偏移。章节钢琴桌面端高 180px。移动端,两行各 7 个自然键,每行高 110px,间隙 8px。
   动效:使用 Pointer Events 而不使用 setPointerCapture:跟踪每个 pointerId 到 midi 音符,使多点触控和弦工作,并让鼠标滑奏在 pointermove 上使用 elementFromPoint。在键上应用 touch-action: none。每个键是真实按钮,带 aria-label 例如 'C sharp 4';Enter 或 Space 播放它。
4. **颜色键带** — 小标题:'Every note has a color.' 行:'It keeps that color on this whole page. Neighbors in this row are a perfect fifth apart, so colors that look close also sound close.' 然后 12 个圆形芯片按 FIFTHS_ORDER 排列,填充其音高色并以等宽字体 pit 墨色命名。点击芯片播放该音符的第 4 八度。
   布局:全宽 pit 带,48px 垂直内边距。桌面端文本位于左侧 4 列,12 个芯片在剩余 8 列中排成一行,每个宽 56px。移动端文本堆叠在 6x2 芯片网格上方。
   动效:芯片在播放时以弹簧效果缩放到 1.12。
5. **第 1 章:音程(id intervals)** — coral 色描边数字 '01'。标题:'Intervals are distances.' 概念:'An interval is the gap between two notes, counted in half steps. One half step is the very next key, black or white. Count seven from C and you land on G.' 第二行:'Each gap has its own feel. Learn the feel first and the names follow.' 组件:12 个芯片按顺序排列,每个带等宽字体半音数、短名称和感觉:1 小二度,紧张如屏息;2 大二度,向前一步;3 小三度,柔和略带忧伤;4 大三度,明亮而安定;5 纯四度,开阔如呼唤;6 三全音,不安且想要移动;7 纯五度,宽广而稳定;8 小六度,苦甜参半;9 大六度,温暖而开阔;10 小七度,蓝调且未解决;11 大七度,梦幻,几乎到家;12 八度,同一个音,更高。选择芯片在根音和高音上调用 playMelodic。芯片下方一个大读数例如 'C to G · 7 half steps',使用 Unbounded 字体,两个音符以各自颜色显示,然后是钢琴。按下钢琴键使其成为新的底音。辅助提示:'Press any key to move the bottom note.' 胜利任务:'Small win: play a perfect fifth. Press any key, then the key seven half steps above it.' 成功时,对于此钢琴上连续两次恰好相隔 7 的按键:'Win 1. You found a perfect fifth: C up to G.' 使用真实音符。
   布局:12 列网格。左侧 4 列在顶部 96px 处粘性定位,放置 120px 描边数字(透明填充,2px 描边)、44px 标题和概念。右侧 8 列放置面板色组件面板:芯片在 4x3 网格中,然后读数,然后钢琴。胜利栏横跨容器全宽位于下方,高 72px,虚线 2px acid 描边,带 Lucide Trophy 图标和任务文本。章节地面为 stage。移动端,单列,芯片在 2x6 网格中,感觉文本在选择前隐藏,左列不粘性。钢琴上方一个 SVG 弧线连接根音和高音,标记为 '7 half steps';移动端,当两个音符落在不同行时,用钢琴上方的胶囊替代弧线。
   动效:弧线以 pathLength 在 300 ms 内以高音的颜色绘制。选中的芯片填充该音符的颜色。左侧文本和面板滚动显现。
6. **第 2 章:五度圈(id circle)** — 酸色的描边数字 '02'。标题:'Fifths go in a circle.' 概念:'Start anywhere and climb by perfect fifths. After twelve steps you are back where you began. Each step clockwise adds one sharp to the key; each step the other way adds one flat.' 第二行:'Keys next to each other share almost all their notes, which is why they sound like family.' 圆环:SVG viewBox 600x600,中心 300,300。外环半径 200 到 290,包含 12 个楔形,对应 FIFTHS_ORDER 中的大调,每个 30 度,间隔 1.5 度,用音高颜色填充。内环半径 130 到 200,包含 RELATIVE_MINORS,使用与其自身根音相同的音高颜色。中心圆盘半径 124,颜色为 pit,用 Unbounded 显示所选调名,下方用 mono 显示其调号('3 sharps'),并作为音阶的播放按钮。圆环上方一个固定的酸色三角形在 12 点钟方向标记所选调。选中的、相邻的大调和三个相邻的小调保持完整填充,使用 pit 墨色;所有其他楔形降至 28% 填充不透明度,标签使用文本色。信息面板:调名 'A major';行 'Relative minor: F# minor';调号 'Sharps: F# C# G#';7 个音阶音符色块;'Play scale' 按钮(酸色);7 个自然音阶和弦色块,标记为 I、ii、iii、IV、V、vi、vii°,下方为和弦名,例如 'V · E'。点击和弦色块会扫弦并设置和弦构建器。下方钢琴显示点亮的音阶。在圆环上任意位置拖动可旋转,点击楔形将其转到顶部,或在聚焦时使用左右方向键(role slider,aria-valuetext 'A major, 3 sharps')。胜利任务:'Small win: turn the circle to the key with three sharps.' 成功时,来自本章中的用户回合:'Win 2. A major: three sharps, F#, C# and G#.'
   布局:镜像:小组件在左侧占 8 列,文本在右侧占 4 列,位于 curtain 底色上。面板内部,520px 的圆环在左,信息面板在右,钢琴横跨面板下方全宽。移动端为单列,文本在前,340px 圆环,然后信息,然后钢琴。Hero 使用同一组件,尺寸 440px;移动端 216px 时隐藏内环。胜利栏横跨下方整个容器。
   动效:如设计所述,带刻度的弹簧旋转。圆环上 touch-action none。选中的楔形外半径增大到 298。按下任意钢琴上的音符会使匹配的楔形脉冲至完全不透明度,持续 300 ms。
7. **第 3 章:和弦构建器(id chords)** — pc-F 粉色的描边数字 '03'。标题:'Stack notes, change the mood.' 概念:'A chord is three or more notes played together. Move one note by one half step and the whole mood flips.' 小组件:根音行有 12 个色块,按半音顺序使用 DEFAULT_NAMES。性质行有 9 个色块:Major(0 4 7,明亮而稳定)、Minor(0 3 7,柔和而内敛)、Diminished(0 3 6,紧张而不稳定)、Augmented(0 4 8,漂浮而未解决)、Sus2(0 2 7,开放,既不快乐也不悲伤)、Sus4(0 5 7,倾斜,想要落地)、Dominant 7th(0 4 7 10,不安,推动回家)、Major 7th(0 4 7 11,温暖而梦幻)、Minor 7th(0 3 7 10,醇厚而顺滑)。结果块:大号和弦名 'C major' 使用 Unbounded,情绪行,音符色块(C E G),每个下方有音程标签(Root、Major 3rd、Perfect 5th;其他为 Major 2nd、Minor 3rd、Perfect 4th、Diminished 5th、Augmented 5th、Minor 7th、Major 7th),然后 mono 公式 'Half steps: 4 + 3'。'Strum' 按钮(酸色)。和弦形状:240px SVG 圆环,12 个点按 FIFTHS_ORDER 排列,多边形连接和弦的音符,用根音颜色以 35% 填充,酸色描边;说明文字 'The same chord type makes the same shape in every key.' 下方钢琴显示点亮的和弦,根音在八度 4,其他音符在上方。进行行:'Try it in [the selected key]',三个按钮,'I V vi IV'、'ii V I'、'I IV V'。每个按钮以所选调播放其和弦,每个和弦 700 ms,播放时更新和弦块和钢琴。根音或性质的任何变化都会自动扫弦。胜利任务:'Small win: turn a major chord into a minor one.' 成功时,当同一根音上性质从大调变为小调:'Win 3. You lowered one note by a half step, E to Eb, and the mood changed.' 使用真实音符。
   布局:与第 1 章相同的左文本、右面板布局,位于 stage 底色上。面板中:根音行全宽,性质行全宽,3×3 网格;然后两列行,结果块在左,和弦形状在右;然后钢琴;然后进行。移动端为单列,根音色块 6×2 网格,性质色块 2 列网格,和弦形状 200px 居中于结果下方。
   动效:如设计所述,色块交错和 polygon 变形。三和弦重复最后一个顶点,使 polygon 始终有 4 个点可变形。
8. **第 4 章:听力训练测验(id quiz)** — pc-Gb 青色的描边数字 '04'。标题:'Now use your ears.' 行:'Eight rounds. Listen, then answer. You can replay each sound as often as you like.' 开始按钮 'Start the quiz'(酸色)。轮次在 content.ts 中采用此数据形状,每次尝试打乱,根音在 C4 到 G4 之间随机。1 音程 Major third,选项 Minor third、Major third、Perfect fourth、Perfect fifth;注释 'A major third: four half steps, bright and settled.' 2 音程 Perfect fifth,选项 Perfect fourth、Perfect fifth、Major sixth、Octave;注释 'A perfect fifth: seven half steps, wide and stable.' 3 和弦 Major,选项 Major、Minor、Diminished、Augmented;注释 'A major chord: a major third with a minor third on top.' 4 音程 Minor third,选项 Minor third、Major third、Perfect fifth、Minor seventh;注释 'A minor third: three half steps, soft and a little sad.' 5 和弦 Minor,选项 Major、Minor、Diminished、Augmented;注释 'A minor chord: same outer notes as major, with the middle note a half step lower.' 6 音程 Octave,选项 Perfect fifth、Major sixth、Minor seventh、Octave;注释 'An octave: twelve half steps, the same note name, higher.' 7 音程 Perfect fourth,选项 Major second、Perfect fourth、Tritone、Perfect fifth;注释 'A perfect fourth: five half steps, open like a call.' 8 和弦 Dominant 7th,选项 Major 7th、Dominant 7th、Minor 7th、Sus4;注释 'A dominant seventh: a major chord with a minor seventh on top, restless and ready to move.' 每轮:一个大的圆形 'Play the sound' 按钮,带 Lucide Play 图标,mono 'Round 3 of 8 · Score 2',一个 8 段条,4 个答案按钮。钢琴在轮次回答前保持隐藏,以免泄露答案;然后显示音符及其颜色。轮次未回答时,dock 读数显示 'Quiz: listen and answer',其迷你键盘保持不亮。回答时,所选按钮若正确变为酸色并带 Lucide Check,若错误变为珊瑚色并带 Lucide X,正确答案也变为酸色。显示注释和 'Next round' 按钮。若静音,显示 'Sound is off',并在播放按钮位置显示内联 'Turn sound on' 按钮。结果卡:大分数 '6/8';标题 0 到 3 'Warming up',4 到 6 'Your ears are waking up',7 到 8 'Sharp ears';错过轮次列表,每个带重播按钮;'Play again'(酸色)重新打乱。完成八轮获得胜利 4:'Win 4. You trained your ears for eight rounds.'
   布局:单个居中面板,最大宽度 880px,位于 curtain 底色上,数字和标题居中在上方。播放按钮直径 96px 并居中。答案按钮桌面端单行 4 个,移动端 2×2,高 64px。段条横跨面板宽度;每段正确填充酸色,错误填充珊瑚色。结果卡以相同尺寸替换轮次视图,分数桌面端 120px、移动端 72px,使用 Unbounded,酸色。
   动效:轮次使用 AnimatePresence 向左滑动并淡入 250 ms。错误答案在 240 ms 内抖动 6px 两次。播放按钮在声音播放时发出珊瑚色扩散环。结果分数在 600 ms 内从 0 计数上升。
9. **保留此页:速查表** — 标题:'Keep this page open while you play.' 两个列表。左侧 'Intervals' 包含第 1 章的全部 12 个:半音数、名称和感觉。右侧 'Chords' 包含全部 9 种性质:名称、半音公式和情绪。每行有一个小播放按钮,从所选调的主音播放并更新 dock。
   布局:stage 底色,桌面端两列,移动端一列。行高 52px,带细面板色分隔线。半音数字以 mono 显示在 32px 圆形色块中,色块着色为从当前主音到达的音符颜色。
   动效:行悬停背景在 120 ms 内变为 panel。
10. **讲师与学校** — 眉题:'Who wrote this lesson'。标题:'Taught by [INSTRUCTOR_NAME]。' 简介:'[INSTRUCTOR_NAME] 在组建巡演乐队弹了十一年键盘,之后在 Eastfield 的 Marlow Street 418 号一家自行车店楼上开了 [BRAND]。她教的方式就是她学的方式:先靠耳朵,随后再记名称。' 数据:'2,140 students since the first class'、'10 seats per room'、'86% finish all six classes'。课程标题:'Six evenings on real keyboards。' 事实:'Tuesdays and Thursdays, 7:30 to 9:00 pm'、'Room 2B, 418 Marlow Street'、'$186 for all six, or $34 drop-in'。编号课程:1 Intervals by ear;2 Triads and inversions;3 Keys and the circle;4 Seventh chords;5 Common progressions;6 Write your own eight bars。引语:'I stopped guessing at chords after two weeks. Now I name them on the bus.' Theo Lindqvist,夜班护士。'I had played for years without knowing why anything worked. Class three fixed that.' Priya Venkataraman,婚礼乐队吉他手。
   布局:Curtain 底色。第 1 行:instructor-portrait.webp 居左占 5 列,比例 3:4,圆角 28px,后方有 6px 珊瑚色偏移块;简介和 3 个大型数据居右占 7 列。第 2 行:evening-class.webp 居左占 6 列,比例 4:3,圆角 28px;右侧是课程事实和 2×3 网格的编号课程卡片,使用 panel 色。第 3 行:两张引语卡片并排,一张 acid 填充配 pit 墨色,一张 coral 填充配 pit 墨色。移动端全部堆叠。
   动效:仅滚动显现。
11. **FAQ** — 标题:'Before you ask。' 问 'Do I need a piano?' 答 'No. A laptop keyboard, a mouse or a phone screen is enough. If you own a keyboard, try each exercise on it afterward.' 问 'Do I have to read music?' 答 'No. This lesson uses note names and half steps only, with no staff notation.' 问 'I hear nothing. What now?' 答 'Browsers keep sound off until your first tap, so press a key once. Then check the Sound button at the top and the silent switch on your phone.' 问 'What does the evening course add?' 答 'Real keyboards, a teacher listening to you, and live ear training in a room of ten. You also leave with eight bars you wrote yourself.'
   布局:Stage 底色,最大宽度 880px,原生 details 和 summary 行,带一个 Lucide Plus 图标,旋转后变成叉号。第一项默认展开。
   动效:答案高度以 200 ms 动画展开;图标旋转 45 度。
12. **末尾色带与页脚** — Coral 色带标题,pit 墨色:'Come play it in the room。' 文案:'New groups start the first Tuesday of each month. Call or write to save a seat.' 联系方式为纯文本,无表单:'(555) 014-2277' 和 '[email protected]',品牌变更时重写。按钮 'Replay the quiz'(pit 填充配 text 色)链接到 #quiz。页脚为 pit 色:[BRAND]、地址、营业时间 'Office open Monday to Friday, 4 to 7 pm'、锚点链接、'All sounds in this lesson are made live in your browser.',然后是可选 [CREDIT] 链接。
   布局:色带为全出血 coral,桌面端两栏布局:文字居左占 55%,keys-closeup.webp 居右占 45%,色带全高、无圆角。移动端照片位于文字上方,比例 16:9。页脚桌面端 3 列,移动端堆叠,内边距避开 dock。
   动效:仅标题滚动显现。

## 资产
- 图片:下载 https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/hero-stage.webp 到 public/images/hero-stage.webp。替代文本:'An empty small club stage at night, hazy with ultraviolet light and crossed by a coral beam'。用作主视觉背景。由 VibeFather 使用 qwen-image-3.0-pro 生成,可随本模板再分发。
- 图片:下载 https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/instructor-portrait.webp 到 public/images/instructor-portrait.webp。替代文本:'The instructor at a keyboard on a small stage, seen from behind under violet and coral light'。一个虚构的 AI 生成人物,在讲师区块中用作占位图,可替换为真实照片。由 VibeFather 使用 qwen-image-3.0-pro 生成,可随本模板再分发。
- 图片:下载 https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/evening-class.webp 到 public/images/evening-class.webp。替代文本:'Adult students seen from behind, practicing at small keyboards in a dim violet rehearsal room'。用于课程信息旁边。由 VibeFather 使用 qwen-image-3.0-pro 生成,可随本模板再分发。
- 图片:下载 https://media.vibefather.ai/assets/cf319907-f8d2-4e65-990a-90703b5a0bec/keys-closeup.webp 到 public/images/keys-closeup.webp。替代文本:'A close view of piano keys glowing under coral and ultraviolet stage light'。用于最后的乐队区块。由 VibeFather 使用 qwen-image-3.0-pro 生成,可随本模板再分发。
- 图片:所有交互式图形均以代码绘制为内联 SVG 或 HTML:钢琴、五度圈、和弦形状环、舞台光束、迷你键盘、风车标志和 favicon。为本模板的原创作品;在 ASSETS.md 中注明它们为代码绘制。
- 图标:通过 lucide-react 包(ISC)使用 Lucide 图标:Volume2、VolumeX、Play、Check、X、Plus、Trophy、RotateCcw。
- 字体:通过列出的 @fontsource-variable 包(OFL-1.1)自托管 Unbounded、Figtree 和 JetBrains Mono,在 src/main.tsx 中导入。在 ASSETS.md 中逐一列出。

## 不要做
- 无后端:没有服务器代码、API 路由、数据库、认证、第三方 API、分析工具,也没有任何会提交到某处的表单。联系方式为纯文本。
- 仅静态输出到 dist/,用 npm run build 构建,使用相对资源路径(Vite base './')。压缩,无 source map,不把 src/ 复制进 dist/,总大小低于 20 MB。
- 保持为单页 index.html。页内链接使用锚点(#quiz);任何指向文件的链接都使用文件名,绝不用裸目录。
- 通过列出的 Fontsource 包自托管所有字体。绝不从 fonts.googleapis.com、fonts.gstatic.com 或任何其他 CDN 加载字体。不使用 CDN 脚本或 link 标签。将每张图片下载到项目中;绝不外链。
- 将所有文案、示例数据、获胜任务和测验轮次保留在 src/content.ts 中。当变量值变化时,重写该文件,确保不残留任何默认品牌、人物或主题。组件、布局、颜色和动效保持不变。
- 不包含任何类型的音频文件:没有采样、录音或声音字体。所有声音都在浏览器中用振荡器合成。
- 不要在用户手势之前创建或恢复 AudioContext,绝不在加载时自动播放声音。页面必须在 1440x900 和 390x844 下以零控制台错误或警告运行。
- 钢琴上、图片中或任何其他地方不得出现乐器制造商名称或标志。
- 不得使用现有歌曲的旋律、riff 或和弦进行,无论是作为示例还是在测验中,也不得出现“听起来像……的开头”这类歌曲引用。只使用音程、音阶和通用进行。
- 不得使用现有理论网站、书籍或课程的课程文本、图表或练习措辞。使用本提示词中的文案。
- 不使用商业音乐记谱字体,不使用五线谱记谱,不使用音乐字形字符;变音记号写作 # 和 b。
- 不使用 Aceternity UI、Tailwind Plus 或其他受限 UI 库源码,不使用音频或钢琴组件库;自行编写组件。
- 不得出现真实音乐家或教师的肖像。讲师图片展示的是虚构的 AI 生成人物。不得出现音乐教育应用或游戏中的具名吉祥物或角色。
- 不使用灰白色或奶油色页面区块。除珊瑚色条带外,整个页面保持在紫外色和紫色底色上。
- 按设计部分所述遵循 prefers-reduced-motion,并保持正文文本达到 WCAG AA 对比度。绝不在明亮音符颜色上放置文字色标签;在那里使用 pit ink #120634。
- 任何宽度下都不得出现页面水平滚动,不得有固定停靠栏遮挡钢琴或答案按钮。
- 在项目根目录的 ASSETS.md 中列出每个第三方文件,包含路径、来源 URL、作者和许可证。除可选的 [CREDIT] 页脚链接外,站点内不得提及 VibeFather。

---
— Prompt by VibeFather · https://vibefather.ai/t/music-theory-interactive-lesson · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

个人项目可免费使用(CC BY-NC 4.0)。 商业用途需要 Pro.

DESIGN.md

单独的设计规范:配色、字体、间距和动效。可以把这套视觉用到你已有的项目上。

---
name: "Music Theory Interactive Lesson"
colors:
  stage: "#1B0B4B"
  pit: "#120634"
  curtain: "#2A0F73"
  panel: "#351A8C"
  coral: "#FF5A47"
  acid: "#E6FF2E"
  text: "#F6F1FF"
  muted: "#C9BEF2"
  ivory_key: "#F1EBFF"
  pc_c: "#FF5A47"
  pc_g: "#FF8A2B"
  pc_d: "#FFC21F"
  pc_a: "#E6FF2E"
  pc_e: "#8CF23C"
  pc_b: "#2EE87F"
  pc_gb: "#1FE5C4"
  pc_db: "#29C9FF"
  pc_ab: "#6FA3FF"
  pc_eb: "#A98BFF"
  pc_bb: "#E872FF"
  pc_f: "#FF5CB0"
typography:
  display_headlines_chapter_numerals_chord_and_key_names_weight_800_line_height_1_04_letter_spacing_0_02em: { family: "Unbounded Variable", weights: [500, 800] }
  text_body_at_18px_desktop_and_16px_mobile_line_height_1_55_buttons_at_weight_700: { family: "Figtree Variable", weights: [400, 500, 700] }
  mono_note_names_on_keys_half_step_counts_score_key_caps_small_labels_at_12_to_14px_uppercase_with_0_08em_tracking_where_labels_are_words: { family: "JetBrains Mono Variable", weights: [500, 700] }
spacing: "Base unit 8px. Page container max width 1320px with 40px side gutters on desktop and 16px on mobile. Chapters use 120px vertical padding on desktop and 72px on mobile. Widget panels use 32px padding on desktop and 16px on mobile. Gaps between panel groups are 24px."
radius: "Panels 28px, cards 20px, buttons and chips fully round (999px), piano keys square at the top and 10px at the bottom on naturals, 6px at the bottom on sharps."
---

# Music Theory Interactive Lesson — Design System

Apply this design system to an existing project. It describes the look and feel only; for the full site, use prompt.md.

## Colors
- **stage** `#1B0B4B` — Deep ultraviolet page ground; hero scrim tint and odd chapters
- **pit** `#120634` — Darkest ground for the top bar, dock and footer, and the ink on all bright fills
- **curtain** `#2A0F73` — Saturated violet ground for even chapters
- **panel** `#351A8C` — Widget panels and cards
- **coral** `#FF5A47` — Electric coral: secondary buttons, wrong answers, final band, chapter 1 accent. Must appear large in the hero
- **acid** `#E6FF2E` — Acid yellow: primary buttons, win bars, correct answers, circle pointer, focus rings. Must appear large in the hero
- **text** `#F6F1FF` — Body and heading text on dark grounds
- **muted** `#C9BEF2` — Secondary text on dark grounds
- **ivory-key** `#F1EBFF` — Pale lilac natural piano keys
- **pc-C** `#FF5A47` — Pitch class C
- **pc-G** `#FF8A2B` — Pitch class G
- **pc-D** `#FFC21F` — Pitch class D
- **pc-A** `#E6FF2E` — Pitch class A
- **pc-E** `#8CF23C` — Pitch class E
- **pc-B** `#2EE87F` — Pitch class B
- **pc-Gb** `#1FE5C4` — Pitch class F#/Gb
- **pc-Db** `#29C9FF` — Pitch class C#/Db
- **pc-Ab** `#6FA3FF` — Pitch class G#/Ab
- **pc-Eb** `#A98BFF` — Pitch class D#/Eb
- **pc-Bb** `#E872FF` — Pitch class A#/Bb
- **pc-F** `#FF5CB0` — Pitch class F

## Typography
- **Display: headlines, chapter numerals, chord and key names. Weight 800, line-height 1.04, letter-spacing -0.02em.** — Unbounded Variable (OFL), weights 500/800. Self-host the font files.
- **Text: body at 18px desktop and 16px mobile, line-height 1.55; buttons at weight 700.** — Figtree Variable (OFL), weights 400/500/700. Self-host the font files.
- **Mono: note names on keys, half-step counts, score, key caps, small labels at 12 to 14px, uppercase with 0.08em tracking where labels are words.** — JetBrains Mono Variable (OFL), weights 500/700. Self-host the font files.

## Spacing & shape
- Spacing: Base unit 8px. Page container max width 1320px with 40px side gutters on desktop and 16px on mobile. Chapters use 120px vertical padding on desktop and 72px on mobile. Widget panels use 32px padding on desktop and 16px on mobile. Gaps between panel groups are 24px.
- Radius: Panels 28px, cards 20px, buttons and chips fully round (999px), piano keys square at the top and 10px at the bottom on naturals, 6px at the bottom on sharps.

## Motion
- Stage beam: on every press of a hero piano key, a vertical beam in that note's color rises from the key to the top of the hero, 2 key-widths wide with a linear gradient fading to transparent, scaleY 0 to 1 in 120 ms, then fades out over 600 ms. Several beams may overlap. This is the signature effect.
- Key press: a pressed key moves down 3px in 60 ms, its fill becomes the pitch color and it gains a soft outer glow in that color. On release it returns over 140 ms.
- Circle rotation: Motion spring with stiffness 180 and damping 22 to the nearest 30-degree snap, taking the shortest path. While dragging, the rotation follows the pointer directly and a tick() plays each time a new wedge crosses the pointer. Wedge labels counter-rotate to stay upright.
- Win bar: the dashed outline fills from left to right with acid yellow in 350 ms, the check icon pops in with a spring (scale 0.4 to 1), and the top bar's win count bumps to scale 1.2 and back.
- Chord change: chips animate in with a 40 ms stagger, moving up 8px and fading in; the chord shape polygon morphs to its new vertices with a spring (stiffness 140, damping 18).
- Scroll reveal: chapter text and panels move up 24px and fade in once over 500 ms as they enter the viewport.
- Idle hero: on load, a 2.4 s wave of light passes left to right across the piano's color strips, once only, with no sound.
- With prefers-reduced-motion: no beams, wave or scroll reveals. The circle jumps to its position with no spring, and key presses only change color. Sound and all widgets still work.

## Imagery
A stage at night. Four matching photographs in one shoot style (ultraviolet haze, coral key light, thin acid yellow accent) set the mood for the hero, the instructor, the evening class and the final band. Everything interactive is drawn in SVG and HTML: the piano, circle, chord shape and color strips. Instruments carry no maker names.

## Tone
Playful, bold and plainspoken, like a good teacher on a small stage at night. Short sentences. Describes how things sound in everyday words. Never academic, never cute for its own sake.

---
— Prompt by VibeFather · https://vibefather.ai/t/music-theory-interactive-lesson · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

改成你自己的

  • 一所夜校音乐学校:把 BRAND 设成你的学校,START_KEY 设成课程开场的调,并把讲师部分换成你自己的老师和学期日期。
  • 一门 beatmaking 课程:把 LESSON_TOPIC 设成七和弦,按学生常用的和弦性质重排和弦列表和测验轮次,并把 AUDIENCE 设成靠耳朵工作的制作人。
  • 一位吉他或尤克里里老师:保留钢琴和五度圈,但围绕学生最先遇到的音程改写小目标任务和文案,并把 INSTRUCTOR_NAME 设成你自己的名字和照片。
  • 一位开发者在做“边玩边学”页面:保留共享状态和小组件节奏,改 LESSON_TOPIC 和 AUDIENCE,并为另一个适合“按一按、听一听”的主题改写内容文件。

乐理互动课:常见问题

访客在乐理互动课页面上实际能做些什么?

访客可以用鼠标、触屏或电脑键盘演奏一架两个八度的钢琴,拖动五度圈旋转,在九种和弦性质之间构建和弦,并参加一个八轮练耳测验,最后得到结果卡片。每个章节都把简短概念、动手小组件和一个小目标配在一起,小目标会点亮页头的黄色进度条。

怎么用 AI 做一个乐理互动课?

复制本页的提示词,或者运行 npx vibefather add music-theory-interactive-lesson,把 [BRAND]、[AUDIENCE]、[START_KEY]、[LESSON_TOPIC] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。