跳到正文
VibeFather
免费注册

用这个模板做的 2 个案例

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

关于这个模板

这个模板是一个单页科普讲解页,围绕一张可工作的示意图展开:一个风格化的心脏剖面图,页面一打开就开始跳动。心腔大小变化,瓣膜叶片摆动,血液粒子在血管中流动,一条磷绿色的心电图描记沿屏幕底部扫过,全部由同一个时钟驱动,所以不会出现不同步。滑块把心率设定在每分钟 40 到 180 次之间,时序会像真实心动周期那样响应:心跳中的静息部分比收缩部分缩短得多。再往下,示意图固定在原位,十个滚动步骤跟随一滴血依次经过右侧、肺部、左侧和身体,除当前描述的部分外其余全部变暗。其他部分让读者逐步查看一次心跳的五个瞬间、比较不同心率下的时序、拆解描记图,并近距离观察每个瓣膜。它适合科学老师、学生、科学传播者,以及任何想要一个能在课堂上分享的链接的人。视觉上是深茄紫色底,饱和钴蓝和猩红承载实际含义:缺氧血和富氧血。每个形状都来自提示词中的坐标,没有照片,所以不同构建之间结果保持一致。偏好减少动态效果的读者会看到带手动控制的逐步版本。要改编它,修改变量:主题、心率控件、路径上的十个停靠点以及描记信号。然后提示词会在同一画布上要求一张新示意图,这样发动机、泵或其他身体系统都能沿用相同的布局、时钟和双色逻辑。这是一个教学模型,不包含任何诊断功能。

模板提示词

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

# How the Human Heart Works

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

## Brief
A single-page interactive science explainer by [BRAND] on how [TOPIC] works. The first screen is the working diagram itself: a large code-drawn cross-section that is already moving, with the rate slider and a live trace visible without scrolling. One clock drives every moving part. The default subject is the human heart, with cobalt oxygen-poor blood and scarlet oxygen-rich blood on a deep aubergine ground, and a phosphor-green ECG sweep. If [TOPIC] is not the human heart, keep the page structure, palette, clock, trace strip, spotlight behavior and section order exactly, redraw the diagram as a fresh stylized cross-section of [TOPIC] on the same 1000 x 900 canvas, map cobalt and scarlet to the two states named in [FLOW_PATH], take the ten scroll stops from [FLOW_PATH], the slider from [RATE_CONTROL], the trace and its marks from [TRACE_SIGNAL], and rewrite all copy so that no heart vocabulary remains.

- Audience: [AUDIENCE]. They arrive from a shared link or a lesson plan, on a laptop or a phone, with no background beyond school science.
- Goal: Make one mechanism click: a reader should be able to drag the slider, watch the parts stay in time, follow the path from start to finish and explain the cycle to someone else. All copy lives in src/content.ts; when the variable values differ from the defaults, rewrite that copy to fit them.
- Tone: Clear, curious and exact, like a good teacher at a whiteboard. Short sentences and concrete verbs. No hype, no drama and no health advice.

## Stack
- Framework: Vite 5 + vanilla TypeScript
- Styling: Plain CSS
- Libraries: vite (MIT), typescript (Apache-2.0), gsap (with its ScrollTrigger plugin) (GSAP Standard License, free including commercial use), lucide (ISC), @fontsource/gloock (OFL-1.1), @fontsource-variable/hanken-grotesk (OFL-1.1), @fontsource-variable/martian-mono (OFL-1.1)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
  - package.json scripts: dev runs vite, build runs tsc --noEmit && vite build. Use TypeScript in strict mode.
  - vite.config.ts sets base: './' and build.sourcemap: false, with no plugins.
  - Files: index.html, public/favicon.svg, ASSETS.md, src/main.ts (wiring and the single requestAnimationFrame loop), src/model.ts (pure timing, volume, valve and trace functions of t and rate), src/diagram.ts (a createDiagram(svg, options) factory used for every copy of the diagram), src/trace.ts (canvas sweep), src/scroll.ts (GSAP ScrollTrigger steps), src/content.ts (all visible copy and the variable values), src/styles.css.
  - Exactly one requestAnimationFrame loop exists. Each frame it advances the clock once, then updates every diagram instance, every trace and every readout from the same t. No CSS animation or GSAP timeline may drive a beating part.
  - src/model.ts has no DOM access, so a paused or stepped diagram can be drawn at any t by calling the same functions.
  - Register ScrollTrigger once with gsap.registerPlugin(ScrollTrigger). GSAP is used only for scroll triggers and section reveals.
  - Pause the loop while the tab is hidden, and clamp the frame delta to 50 ms so the clock does not jump on return.
  - Size canvases with devicePixelRatio and redraw them on resize.
  - The title tag is '[BRAND] | How [TOPIC] works'. The favicon is public/favicon.svg.

## Variables
- [BRAND] — Publisher name (default: "Cutaway Lab"). The invented studio or teacher publishing the explainer.
- [TOPIC] — Subject, in lowercase mid-sentence form (default: "the human heart"). Reads inside 'How [TOPIC] works'. Pick a machine or system with a repeating cycle and a path that something travels.
- [AUDIENCE] — Who it is for (default: "curious adults and high school biology classes"). Sets the reading level and the class prompts.
- [RATE_CONTROL] — Slider name, range and starting value (default: "Heart rate: 40–180 BPM, starting at 72"). The one number the reader can drag.
- [FLOW_PATH] — The two states and ten stops (default: "Cobalt, oxygen-poor blood: right atrium, tricuspid valve, right ventricle, pulmonary valve, lungs. Scarlet, oxygen-rich blood: left atrium, mitral valve, left ventricle, aortic valve, body."). Exactly five stops per color, in travel order. These become the ten scroll steps.
- [TRACE_SIGNAL] — The live trace and its marks (default: "Stylized ECG with P, QRS and T marks"). A signal synthesized from math, never a recording.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/how-the-human-heart-works 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
- Aubergine ground `#16081A` — Page background and hero ground; the text color on scarlet and phosphor fills
- Aubergine panel `#26102C` — Cards, step panels, the trace strip background
- Hairline `#4B2A55` — Borders, dividers, slider ticks
- Cobalt `#1F4BFF` — Oxygen-poor blood fill in chambers and vessels
- Cobalt wall `#0F2A9E` — Walls of cobalt vessels
- Cobalt text `#7F9CFF` — Cobalt-side text on dark grounds; light particles
- Scarlet `#FF1F3D` — Oxygen-rich blood fill in chambers and vessels
- Scarlet wall `#A80F2A` — Walls of scarlet vessels
- Scarlet text `#FF4A5E` — Scarlet-side text on dark grounds
- Muscle `#6A1B45` — Heart wall fill
- Muscle line `#8E2A5A` — Heart outline and fiber hatch
- Phosphor `#39FF88` — ECG trace, electrical spark, slider thumb, active states, primary CTA fill
- Leaflet `#FFE6D6` — Valve leaflets and hinge dots
- Lung tissue `#2A1033` — Lung fill, with a #6B4A78 outline
- Text `#F8EEF4` — Headings and body text
- Muted text `#C9B6CE` — Secondary text and captions

### Typography
- Display: H1 and section headings, sentence case, line-height 1.02. H1 is 84px on desktop and 42px on mobile; section headings are 56px and 34px.: Gloock (OFL), weights 400
- Text: body at 18px with line-height 1.6, step captions, buttons at 15px weight 600: Hanken Grotesk Variable (OFL), weights 400/500/600
- Instrument: eyebrows, diagram labels, readouts and table numbers, 12–14px uppercase with 0.08em tracking for labels; the rate readout is 64px weight 500: Martian Mono Variable (OFL), weights 400/500

### Layout & motion
- Spacing: 8px base. Page max-width 1320px with 40px gutters on desktop and 16px on mobile. Sections have 120px vertical padding on desktop and 72px on mobile. Sections are divided by a 1px #4B2A55 line, not by alternating backgrounds.
- Radius: Cards and step panels 14px. Buttons and chips are pills. The trace strip is square and runs edge to edge.
- Motion: Timing model in src/model.ts, in seconds, with t = 0 at the R peak of each beat: RR = 60 / rate; Ts = 0.16 + 0.12 * RR (systole); Td = RR - Ts (diastole); PR = 0.06 + 0.08 * min(1, RR); Tic = 0.05; Tir = min(0.07, 0.25 * Td); Tf = RR - PR - Ts - Tir (filling).
- Motion: Five phases in order: 1 Squeeze begins, 0 to Tic. 2 Ejection, Tic to Ts. 3 Relaxation, Ts to Ts + Tir. 4 Filling, Ts + Tir to RR - PR. 5 Atrial top-up, RR - PR to RR.
- Motion: Ventricle scale v: F = 0.74 + 0.22 * (1 - exp(-Tf / 0.05)) and E = F + 0.04. Phase 1 holds E. Phase 2 eases in-out from E to 0.74. Phase 3 holds 0.74. Phase 4 is 0.74 + 0.22 * (1 - exp(-tau / 0.05)), where tau is time since the phase began. Phase 5 eases out from F to E. At high rates filling is cut short, so the ventricle visibly fills less.
- Motion: Atrium scale a: 1 at all times except phase 5, where a = 1 - 0.12 * sin(pi * x) and x is progress through the phase from 0 to 1.
- Motion: Valve openness, 0 to 1. Inlet valves (tricuspid, mitral) ramp 1 to 0 over the first 0.03 s of phase 1, stay 0 through phases 2 and 3, ramp 0 to 1 over the first min(0.04, Tf) of phase 4, and stay 1 through phase 5. Outlet valves (pulmonary, aortic) ramp 0 to 1 over the first 0.03 s of phase 2, ramp 1 to 0 over the first min(0.03, Tir) of phase 3, and stay 0 otherwise.
- Motion: Trace, synthesized as a sum of gaussians A * exp(-((t' - c)^2) / (2 * s^2)), where t' is t wrapped into -RR/2 to RR/2. P: A 0.15, c -PR, s 0.025. Q: A -0.12, c -0.025, s 0.009. R: A 1.0, c 0, s 0.011. S: A -0.22, c 0.028, s 0.011. T: A 0.30, c Ts - 0.05, s 0.045.
- Motion: When the rate changes, keep the current fraction of the cycle (t / RR) so the beat never jumps. Slider input takes effect on the same frame.
- Motion: Electrical spark, using the wrapped t' of the trace: from t' = -PR - 0.02 to t' = -PR + 0.06 a 7-unit phosphor dot travels the atrial segment of the conduction line, in step with the P mark; from t' = -0.03 to t' = 0.04 it travels the septal segment and both branches, in step with QRS. The node dots flash and the line brightens from 0.25 to 1 opacity as the spark passes.
- Motion: Section reveals: headings and cards fade in and rise 16px over 0.5s via ScrollTrigger, once only. Buttons scale to 0.97 on press. Spotlight dimming transitions over 0.35s.
- Motion: prefers-reduced-motion: the clock never runs. Every diagram renders a static frame, the hero shows the frame for the mid-point of phase 2, the trace strip draws two static beats, particles are hidden, and Previous and Next buttons appear under the hero diagram to step through the five phases. Scroll steps still swap the spotlight and caption, with no transitions and the drop placed at the step's stop.
- Imagery: No photographs and no downloaded images. Everything is drawn in code as flat, confident anatomical shapes with a fine hatch on the muscle: the feel of a modern printed scientific plate, drawn fresh from the coordinates in this prompt, never traced from an atlas or textbook. For another [TOPIC], draw an equally simple cross-section on the same canvas with the same flat fills, tube walls, hatch, leaflet color and phosphor signal line.

## Pages & Sections
### How [TOPIC] works (`index.html`)
1. **Diagram specification (shared by every diagram on the page)** — Not a visible section: createDiagram builds this inline SVG with viewBox '0 0 1000 900'. The viewer faces the person, so the person's right side is on screen left. All shapes below are for the default [TOPIC]. Closed shapes are closed Catmull-Rom splines converted to cubic beziers (control points p1 + (p2 - p0) / 6 and p2 - (p3 - p1) / 6). A tube is a stroked path drawn twice with butt caps: wall color at width W, then blood color at width W - 12.

Chamber control points, each scaled about its anchor by the model scale (a for atria, v for ventricles).
RA, cobalt, anchor (332,428): 262,272 330,250 392,276 402,345 388,410 330,428 268,404 244,340.
LA, scarlet, anchor (626,404): 566,266 640,244 716,266 738,324 712,386 640,404 574,388 548,328.
RV, cobalt, anchor (350,462): 290,478 350,456 440,462 470,540 472,622 452,706 392,672 326,606 284,540.
LV, scarlet, anchor (626,450): 548,482 622,446 704,470 730,550 710,652 656,738 596,790 552,716 530,626 526,546.

Heart outline, each point tagged with the chamber it follows. It scales about that chamber's anchor by 1 - (1 - scale) * 0.55: 262,238 RA; 400,236 RA; 470,250 LA; 550,236 LA; 640,214 LA; 742,244 LA; 774,324 LA; 752,410 LV; 768,500 LV; 768,584 LV; 740,676 LV; 676,776 LV; 596,840 LV; 530,792 LV; 462,742 RV; 388,710 RV; 300,632 RV; 252,548 RV; 244,452 RV; 216,404 RA; 210,330 RA. Fill #6A1B45, stroke #8E2A5A at 4. Overlay the same path filled with a pattern of 7-unit spaced lines, rotated 38 degrees, stroke #8E2A5A at 1.6, opacity 0.4.

Draw order, back to front, each item in its own named group so it can be spotlighted:
1. Lungs: closed splines 66,160 120,126 168,170 176,270 160,370 96,396 46,340 40,240 and its mirror (x becomes 1000 - x), fill #2A1033, stroke #6B4A78 at 3. Inside each, draw branching trees: recursive lines that split by plus and minus 26 degrees with length times 0.72 and stroke width depth * 1.4 with round caps. Cobalt trees start at (172,188) angle 175 and (828,188) angle 5, length 40, depth 5. Scarlet trees start at (172,290) angle 180, (172,346) angle 170, (828,290) angle 0 and (828,346) angle 10, length 34, depth 4.
2. Body bed: rect x 176, y 826, width 640, height 52, radius 26, opacity 0.85, with a horizontal gradient from #FF1F3D on the right to #1F4BFF on the left.
3. Descending aorta: scarlet tube M792 150 L792 838, W 50.
4. Left pulmonary veins, passing behind the heart: scarlet tubes M172 290 L300 290 and M172 346 L300 346, W 34.
5. Heart outline and hatch.
6. Right pulmonary veins: scarlet tubes M828 290 L700 290 and M828 346 L700 346, W 34.
7. Pulmonary artery as one group: wall strokes first, then blood strokes, so the T-junction is clean. Wall #0F2A9E: M172 188 L828 188 at width 44 and M432 210 L432 480 at width 56. Blood #1F4BFF: M172 188 L828 188 at width 32 and M432 188 L432 480 at width 44.
8. Venae cavae: cobalt tubes M318 0 L318 280 and M204 836 L204 500 C204 450 236 420 290 380, W 50.
9. Aorta: scarlet tube M612 502 C540 470 500 440 500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166, W 60. Three arch branches: scarlet tubes M590 66 L590 0, M650 66 L650 0, M710 66 L710 0, W 26. Then redraw M500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166 in #FF1F3D at width 48 to clear the branch ends.
10. Inlet channels: cobalt rect x 288, y 404, w 88, h 70 and scarlet rect x 574, y 384, w 104, h 84.
11. The four chambers, drawn over tube ends so the joins disappear.
12. Valves, center x, center y, flow angle in degrees, half-width: tricuspid 332,442,90,44; mitral 626,425,90,52; pulmonary 432,290,-90,22; aortic 500,330,-90,24. Each has two leaflets hinged at center plus and minus the perpendicular times half-width, length half-width * 1.04. Leaflet angle goes from pointing at the center (closed) toward the flow direction by 87 percent of the turn at openness 1. Draw each as a quadratic curve whose midpoint is pushed 6 units along the flow, stroke #FFE6D6 at 7 with round caps, plus a 5-unit hinge dot.
13. Conduction line, stroke #39FF88 at 2.5: atrial segment M262 262 C330 330 420 410 500 470; septal segment M500 470 L500 700; branches M500 560 C450 600 400 620 360 600 and M500 620 C550 680 620 700 680 640. Node dots at (262,262) radius 7 and (500,470) radius 6.
14. Particles: 90 circles of radius 3.5, #7F9CFF on cobalt paths and #FF9AA6 on scarlet paths, spread evenly across these paths and moving at 520 units per second when their gate is open and 40 otherwise. Always open: M318 0 L318 280; M204 836 L204 500 C204 450 236 420 290 380; M828 290 L700 290; M828 346 L700 346. Open when inlet openness is above 0.5: M330 340 L332 442 L380 560; M640 320 L626 425 L626 580. Open when outlet openness is above 0.5: M380 560 L432 480 L432 188; M432 188 L172 188; M432 188 L828 188; M626 580 L612 502 C540 470 500 440 500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166 L792 838.
15. Labels, Martian Mono 15 units, hidden on thumbnails: 'Right atrium' at 322,345 and 'Right ventricle' at 385,565 in #FFFFFF; 'Left atrium' at 640,325 and 'Left ventricle' at 628,590 in #16081A; 'Aorta' at 640,112 in #FF4A5E; 'Pulmonary artery' at 610,152 in #7F9CFF; 'Vena cava' at 350,30 in #7F9CFF; 'Lungs' at 108,112 and 892,112 in #C9B6CE; 'Body' at 496,858 in #F8EEF4. All centered. Below 768px wide, show only 'RA', 'RV', 'LA', 'LV' at 36 units.

createDiagram accepts { labels, particles, frozenT, frozenRate } so thumbnails can render a fixed frame.
   Layout: One function, many instances: hero, sticky scroll diagram, phase thumbnails and the small trace-section diagram. Every instance reads the same clock unless it is frozen.
2. **Header** — Left: a small code-drawn mark (a 20px circle split vertically, cobalt left and scarlet right) and [BRAND] in Hanken Grotesk 600. Right, in Martian Mono 12px uppercase: The beat, Blood path, Five moments, Rate, The trace, Valves, Class. Each is a same-page hash link. On mobile show only the mark, [BRAND] and one link, 'Blood path'.
   Layout: Sticky, 64px tall on desktop and 52px on mobile. Background #16081A at 92 percent opacity with a 1px #4B2A55 bottom line.
   Motion: The current section's link turns #39FF88 as you scroll.
3. **Hero: the working diagram (id beat)** — Eyebrow: '[BRAND] Explainer No. 07'. H1: 'How the human heart works'. Sub: 'Four chambers, four valves and one electrical signal, running on a single clock. Drag the slider and watch every part keep time.'

Instrument panel: the slider label 'Heart rate' in mono; the current value as a 64px number with 'BPM' beside it; a range input from 40 to 180, step 1, starting at 72, with ticks at 40, 60, 90, 120, 150, 180 and no words on the ticks; a pause and play icon button; the phase readout showing the current phase name in #39FF88; 'Systole 0.26 s' and 'Diastole 0.57 s', computed live to two decimals; and a 10px share bar in which systole is #39FF88 and diastole is #4B2A55, its widths updating live.

Buttons: primary 'Follow one drop of blood' (phosphor fill, #16081A text) links to #path. Secondary 'Step through one beat' (1px #4B2A55 outline) links to #moments.

Small orientation line under the diagram, in muted mono: 'You are facing the person, so their right side is on your left.'

Trace strip caption, top left of the strip: 'Stylized trace, synthesized from math. Not a recording.' Top right, three letter chips P, QRS and T, with a live sentence beside the active one. P, within 0.04 s of its center: 'P: the signal crosses the atria. They squeeze next.' QRS, from -0.04 s to 0.05 s: 'QRS: the signal reaches the ventricles. They squeeze next.' T, within 0.05 s of its center: 'T: the ventricles reset for the next beat.'
   Layout: Desktop: exactly 100vh below the header, as a column. The upper area is a two-column grid: left column 500px with eyebrow, H1, sub, instrument panel and buttons, vertically centered; right column is the diagram, filling all remaining height with its full 1000 x 900 canvas visible and nothing cropped. The lower area is the trace strip, 168px tall, full bleed, #26102C with #4B2A55 top and bottom lines. At 1440 x 900 everything is visible without scrolling. Mobile: stacked, in this order: eyebrow and H1, diagram at full width, value and slider, phase readout and systole and diastole numbers, trace strip 110px tall, then sub and buttons below the fold.
   Motion: The diagram beats from the first frame, with no intro animation. Trace: a canvas sweep moving left to right at a constant speed that crosses the strip in 5 s, so more beats fit as the rate rises. Advance in steps of 1/240 s each frame so no QRS is missed. Line #39FF88 at 2px with an 8px shadow blur; older columns fade to 35 percent alpha with age; a 28px gap is erased ahead of the bright head dot. Baseline at 62 percent of the strip height, vertical scale 50 percent of the height per 1.0 of signal. Write small 'P', 'QRS' and 'T' marks above the wave where each one is drawn, fading with the line. Keyboard: the slider uses native arrow keys; space toggles pause when focus is not on a button or link.
4. **Follow one drop of blood (id path)** — Heading: 'Follow one drop of blood'. Intro: 'One full trip goes through the heart twice. Scroll, and the diagram lights up each stop in order.'

Ten steps, each with a mono number, a short title in Gloock and a caption. Mono numbers are #7F9CFF for steps 1–5 and #FF4A5E for steps 6–10.
1 Right atrium, 'Arrival': 'Blood back from the body collects here, through one large vein from above and one from below. It has given up much of its oxygen, so it is drawn in cobalt.'
2 Tricuspid valve, 'A one-way door opens': 'When the chamber below relaxes, pressure drops and this valve swings open. A small squeeze from the atrium tops up the ventricle before the door shuts.'
3 Right ventricle, 'The short push': 'The electrical signal arrives and this chamber squeezes. The tricuspid valve shuts so nothing flows back. The wall is thinner here because the lungs are close by.'
4 Pulmonary valve, 'Out to the lungs': 'Pressure forces these cusps open and blood leaves through the pulmonary artery. When the squeeze ends, the cusps catch the backflow and seal.'
5 Lungs, 'The color change': 'Blood spreads through tiny vessels wrapped around air sacs. Carbon dioxide leaves and oxygen comes in. This is where the diagram turns from cobalt to scarlet.'
6 Left atrium, 'Back to the heart': 'Four veins carry the refreshed blood back. The left atrium holds it until the next relaxation, filling at the same time as its partner on the other side.'
7 Mitral valve, 'The two-leaflet door': 'This valve has two leaflets where the tricuspid has three. It opens as the left ventricle relaxes, and the atrium adds a last squeeze.'
8 Left ventricle, 'The thick wall': 'This chamber has the heaviest wall in the diagram. It sends blood all the way around the body, against far more resistance than the right side faces.'
9 Aortic valve, 'The big exit': 'Both ventricles squeeze together, so this valve opens at the same moment as the pulmonary valve. Blood rushes into the aorta, and the first branches arch off toward the head and arms.'
10 Body, 'The long way round': 'Arteries divide into smaller and smaller vessels until oxygen can pass to the tissue. The blood turns cobalt again and heads for the two large veins. Then the trip starts over.'

Drop stops in diagram units, in order: (330,340), (332,442), (380,560), (432,290), then (432,188) and (880,188) on the way to (880,290) for lungs, then (700,290) on the way to (640,320), (626,425), (626,580), (500,330), then (500,120), (640,56) and (792,166) on the way to (792,700) for body. The drop then continues to (500,852) and (204,836) as the last step ends.

Spotlight target per step: 1 RA; 2 tricuspid valve and inlet channel; 3 RV; 4 pulmonary valve and pulmonary artery; 5 both lungs; 6 LA and right pulmonary veins; 7 mitral valve and inlet channel; 8 LV; 9 aortic valve and aorta; 10 aorta, descending aorta, body bed and both venae cavae.
   Layout: Desktop: two columns. Left 42 percent: the steps, each with min-height 80vh and its card vertically centered (14px radius, #26102C, 1px #4B2A55 border, 32px padding). Right 58 percent: a sticky panel with top 64px and height calc(100vh - 64px) holding the diagram with labels off except the active stop's label, a 96px trace strip below it, and a column of ten progress dots at its right edge. Mobile: the sticky panel is on top at 44svh with no trace strip, and the step cards scroll beneath it at full width with 60vh between them.
   Motion: ScrollTrigger on each step (start 'top 60%', end 'bottom 60%') sets the active step. Everything outside the spotlight dims to opacity 0.22 over 0.35s. Spotlight targets stay at full opacity with an SVG glow (feGaussianBlur stdDeviation 8, merged under the source). A leader line and the stop's name appear next to the target. A second ScrollTrigger, scrubbed across the whole section, moves the drop along the polyline: a 10-unit circle with a 3-unit #F8EEF4 ring, filled #1F4BFF up to the lungs and #FF1F3D after them. The heart keeps beating during all of this, at the slider's rate. Active card border turns #39FF88; its progress dot fills.
5. **One beat, five moments (id moments)** — Heading: 'One beat, five moments'. Intro: 'Pick a moment and the page holds there. Every diagram, trace and valve card waits with it.'

Five tiles, each with a frozen thumbnail at the mid-point of its phase, a name, a sentence and two chips.
1 'Squeeze begins': 'The ventricles tighten, but every valve is shut. Pressure climbs with nowhere to go.' Chips: 'Inlets closed', 'Outlets closed'.
2 'Ejection': 'Pressure wins. The outlet valves open and blood leaves for the lungs and the body.' Chips: 'Inlets closed', 'Outlets open'.
3 'Relaxation': 'The ventricles let go. The outlet valves snap shut against the backflow, and for a moment everything is closed again.' Chips: 'Inlets closed', 'Outlets closed'.
4 'Filling': 'Pressure falls below the atria. The inlet valves open and blood pours down.' Chips: 'Inlets open', 'Outlets closed'.
5 'Atrial top-up': 'A small squeeze from the atria pushes in the last of the blood, just before the next beat.' Chips: 'Inlets open', 'Outlets closed'.

Controls under the tiles: Previous, Next and 'Back to live', with Lucide chevron icons.
   Layout: Desktop: five equal columns, 16px gap. Each tile is a #26102C card with the thumbnail on top (labels and particles off). Selected tile: 2px #39FF88 border. Mobile: horizontal scroll-snap row of cards 78vw wide.
   Motion: Clicking a tile pauses the clock and sets t to that phase's mid-point. All diagrams and readouts update. The trace keeps its drawn line and stops. 'Back to live' resumes from that t. Tile thumbnails never animate. This same section is the reduced-motion fallback, working identically.
6. **Faster beats, shorter rests (id rate)** — Heading: 'Faster beats, shorter rests'. Intro: 'Systole, the squeeze, barely changes as the rate climbs. Diastole, the rest and refill, gives up almost all of the difference.'

A bar table for rates 40, 60, 90, 120, 150 and 180, plus a live row marked 'Your slider' that repeats the current rate. All numbers are computed from the timing model in the same function the diagram uses. At these rates the systole and diastole values in seconds are: 40: 0.34, 1.16. 60: 0.28, 0.72. 90: 0.24, 0.43. 120: 0.22, 0.28. 150: 0.21, 0.19. 180: 0.20, 0.13.

Caption, muted mono: 'Output of the simple model on this page, not measured data. It is drawn to show the pattern.' No words anywhere describing any rate as good, bad, typical, healthy or dangerous.
   Layout: Each row: rate in mono on the left, then a horizontal bar on a shared time scale (1.5 s equals the full width), systole in #39FF88 and diastole in #4B2A55 with a #C9B6CE 1px outline, then the two numbers on the right. Rows are 44px tall. The 'Your slider' row sits on a #26102C band at the top with its own compact copy of the range input, kept in sync with the hero slider. On mobile the numbers move under the bar.
   Motion: Bars grow from zero over 0.6s when first revealed. The live row updates on every slider input.
7. **Reading the trace (id trace)** — Heading: 'Three marks on one line'. Intro: 'The trace shows the electrical signal, not the movement. The signal comes first, then the muscle answers.'

Three cards.
'P': 'A spark starts at the top of the right atrium and spreads across both atria. They squeeze a moment later.' Highlights the atrial conduction segment, RA and LA.
'QRS': 'The signal drops down the wall between the ventricles and fans out. It is the tallest mark because the ventricles are the largest muscle in the diagram.' Highlights the septal segment, branches, RV and LV.
'T': 'The ventricle muscle resets, ready for the next signal. The chambers are finishing their squeeze as this mark passes.' Highlights RV and LV.

Note below: 'This line is built from smooth math curves to show where each mark falls. It cannot be used to read a real heart.'
   Layout: Top: one large static SVG of a single beat from the same trace function, full content width and 240px tall, on #26102C with faint 40px grid lines in #4B2A55 and the three marks labeled. Below, two columns: the three cards on the left and a small diagram with labels off on the right, 420px wide. On mobile the diagram sits between the trace and the cards.
   Motion: Hovering, focusing or tapping a card highlights its part of the static trace in full phosphor (the rest dims to 35 percent) and spotlights its parts in the small diagram, which keeps beating.
8. **Four valves, one direction (id valves)** — Heading: 'Four valves, one direction'. Intro: 'Valves do not push anything. They open and close because of pressure on either side.'

Four cards, each with an animated close-up, a name, a route and a state line.
'Tricuspid': 'Right atrium to right ventricle. Three leaflets, shown as two in this slice.'
'Pulmonary': 'Right ventricle to pulmonary artery. Three cusps, shown as two in this slice.'
'Mitral': 'Left atrium to left ventricle. Two leaflets.'
'Aortic': 'Left ventricle to aorta. Three cusps, shown as two in this slice.'
Live state line on each, in mono: 'Open' in #39FF88 or 'Closed' in #C9B6CE, from the same openness values, with Open meaning above 0.5.
   Layout: Four equal cards on desktop and two columns on mobile. Each close-up is a 200 x 140 SVG: a channel of the correct blood color between two #6A1B45 walls with two large #FFE6D6 leaflets, using the same valve function at twice the scale.
   Motion: Leaflets follow the live clock. Particles cross the channel only while that valve is open.
9. **Use it in class (id class)** — Heading: 'Use it in class'. Three numbered prompts:
1 'Set the slider to 40, then to 180. Which part of the beat lost more time, and what did the ventricles do differently?'
2 'Pause on Ejection. Name the two open valves and say why the other two must stay shut.'
3 'Find the point where the diagram turns from cobalt to scarlet. What changed, and where?'

Four questions, as native details and summary elements:
'Why does the trace move before the heart does?': 'The electrical signal comes first and the muscle responds a moment later. Watch the green spark travel just before each squeeze.'
'Is this a real ECG?': 'No. The trace is a sum of smooth math curves shaped to show where P, QRS and T fall. It is not a recording and should not be read as one.'
'Are the timings real?': 'They come from a simple formula chosen to show one pattern: systole barely changes while diastole shrinks. Treat them as a teaching model, not as measurements.'
'Can this page tell me anything about my own heart?': 'No. It does not read your pulse and it cannot assess anything. Questions about your own heart belong with a clinician.'
   Layout: Two columns on desktop: prompts on the left with large Gloock numerals in #FF4A5E, questions on the right with 1px #4B2A55 dividers. One column on mobile.
   Motion: Plus icon on each question rotates 45 degrees when open.
10. **Footer** — Disclaimer line in Hanken Grotesk 18px: 'A stylized teaching model for [AUDIENCE]. Not medical advice and not a measuring tool.' Colophon in muted mono: 'Words: Odalys Renn. Drawing and code: Teo Marchetti. Published by [BRAND].' A row titled 'Next in the series', with three non-link items marked 'In progress': 'How lungs trade gas', 'How a kidney filters', 'How a four-stroke engine breathes'. The [CREDIT] link, when kept, sits at the far right of the bottom line.
   Layout: Full-width band: top border as a 6px horizontal gradient from #1F4BFF to #FF1F3D, then a three-column grid on #16081A with 64px padding. One column on mobile.
   Motion: None.

## Assets
- image: None downloaded. Every visual is drawn in code from the coordinates in this prompt: inline SVG for the diagrams and canvas for the trace. public/favicon.svg is hand-written: a #16081A rounded square with a circle split vertically, #1F4BFF left and #FF1F3D right. In ASSETS.md at the project root, list gsap, lucide and the three fonts with path, source URL, author and license, and state that the project has no third-party images.
- icon: Lucide (ISC) from the lucide npm package, imported individually and rendered as inline SVG: Play, Pause, ChevronLeft, ChevronRight, Plus. The header mark is hand-drawn inline SVG.
- font: Self-hosted through @fontsource/gloock (400), @fontsource-variable/hanken-grotesk and @fontsource-variable/martian-mono, all OFL-1.1, imported in src/main.ts.

## Don'ts
- No backend, server code, API routes, database, auth, forms that submit anywhere or third-party APIs. No webcam, microphone or sensor access.
- No CDN script or link tags, no fonts.googleapis.com or fonts.gstatic.com, no analytics. Fonts, icons and scripts are all bundled locally.
- No source maps, and no src/ copied into dist/. Use relative asset paths with Vite base './'. Keep dist/ under 20 MB. Same-page links are hash links and any link to the page itself uses ./index.html, never a bare directory.
- No plates or linework traced from anatomy atlases, textbooks or commercial medical illustration. Draw the diagram only from the coordinates here, or fresh as a stylized drawing for another [TOPIC].
- No real patient ECG recordings or copied tracings. The waveform is synthesized from the math here and labeled as stylized.
- No logos, names or badges of hospitals, health charities, medical journals or device makers.
- No text copied from health encyclopedias, textbooks or patient leaflets. Use the copy written here.
- No diagnostic features or medical advice: no symptom checker, no reading of the user's own pulse, no labels saying a rate or rhythm is healthy, normal, good, risky or dangerous, no named conditions, and no treatment or drug claims.
- No photographs of real organs, surgery or patients, and no gore. No realistic blood splashes or dripping.
- No invented statistics or expert quotes presented as sourced medical fact, and no doctor endorsements or 'medically reviewed' badges. Numbers on the page come from the stated model and are labeled as model output.
- No second animation clock: no CSS keyframes, GSAP timelines or separate loops driving chambers, valves, particles or the trace.
- Do not fall back to a pale background or a muted palette. Cobalt and scarlet must both fill large areas of the hero.
- Do not crop the diagram in the hero, and do not push the slider or trace below the fold on desktop.
- No hard-coded heart vocabulary when [TOPIC] is something else: labels, phase names, valve cards, class prompts, questions, the disclaimer and the series row all follow the variables.
- Must work at 1440 x 900 and 390 x 844 with zero console errors and no horizontal page scroll. Respect prefers-reduced-motion as described.
- No template name or mention of the prompt's source anywhere in the site, except the optional [CREDIT] footer link.

---
— Prompt by VibeFather · https://vibefather.ai/t/how-the-human-heart-works · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# 人体心脏如何运作

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

## 简介
由 [BRAND] 制作的单页交互式科学讲解页,说明 [TOPIC] 的工作原理。首屏就是工作示意图本身:一幅大型代码绘制的剖面图已经在运动,速率滑块和实时轨迹无需滚动即可见。一个时钟驱动所有运动部件。默认主题是人类心脏,在深茄紫底色上以钴蓝色表示缺氧血、猩红色表示富氧血,并配一条磷光绿色的 ECG 扫描线。如果 [TOPIC] 不是人类心脏,则完全保留页面结构、配色、时钟、轨迹条、聚光灯行为和区块顺序,在同一块 1000 x 900 画布上把示意图重绘为 [TOPIC] 的全新风格化剖面图,将钴蓝和猩红映射到 [FLOW_PATH] 中命名的两种状态,从 [FLOW_PATH] 取十个滚动停靠点,从 [RATE_CONTROL] 取滑块,从 [TRACE_SIGNAL] 取轨迹及其标记,并重写所有文案,确保不残留任何心脏相关词汇。

- 受众:[AUDIENCE]。他们通过分享链接或课程计划进入,使用笔记本电脑或手机,除中学科学外没有其他背景知识。
- 目标:让一个机制豁然开朗:读者应能拖动滑块,观察各部件保持同步,跟随路径从起点到终点,并向他人解释这个循环。所有文案都放在 src/content.ts 中;当变量值与默认值不同时,重写该文案以适配它们。
- 语气:清晰、好奇且准确,像一位在白板前的好老师。短句和具体动词。不炒作、不戏剧化,也不提供健康建议。

## 技术栈
- 框架:Vite 5 + 原生 TypeScript
- 样式:纯 CSS
- 库:vite(MIT)、typescript(Apache-2.0)、gsap(含其 ScrollTrigger 插件)(GSAP Standard License,免费且包含商业使用)、lucide(ISC)、@fontsource/gloock(OFL-1.1)、@fontsource-variable/hanken-grotesk(OFL-1.1)、@fontsource-variable/martian-mono(OFL-1.1)
- 构建:`npm run build` → 静态文件输出到 `dist/`。无后端、无服务端代码、无外部 API。
- 配置:
  - package.json 脚本:dev 运行 vite,build 运行 tsc --noEmit && vite build。使用严格模式的 TypeScript。
  - vite.config.ts 设置 base: './' 和 build.sourcemap: false,不使用任何插件。
  - 文件:index.html、public/favicon.svg、ASSETS.md、src/main.ts(负责连接逻辑和唯一的 requestAnimationFrame 循环)、src/model.ts(纯函数,提供基于 t 和 rate 的时序、音量、阀门和轨迹计算)、src/diagram.ts(createDiagram(svg, options) 工厂函数,用于图表的每一份副本)、src/trace.ts(canvas 扫描)、src/scroll.ts(GSAP ScrollTrigger 步骤)、src/content.ts(所有可见文案和变量值)、src/styles.css。
  - 只存在一个 requestAnimationFrame 循环。每一帧它推进一次时钟,然后用同一个 t 更新每个图表实例、每条轨迹和每个读数。任何跳动部件都不得由 CSS 动画或 GSAP 时间线驱动。
  - src/model.ts 不访问 DOM,因此暂停或单步的图表可以在任意 t 通过调用相同的函数来绘制。
  - 用 gsap.registerPlugin(ScrollTrigger) 注册一次 ScrollTrigger。GSAP 仅用于滚动触发和区块显现。
  - 标签页隐藏时暂停循环,并将帧间隔限制在 50 ms,以免返回时时钟跳变。
  - 用 devicePixelRatio 设置 canvas 尺寸,并在 resize 时重绘。
  - title 标签为 '[BRAND] | How [TOPIC] works'。favicon 为 public/favicon.svg。

## 变量
- [BRAND] — 发布者名称(默认:“Cutaway Lab”)。发布解说内容的虚构工作室或教师。
- [TOPIC] — 主题,以小写句中形式书写(默认:“the human heart”)。用于“How [TOPIC] works”中。选择一个具有重复循环和某物运动路径的机器或系统。
- [AUDIENCE] — 目标读者(默认:“curious adults and high school biology classes”)。决定阅读难度和课堂提示。
- [RATE_CONTROL] — 滑块名称、范围和起始值(默认:“Heart rate: 40–180 BPM, starting at 72”)。读者唯一可以拖动的数字。
- [FLOW_PATH] — 两种状态和十个停靠点(默认:“Cobalt, oxygen-poor blood: right atrium, tricuspid valve, right ventricle, pulmonary valve, lungs. Scarlet, oxygen-rich blood: left atrium, mitral valve, left ventricle, aortic valve, body.”)。每种颜色恰好五个停靠点,按行进顺序排列。这些将成为十个滚动步骤。
- [TRACE_SIGNAL] — 实时轨迹及其标记(默认:“Stylized ECG with P, QRS and T marks”)。由数学合成的信号,绝非录音。
- [CREDIT] — 在页脚保留一个小型“Template by VibeFather”链接至 https://vibefather.ai/t/how-the-human-heart-works(默认:是;删除此行即可移除)

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

## 设计
### 颜色
- 茄紫底色(Aubergine ground)`#16081A` — 页面背景与首屏底色;猩红与荧光填充上的文字颜色
- 茄紫面板(Aubergine panel)`#26102C` — 卡片、步骤面板、波形条背景
- 细线(Hairline)`#4B2A55` — 边框、分隔线、滑块刻度
- 钴蓝(Cobalt)`#1F4BFF` — 腔室与血管中缺氧血的填充
- 钴蓝壁(Cobalt wall)`#0F2A9E` — 钴蓝血管的壁
- 钴蓝文字(Cobalt text)`#7F9CFF` — 深色底上的钴蓝侧文字;浅色粒子
- 猩红(Scarlet)`#FF1F3D` — 腔室与血管中富氧血的填充
- 猩红壁(Scarlet wall)`#A80F2A` — 猩红血管的壁
- 猩红文字(Scarlet text)`#FF4A5E` — 深色底上的猩红侧文字
- 肌肉(Muscle)`#6A1B45` — 心脏壁填充
- 肌肉线(Muscle line)`#8E2A5A` — 心脏轮廓与纤维排线
- 荧光(Phosphor)`#39FF88` — ECG 波形、电火花、滑块拇指、激活状态、主 CTA 填充
- 瓣叶(Leaflet)`#FFE6D6` — 瓣膜瓣叶与铰点圆点
- 肺组织(Lung tissue)`#2A1033` — 肺填充,配 #6B4A78 描边
- 文字(Text)`#F8EEF4` — 标题与正文文字
- 弱化文字(Muted text)`#C9B6CE` — 次要文字与说明文字

### 字体排印
- 展示字体:H1 与章节标题,句首大写,行高 1.02。H1 在桌面端为 84px、移动端为 42px;章节标题为 56px 与 34px。:Gloock(OFL),字重 400
- 正文字体:正文 18px、行高 1.6,步骤说明文字,按钮 15px、字重 600:Hanken Grotesk Variable(OFL),字重 400/500/600
- 仪表字体:眉题、图示标签、读数与表格数字,12–14px 大写,标签字距 0.08em;心率读数为 64px、字重 500:Martian Mono Variable(OFL),字重 400/500

### 布局与动效
- 间距:8px 基准。页面最大宽度 1320px,桌面端左右留白 40px、移动端 16px。区块在桌面端垂直内边距 120px、移动端 72px。区块之间用 1px #4B2A55 的线分隔,而非交替背景。
- 圆角:卡片与步骤面板 14px。按钮与标签为胶囊形。波形条为方形并通栏延伸至边缘。
- 动效:时序模型位于 src/model.ts,以秒为单位,每次心搏的 R 峰处 t = 0:RR = 60 / rate;Ts = 0.16 + 0.12 * RR(收缩期);Td = RR - Ts(舒张期);PR = 0.06 + 0.08 * min(1, RR);Tic = 0.05;Tir = min(0.07, 0.25 * Td);Tf = RR - PR - Ts - Tir(充盈期)。
- 动效:五个阶段依次为:1 挤压开始,0 至 Tic。2 射血,Tic 至 Ts。3 舒张,Ts 至 Ts + Tir。4 充盈,Ts + Tir 至 RR - PR。5 心房补充,RR - PR 至 RR。
- 动效:心室缩放 v:F = 0.74 + 0.22 * (1 - exp(-Tf / 0.05)),E = F + 0.04。阶段 1 保持 E。阶段 2 从 E 缓入缓出至 0.74。阶段 3 保持 0.74。阶段 4 为 0.74 + 0.22 * (1 - exp(-tau / 0.05)),其中 tau 为阶段开始以来的时间。阶段 5 从 F 缓出至 E。高心率时充盈被截短,因此心室可见地充盈得更少。
- 动效:心房缩放 a:除阶段 5 外始终为 1,阶段 5 中 a = 1 - 0.12 * sin(pi * x),x 为该阶段的进度,从 0 到 1。
- 动效:瓣膜开放度,0 到 1。入口瓣膜(三尖瓣、二尖瓣)在阶段 1 的前 0.03 s 内从 1 降至 0,在阶段 2 和 3 保持 0,在阶段 4 的前 min(0.04, Tf) 内从 0 升至 1,在阶段 5 保持 1。出口瓣膜(肺动脉瓣、主动脉瓣)在阶段 2 的前 0.03 s 内从 0 升至 1,在阶段 3 的前 min(0.03, Tir) 内从 1 降至 0,其余时间保持 0。
- 动效:波形,合成为高斯函数之和 A * exp(-((t' - c)^2) / (2 * s^2)),其中 t' 为 t 环绕到 -RR/2 至 RR/2 区间后的值。P:A 0.15,c -PR,s 0.025。Q:A -0.12,c -0.025,s 0.009。R:A 1.0,c 0,s 0.011。S:A -0.22,c 0.028,s 0.011。T:A 0.30,c Ts - 0.05,s 0.045。
- 动效:心率变化时,保持当前周期比例(t / RR),使心搏永不跳变。滑块输入在同一帧生效。
- 动效:电火花,使用波形的环绕 t':从 t' = -PR - 0.02 到 t' = -PR + 0.06,一个 7 单位的荧光点沿传导线的心房段行进,与 P 标记同步;从 t' = -0.03 到 t' = 0.04,它沿室间隔段与两条分支行进,与 QRS 同步。火花经过时,节点圆点闪烁,线条不透明度从 0.25 提亮至 1。
- 动效:区块显现:标题与卡片通过 ScrollTrigger 在 0.5s 内淡入并上移 16px,仅触发一次。按钮按下时缩放至 0.97。聚光灯变暗过渡 0.35s。
- 动效:prefers-reduced-motion:时钟永不运行。每个图示渲染静态帧,首屏显示阶段 2 中点的帧,波形条绘制两个静态心搏,粒子隐藏,首屏图示下方出现 Previous 与 Next 按钮以逐步浏览五个阶段。滚动步骤仍切换聚光灯与说明文字,无过渡,液滴置于该步骤的停靠点。
- 图像:无照片,无下载图片。一切均以代码绘制为扁平、自信的解剖形状,肌肉上带细排线:现代印刷科学图版的感觉,依据本提示词中的坐标全新绘制,绝不描摹自图谱或教科书。对于另一个 [TOPIC],在同一画布上绘制同样简洁的剖面,使用相同的扁平填充、管壁、排线、瓣叶颜色与荧光信号线。

## 页面与区块
### [TOPIC] 的工作原理(`index.html`)
1. **图示规范(页面中每个图示共用)** — 不是可见区块:createDiagram 以内联 SVG 构建此图示,viewBox 为 '0 0 1000 900'。观察者面对该人物,因此人物的右侧位于屏幕左侧。以下所有形状均针对默认的 [TOPIC]。闭合形状为闭合的 Catmull-Rom 样条,转换为三次贝塞尔曲线(控制点 p1 + (p2 - p0) / 6 和 p2 - (p3 - p1) / 6)。管道是一条描边路径绘制两次,使用平头端点:先以宽度 W 绘制壁色,再以宽度 W - 12 绘制血液色。

腔室控制点,每个点围绕其锚点按模型缩放比例缩放(心房为 a,心室为 v)。
RA,钴蓝色(cobalt),锚点 (332,428):262,272 330,250 392,276 402,345 388,410 330,428 268,404 244,340。
LA,猩红色(scarlet),锚点 (626,404):566,266 640,244 716,266 738,324 712,386 640,404 574,388 548,328。
RV,钴蓝色(cobalt),锚点 (350,462):290,478 350,456 440,462 470,540 472,622 452,706 392,672 326,606 284,540。
LV,猩红色(scarlet),锚点 (626,450):548,482 622,446 704,470 730,550 710,652 656,738 596,790 552,716 530,626 526,546。

心脏轮廓,每个点标记其跟随的腔室。它围绕该腔室的锚点按 1 - (1 - scale) * 0.55 缩放:262,238 RA;400,236 RA;470,250 LA;550,236 LA;640,214 LA;742,244 LA;774,324 LA;752,410 LV;768,500 LV;768,584 LV;740,676 LV;676,776 LV;596,840 LV;530,792 LV;462,742 RV;388,710 RV;300,632 RV;252,548 RV;244,452 RV;216,404 RA;210,330 RA。填充 #6A1B45,描边 #8E2A5A,宽度 4。叠加同一路径,填充为间距 7 单位的线条图案,旋转 38 度,描边 #8E2A5A,宽度 1.6,不透明度 0.4。

绘制顺序,从后到前,每个项目位于其自己的命名组中,以便可以聚光突出:
1. 肺:闭合样条 66,160 120,126 168,170 176,270 160,370 96,396 46,340 40,240 及其镜像(x 变为 1000 - x),填充 #2A1033,描边 #6B4A78,宽度 3。在每个肺内,绘制分支树:递归线条,按正负 26 度分叉,长度乘以 0.72,描边宽度为 depth * 1.4,使用圆头端点。钴蓝色树从 (172,188) 角度 175 和 (828,188) 角度 5 开始,长度 40,深度 5。猩红色树从 (172,290) 角度 180、(172,346) 角度 170、(828,290) 角度 0 和 (828,346) 角度 10 开始,长度 34,深度 4。
2. 身体床:rect x 176,y 826,宽度 640,高度 52,半径 26,不透明度 0.85,带有从右侧 #FF1F3D 到左侧 #1F4BFF 的水平渐变。
3. 降主动脉:猩红色管道 M792 150 L792 838,W 50。
4. 左肺静脉,从心脏后方穿过:猩红色管道 M172 290 L300 290 和 M172 346 L300 346,W 34。
5. 心脏轮廓和阴影线。
6. 右肺静脉:猩红色管道 M828 290 L700 290 和 M828 346 L700 346,W 34。
7. 肺动脉作为一个组:先绘制壁描边,再绘制血液描边,使 T 形连接处干净。壁色 #0F2A9E:M172 188 L828 188 宽度 44 和 M432 210 L432 480 宽度 56。血液色 #1F4BFF:M172 188 L828 188 宽度 32 和 M432 188 L432 480 宽度 44。
8. 腔静脉:钴蓝色管道 M318 0 L318 280 和 M204 836 L204 500 C204 450 236 420 290 380,W 50。
9. 主动脉:猩红色管道 M612 502 C540 470 500 440 500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166,W 60。三条弓部分支:猩红色管道 M590 66 L590 0、M650 66 L650 0、M710 66 L710 0,W 26。然后以 #FF1F3D 宽度 48 重绘 M500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166,以清除分支末端。
10. 入口通道:钴蓝色 rect x 288,y 404,w 88,h 70 和猩红色 rect x 574,y 384,w 104,h 84。
11. 四个腔室,绘制在管道末端之上,使连接处消失。
12. 瓣膜,中心 x、中心 y、流向角度(度)、半宽:三尖瓣 332,442,90,44;二尖瓣 626,425,90,52;肺动脉瓣 432,290,-90,22;主动脉瓣 500,330,-90,24。每个瓣膜有两个瓣叶,铰接在中心加减垂直方向乘以半宽处,长度为半宽 * 1.04。瓣叶角度从指向中心(关闭)向流向方向转动,在开放度 1 时转动 87%。将每个瓣叶绘制为二次曲线,其中点沿流向方向推移 6 单位,描边 #FFE6D6,宽度 7,使用圆头端点,外加一个 5 单位的铰接点。
13. 传导线,描边 #39FF88,宽度 2.5:心房段 M262 262 C330 330 420 410 500 470;室间隔段 M500 470 L500 700;分支 M500 560 C450 600 400 620 360 600 和 M500 620 C550 680 620 700 680 640。节点圆点位于 (262,262) 半径 7 和 (500,470) 半径 6。
14. 粒子:90 个半径 3.5 的圆,钴蓝色路径上为 #7F9CFF,猩红色路径上为 #FF9AA6,均匀分布在这些路径上,当其闸门打开时以每秒 520 单位移动,否则为 40。始终打开:M318 0 L318 280;M204 836 L204 500 C204 450 236 420 290 380;M828 290 L700 290;M828 346 L700 346。当入口开放度高于 0.5 时打开:M330 340 L332 442 L380 560;M640 320 L626 425 L626 580。当出口开放度高于 0.5 时打开:M380 560 L432 480 L432 188;M432 188 L172 188;M432 188 L828 188;M626 580 L612 502 C540 470 500 440 500 390 L500 160 C500 92 560 56 640 56 C730 56 792 100 792 166 L792 838。
15. 标签,Martian Mono 15 单位,在缩略图上隐藏:'Right atrium' 位于 322,345 和 'Right ventricle' 位于 385,565,颜色 #FFFFFF;'Left atrium' 位于 640,325 和 'Left ventricle' 位于 628,590,颜色 #16081A;'Aorta' 位于 640,112,颜色 #FF4A5E;'Pulmonary artery' 位于 610,152,颜色 #7F9CFF;'Vena cava' 位于 350,30,颜色 #7F9CFF;'Lungs' 位于 108,112 和 892,112,颜色 #C9B6CE;'Body' 位于 496,858,颜色 #F8EEF4。全部居中。宽度低于 768px 时,仅显示 'RA'、'RV'、'LA'、'LV',36 单位。

createDiagram 接受 { labels, particles, frozenT, frozenRate },以便缩略图可以渲染固定帧。
   布局:一个函数,多个实例:hero、粘性滚动图示、阶段缩略图和小型轨迹区块图示。每个实例读取相同的时钟,除非被冻结。
2. **页眉** — 左侧:一个小的代码绘制标记(一个 20px 的圆垂直分割,左侧钴蓝色,右侧猩红色)和 [BRAND],使用 Hanken Grotesk 600。右侧,使用 Martian Mono 12px 大写:The beat、Blood path、Five moments、Rate、The trace、Valves、Class。每个都是同页哈希链接。在移动端仅显示标记、[BRAND] 和一个链接 'Blood path'。
   布局:粘性,桌面端高 64px,移动端高 52px。背景 #16081A,不透明度 92%,底部有 1px #4B2A55 线条。
   动效:当前区块的链接在滚动时变为 #39FF88。
3. **Hero:工作图示(id beat)** — 眉题:'[BRAND] Explainer No. 07'。H1:'How the human heart works'。副标题:'Four chambers, four valves and one electrical signal, running on a single clock. Drag the slider and watch every part keep time.'

仪表板:滑块标签 'Heart rate' 使用等宽字体;当前值显示为 64px 数字,旁边有 'BPM';范围输入从 40 到 180,步长 1,起始值 72,刻度位于 40、60、90、120、150、180,刻度上无文字;一个暂停和播放图标按钮;相位读数以 #39FF88 显示当前相位名称;'Systole 0.26 s' 和 'Diastole 0.57 s',实时计算到两位小数;以及一个 10px 的共享条,其中收缩期为 #39FF88,舒张期为 #4B2A55,其宽度实时更新。

按钮:主按钮 'Follow one drop of blood'(phosphor fill,#16081A 文字)链接到 #path。次按钮 'Step through one beat'(1px #4B2A55 轮廓)链接到 #moments。

图示下方的小方向说明行,使用柔和的等宽字体:'You are facing the person, so their right side is on your left.'

轨迹条说明文字,位于轨迹条左上角:'Stylized trace, synthesized from math. Not a recording.' 右上角,三个字母标签 P、QRS 和 T,活动标签旁有一句实时句子。P,在其中心 0.04 s 内:'P: the signal crosses the atria. They squeeze next.' QRS,从 -0.04 s 到 0.05 s:'QRS: the signal reaches the ventricles. They squeeze next.' T,在其中心 0.05 s 内:'T: the ventricles reset for the next beat.'
   布局:桌面端:页眉下方恰好 100vh,作为一列。上部区域是两列网格:左列 500px,包含眉题、H1、副标题、仪表盘和按钮,垂直居中;右列是图示,填满所有剩余高度,其完整的 1000 x 900 画布可见且无任何裁剪。下部区域是轨迹条,168px 高,全出血,#26102C,顶部和底部线条为 #4B2A55。在 1440 x 900 下一切可见,无需滚动。移动端:堆叠,按此顺序:眉题和 H1、全宽图示、数值和滑块、相位读数及收缩期和舒张期数值、110px 高的轨迹条,然后副标题和按钮位于首屏下方。
   动效:图示从第一帧开始跳动,无入场动画。轨迹:画布扫描以恒定速度从左向右移动,5 s 内穿过轨迹条,因此速率升高时可容纳更多心搏。每帧以 1/240 s 为步长推进,确保不遗漏任何 QRS。线条 #39FF88,2px,带 8px 阴影模糊;较旧的列随老化淡至 35% alpha;亮头部圆点前方擦除 28px 间隙。基线位于轨迹条高度的 62%,垂直缩放为每 1.0 信号对应高度的 50%。在波形上方绘制每个波时,在其上方写入小号 'P'、'QRS' 和 'T' 标记,随线条淡出。键盘:滑块使用原生方向键;当焦点不在按钮或链接上时,空格切换暂停。
4. **跟随一滴血(id path)** — 标题:'Follow one drop of blood'。引言:'One full trip goes through the heart twice. Scroll, and the diagram lights up each stop in order.'

十个步骤,每个步骤有一个等宽编号、一个 Gloock 字体的短标题和一段说明。等宽编号在步骤 1–5 为 #7F9CFF,在步骤 6–10 为 #FF4A5E。
1 右心房,'Arrival':'Blood back from the body collects here, through one large vein from above and one from below. It has given up much of its oxygen, so it is drawn in cobalt.'
2 三尖瓣,'A one-way door opens':'When the chamber below relaxes, pressure drops and this valve swings open. A small squeeze from the atrium tops up the ventricle before the door shuts.'
3 右心室,'The short push':'The electrical signal arrives and this chamber squeezes. The tricuspid valve shuts so nothing flows back. The wall is thinner here because the lungs are close by.'
4 肺动脉瓣,'Out to the lungs':'Pressure forces these cusps open and blood leaves through the pulmonary artery. When the squeeze ends, the cusps catch the backflow and seal.'
5 肺,'The color change':'Blood spreads through tiny vessels wrapped around air sacs. Carbon dioxide leaves and oxygen comes in. This is where the diagram turns from cobalt to scarlet.'
6 左心房,'Back to the heart':'Four veins carry the refreshed blood back. The left atrium holds it until the next relaxation, filling at the same time as its partner on the other side.'
7 二尖瓣,'The two-leaflet door':'This valve has two leaflets where the tricuspid has three. It opens as the left ventricle relaxes, and the atrium adds a last squeeze.'
8 左心室,'The thick wall':'This chamber has the heaviest wall in the diagram. It sends blood all the way around the body, against far more resistance than the right side faces.'
9 主动脉瓣,'The big exit':'Both ventricles squeeze together, so this valve opens at the same moment as the pulmonary valve. Blood rushes into the aorta, and the first branches arch off toward the head and arms.'
10 身体,'The long way round':'Arteries divide into smaller and smaller vessels until oxygen can pass to the tissue. The blood turns cobalt again and heads for the two large veins. Then the trip starts over.'

血滴停靠点按图示单位依次为:(330,340)、(332,442)、(380,560)、(432,290),然后 (432,188) 和 (880,188) 在前往 (880,290) 的肺途中,然后 (700,290) 在前往 (640,320)、(626,425)、(626,580)、(500,330) 的途中,然后 (500,120)、(640,56) 和 (792,166) 在前往 (792,700) 的身体途中。随后血滴继续前往 (500,852) 和 (204,836),作为最后一步的结束。

每步的聚光目标:1 RA;2 三尖瓣和入口通道;3 RV;4 肺动脉瓣和肺动脉;5 双肺;6 LA 和右肺静脉;7 二尖瓣和入口通道;8 LV;9 主动脉瓣和主动脉;10 主动脉、降主动脉、身体床和双腔静脉。
   布局:桌面端:两列。左侧 42%:步骤,每个步骤 min-height 80vh,其卡片垂直居中(14px 圆角,#26102C,1px #4B2A55 边框,32px 内边距)。右侧 58%:一个粘性面板,top 64px,高度 calc(100vh - 64px),容纳图示,除活动停靠点的标签外标签关闭,其下方是 96px 轨迹条,其右边缘是一列十个进度点。移动端:粘性面板位于顶部,44svh,无轨迹条,步骤卡片在其下方以全宽滚动,间距 60vh。
   动效:每个步骤上的 ScrollTrigger(start 'top 60%',end 'bottom 60%')设置活动步骤。聚光之外的一切在 0.35s 内变暗至不透明度 0.22。聚光目标保持完全不透明,并带有 SVG 辉光(feGaussianBlur stdDeviation 8,合并到源下方)。目标旁出现一条引导线和停靠点名称。第二个 ScrollTrigger 在整个区块内擦洗,沿折线移动血滴:一个 10 单位圆,带 3 单位 #F8EEF4 环,在肺之前填充 #1F4BFF,之后填充 #FF1F3D。心脏在这一切期间持续跳动,速率由滑块控制。活动卡片边框变为 #39FF88;其进度点填充。
5. **一次心搏,五个瞬间(id moments)** — 标题:'One beat, five moments'。引言:'Pick a moment and the page holds there. Every diagram, trace and valve card waits with it.'

五个图块,每个图块有一个在其相位中点冻结的缩略图、一个名称、一句话和两个标签。
1 'Squeeze begins':'The ventricles tighten, but every valve is shut. Pressure climbs with nowhere to go.' 标签:'Inlets closed'、'Outlets closed'。
2 'Ejection':'Pressure wins. The outlet valves open and blood leaves for the lungs and the body.' 标签:'Inlets closed'、'Outlets open'。
3 'Relaxation':'The ventricles let go. The outlet valves snap shut against the backflow, and for a moment everything is closed again.' 标签:'Inlets closed'、'Outlets closed'。
4 'Filling':'Pressure falls below the atria. The inlet valves open and blood pours down.' 标签:'Inlets open'、'Outlets closed'。
5 'Atrial top-up':'A small squeeze from the atria pushes in the last of the blood, just before the next beat.' 标签:'Inlets open'、'Outlets closed'。

图块下方的控件:Previous、Next 和 'Back to live',带 Lucide 箭头图标。
   布局:桌面端:五个等宽列,16px 间距。每个图块是一张 #26102C 卡片,缩略图在顶部(标签和粒子关闭)。选中图块:2px #39FF88 边框。移动端:水平滚动吸附行,卡片宽 78vw。
   动效:点击图块暂停时钟并将 t 设置为该相位的中点。所有图示和读数更新。轨迹保留已绘制的线条并停止。'Back to live' 从该 t 恢复。图块缩略图从不动画。同一区块也是减少动效的回退方案,工作方式完全相同。
6. **更快的心搏,更短的休息(id rate)** — 标题:'Faster beats, shorter rests'。引言:'Systole, the squeeze, barely changes as the rate climbs. Diastole, the rest and refill, gives up almost all of the difference.'

一个条形表格,速率 40、60、90、120、150 和 180,外加一行标记为 'Your slider' 的实时行,重复当前速率。所有数字均由图示使用的同一函数中的时序模型计算。在这些速率下,收缩期和舒张期的秒值为:40:0.34,1.16。60:0.28,0.72。90:0.24,0.43。120:0.22,0.28。150:0.21,0.19。180:0.20,0.13。

说明文字,弱化等宽字体:'Output of the simple model on this page, not measured data. It is drawn to show the pattern.' 任何地方都不要用文字把任何速率描述为良好、不良、典型、健康或危险。
   布局:每一行:左侧为等宽字体的速率,然后是在共享时间尺度上的水平条(1.5 s 等于全宽),收缩期为 #39FF88,舒张期为 #4B2A55,带 #C9B6CE 1px 描边,然后右侧是两个数字。行高为 44px。'Your slider' 行位于顶部 #26102C 色带上,带有自己的紧凑版范围输入控件,并与主视觉滑块保持同步。在移动端,数字移到条形下方。
   动效:条形在首次显示时从零开始,在 0.6s 内增长。实时行在每次滑块输入时更新。
7. **解读波形(id trace)** — 标题:'Three marks on one line'。引言:'The trace shows the electrical signal, not the movement. The signal comes first, then the muscle answers.'

三张卡片。
'P':'A spark starts at the top of the right atrium and spreads across both atria. They squeeze a moment later.' 高亮心房传导段、RA 和 LA。
'QRS':'The signal drops down the wall between the ventricles and fans out. It is the tallest mark because the ventricles are the largest muscle in the diagram.' 高亮室间隔段、分支、RV 和 LV。
'T':'The ventricle muscle resets, ready for the next signal. The chambers are finishing their squeeze as this mark passes.' 高亮 RV 和 LV。

下方注释:'This line is built from smooth math curves to show where each mark falls. It cannot be used to read a real heart.'
   布局:顶部:一个大型静态 SVG,显示来自同一波形函数的单次搏动,全内容宽度、240px 高,位于 #26102C 上,带有 #4B2A55 的微弱 40px 网格线,并标注三个标记。下方两列:左侧为三张卡片,右侧为一个关闭标签的小图,宽 420px。在移动端,小图位于波形和卡片之间。
   动效:悬停、聚焦或轻触卡片时,会在静态波形中以完整荧光高亮其对应部分(其余部分变暗至 35%),并在小图中聚光显示其部件,小图持续搏动。
8. **四个瓣膜,一个方向(id valves)** — 标题:'Four valves, one direction'。引言:'Valves do not push anything. They open and close because of pressure on either side.'

四张卡片,每张包含一个动画特写、名称、路径和状态行。
'Tricuspid':'Right atrium to right ventricle. Three leaflets, shown as two in this slice.'
'Pulmonary':'Right ventricle to pulmonary artery. Three cusps, shown as two in this slice.'
'Mitral':'Left atrium to left ventricle. Two leaflets.'
'Aortic':'Left ventricle to aorta. Three cusps, shown as two in this slice.'
每张卡片上的实时状态行,使用等宽字体:'Open' 为 #39FF88,或 'Closed' 为 #C9B6CE,来自相同的开放度值,其中 Open 表示高于 0.5。
   布局:桌面端为四张等宽卡片,移动端为两列。每个特写是一个 200 x 140 SVG:在两堵 #6A1B45 壁之间有一条正确血液颜色的通道,带有两个大型 #FFE6D6 瓣叶,使用相同的瓣膜函数,缩放为两倍。
   动效:瓣叶跟随实时时钟。粒子仅在该瓣膜打开时穿过通道。
9. **课堂使用(id class)** — 标题:'Use it in class'。三个编号提示:
1 'Set the slider to 40, then to 180. Which part of the beat lost more time, and what did the ventricles do differently?'
2 'Pause on Ejection. Name the two open valves and say why the other two must stay shut.'
3 'Find the point where the diagram turns from cobalt to scarlet. What changed, and where?'

四个问题,使用原生 details 和 summary 元素:
'Why does the trace move before the heart does?':'The electrical signal comes first and the muscle responds a moment later. Watch the green spark travel just before each squeeze.'
'Is this a real ECG?':'No. The trace is a sum of smooth math curves shaped to show where P, QRS and T fall. It is not a recording and should not be read as one.'
'Are the timings real?':'They come from a simple formula chosen to show one pattern: systole barely changes while diastole shrinks. Treat them as a teaching model, not as measurements.'
'Can this page tell me anything about my own heart?':'No. It does not read your pulse and it cannot assess anything. Questions about your own heart belong with a clinician.'
   布局:桌面端为两列:左侧为提示,带有 #FF4A5E 的大型 Gloock 数字;右侧为问题,带有 1px #4B2A55 分隔线。移动端为一列。
   动效:每个问题上的加号图标在打开时旋转 45 度。
10. **页脚** — 免责声明行使用 Hanken Grotesk 18px:'A stylized teaching model for [AUDIENCE]. Not medical advice and not a measuring tool.' 版权页信息使用弱化等宽字体:'Words: Odalys Renn. Drawing and code: Teo Marchetti. Published by [BRAND].' 一行标题为 'Next in the series',包含三个非链接条目,标记为 'In progress':'How lungs trade gas'、'How a kidney filters'、'How a four-stroke engine breathes'。[CREDIT] 链接在保留时位于底部行的最右侧。
   布局:全宽色带:顶部边框为从 #1F4BFF 到 #FF1F3D 的 6px 水平渐变,然后在 #16081A 上为三列网格,内边距 64px。移动端为一列。
   动效:无。

## 资产
- 图像:未下载任何图像。所有视觉元素均根据本提示词中的坐标以代码绘制:图表使用内联 SVG,轨迹使用 canvas。public/favicon.svg 为手写:一个 #16081A 圆角方块,内含一个垂直分割的圆形,左侧为 #1F4BFF,右侧为 #FF1F3D。在项目根目录的 ASSETS.md 中,列出 gsap、lucide 以及三种字体,并注明路径、来源 URL、作者和许可证,同时说明该项目不包含任何第三方图像。
- 图标:Lucide(ISC),来自 lucide npm 包,逐个导入并以内联 SVG 渲染:Play、Pause、ChevronLeft、ChevronRight、Plus。页眉标记为手绘内联 SVG。
- 字体:通过 @fontsource/gloock(400)、@fontsource-variable/hanken-grotesk 和 @fontsource-variable/martian-mono 自托管,均为 OFL-1.1,在 src/main.ts 中导入。

## 禁止事项
- 不得包含后端、服务器代码、API 路由、数据库、认证、任何会提交到某处的表单或第三方 API。不得访问摄像头、麦克风或传感器。
- 不得使用 CDN 的 script 或 link 标签,不得使用 fonts.googleapis.com 或 fonts.gstatic.com,不得包含分析统计。字体、图标和脚本全部本地打包。
- 不得包含 source map,不得将 src/ 复制到 dist/。使用 Vite base './' 的相对资源路径。保持 dist/ 在 20 MB 以下。同页链接为哈希链接,任何指向页面自身的链接都使用 ./index.html,绝不使用裸目录。
- 不得使用从解剖图谱、教科书或商业医学插图中描摹的图版或线条。仅根据此处的坐标绘制示意图,或为另一个 [TOPIC] 全新绘制为风格化插图。
- 不得使用真实患者 ECG 记录或复制的波形描记。波形由此处的数学合成,并标注为风格化。
- 不得出现医院、健康慈善机构、医学期刊或设备制造商的标志、名称或徽章。
- 不得复制健康百科、教科书或患者手册中的文字。使用此处撰写的文案。
- 不得包含诊断功能或医疗建议:不得有症状检查器,不得读取用户自己的脉搏,不得标注某速率或节律为健康、正常、良好、有风险或危险,不得提及具名疾病,不得有治疗或药物声明。
- 不得使用真实器官、手术或患者的照片,不得有血腥内容。不得有逼真的血液飞溅或滴落。
- 不得编造统计数据或专家引语并作为有出处的医学事实呈现,不得有医生背书或“医学审核”徽章。页面上的数字来自所述模型,并标注为模型输出。
- 不得有第二个动画时钟:不得使用 CSS keyframes、GSAP 时间线或独立循环来驱动腔室、瓣膜、粒子或波形描记。
- 不得回退到苍白背景或柔和配色。钴蓝(cobalt)和猩红(scarlet)都必须填充 hero 的大面积区域。
- 不得在 hero 中裁剪示意图,不得在桌面端将滑块或波形描记推到首屏以下。
- 当 [TOPIC] 是其他主题时,不得硬编码心脏相关词汇:标签、阶段名称、瓣膜卡片、类别提示、问题、免责声明和系列行都遵循变量。
- 必须在 1440 x 900 和 390 x 844 下正常工作,控制台零错误,页面无水平滚动。按所述尊重 prefers-reduced-motion。
- 站点中任何位置不得出现模板名称或提及提示词来源,可选的 [CREDIT] 页脚链接除外。

---
— Prompt by VibeFather · https://vibefather.ai/t/how-the-human-heart-works · 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: "How the Human Heart Works"
colors:
  aubergine_ground: "#16081A"
  aubergine_panel: "#26102C"
  hairline: "#4B2A55"
  cobalt: "#1F4BFF"
  cobalt_wall: "#0F2A9E"
  cobalt_text: "#7F9CFF"
  scarlet: "#FF1F3D"
  scarlet_wall: "#A80F2A"
  scarlet_text: "#FF4A5E"
  muscle: "#6A1B45"
  muscle_line: "#8E2A5A"
  phosphor: "#39FF88"
  leaflet: "#FFE6D6"
  lung_tissue: "#2A1033"
  text: "#F8EEF4"
  muted_text: "#C9B6CE"
typography:
  display_h1_and_section_headings_sentence_case_line_height_1_02_h1_is_84px_on_desktop_and_42px_on_mobile_section_headings_are_56px_and_34px: { family: "Gloock", weights: [400] }
  text_body_at_18px_with_line_height_1_6_step_captions_buttons_at_15px_weight_600: { family: "Hanken Grotesk Variable", weights: [400, 500, 600] }
  instrument_eyebrows_diagram_labels_readouts_and_table_numbers_12_14px_uppercase_with_0_08em_tracking_for_labels_the_rate_readout_is_64px_weight_500: { family: "Martian Mono Variable", weights: [400, 500] }
spacing: "8px base. Page max-width 1320px with 40px gutters on desktop and 16px on mobile. Sections have 120px vertical padding on desktop and 72px on mobile. Sections are divided by a 1px #4B2A55 line, not by alternating backgrounds."
radius: "Cards and step panels 14px. Buttons and chips are pills. The trace strip is square and runs edge to edge."
---

# How the Human Heart Works — 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
- **Aubergine ground** `#16081A` — Page background and hero ground; the text color on scarlet and phosphor fills
- **Aubergine panel** `#26102C` — Cards, step panels, the trace strip background
- **Hairline** `#4B2A55` — Borders, dividers, slider ticks
- **Cobalt** `#1F4BFF` — Oxygen-poor blood fill in chambers and vessels
- **Cobalt wall** `#0F2A9E` — Walls of cobalt vessels
- **Cobalt text** `#7F9CFF` — Cobalt-side text on dark grounds; light particles
- **Scarlet** `#FF1F3D` — Oxygen-rich blood fill in chambers and vessels
- **Scarlet wall** `#A80F2A` — Walls of scarlet vessels
- **Scarlet text** `#FF4A5E` — Scarlet-side text on dark grounds
- **Muscle** `#6A1B45` — Heart wall fill
- **Muscle line** `#8E2A5A` — Heart outline and fiber hatch
- **Phosphor** `#39FF88` — ECG trace, electrical spark, slider thumb, active states, primary CTA fill
- **Leaflet** `#FFE6D6` — Valve leaflets and hinge dots
- **Lung tissue** `#2A1033` — Lung fill, with a #6B4A78 outline
- **Text** `#F8EEF4` — Headings and body text
- **Muted text** `#C9B6CE` — Secondary text and captions

## Typography
- **Display: H1 and section headings, sentence case, line-height 1.02. H1 is 84px on desktop and 42px on mobile; section headings are 56px and 34px.** — Gloock (OFL), weights 400. Self-host the font files.
- **Text: body at 18px with line-height 1.6, step captions, buttons at 15px weight 600** — Hanken Grotesk Variable (OFL), weights 400/500/600. Self-host the font files.
- **Instrument: eyebrows, diagram labels, readouts and table numbers, 12–14px uppercase with 0.08em tracking for labels; the rate readout is 64px weight 500** — Martian Mono Variable (OFL), weights 400/500. Self-host the font files.

## Spacing & shape
- Spacing: 8px base. Page max-width 1320px with 40px gutters on desktop and 16px on mobile. Sections have 120px vertical padding on desktop and 72px on mobile. Sections are divided by a 1px #4B2A55 line, not by alternating backgrounds.
- Radius: Cards and step panels 14px. Buttons and chips are pills. The trace strip is square and runs edge to edge.

## Motion
- Timing model in src/model.ts, in seconds, with t = 0 at the R peak of each beat: RR = 60 / rate; Ts = 0.16 + 0.12 * RR (systole); Td = RR - Ts (diastole); PR = 0.06 + 0.08 * min(1, RR); Tic = 0.05; Tir = min(0.07, 0.25 * Td); Tf = RR - PR - Ts - Tir (filling).
- Five phases in order: 1 Squeeze begins, 0 to Tic. 2 Ejection, Tic to Ts. 3 Relaxation, Ts to Ts + Tir. 4 Filling, Ts + Tir to RR - PR. 5 Atrial top-up, RR - PR to RR.
- Ventricle scale v: F = 0.74 + 0.22 * (1 - exp(-Tf / 0.05)) and E = F + 0.04. Phase 1 holds E. Phase 2 eases in-out from E to 0.74. Phase 3 holds 0.74. Phase 4 is 0.74 + 0.22 * (1 - exp(-tau / 0.05)), where tau is time since the phase began. Phase 5 eases out from F to E. At high rates filling is cut short, so the ventricle visibly fills less.
- Atrium scale a: 1 at all times except phase 5, where a = 1 - 0.12 * sin(pi * x) and x is progress through the phase from 0 to 1.
- Valve openness, 0 to 1. Inlet valves (tricuspid, mitral) ramp 1 to 0 over the first 0.03 s of phase 1, stay 0 through phases 2 and 3, ramp 0 to 1 over the first min(0.04, Tf) of phase 4, and stay 1 through phase 5. Outlet valves (pulmonary, aortic) ramp 0 to 1 over the first 0.03 s of phase 2, ramp 1 to 0 over the first min(0.03, Tir) of phase 3, and stay 0 otherwise.
- Trace, synthesized as a sum of gaussians A * exp(-((t' - c)^2) / (2 * s^2)), where t' is t wrapped into -RR/2 to RR/2. P: A 0.15, c -PR, s 0.025. Q: A -0.12, c -0.025, s 0.009. R: A 1.0, c 0, s 0.011. S: A -0.22, c 0.028, s 0.011. T: A 0.30, c Ts - 0.05, s 0.045.
- When the rate changes, keep the current fraction of the cycle (t / RR) so the beat never jumps. Slider input takes effect on the same frame.
- Electrical spark, using the wrapped t' of the trace: from t' = -PR - 0.02 to t' = -PR + 0.06 a 7-unit phosphor dot travels the atrial segment of the conduction line, in step with the P mark; from t' = -0.03 to t' = 0.04 it travels the septal segment and both branches, in step with QRS. The node dots flash and the line brightens from 0.25 to 1 opacity as the spark passes.
- Section reveals: headings and cards fade in and rise 16px over 0.5s via ScrollTrigger, once only. Buttons scale to 0.97 on press. Spotlight dimming transitions over 0.35s.
- prefers-reduced-motion: the clock never runs. Every diagram renders a static frame, the hero shows the frame for the mid-point of phase 2, the trace strip draws two static beats, particles are hidden, and Previous and Next buttons appear under the hero diagram to step through the five phases. Scroll steps still swap the spotlight and caption, with no transitions and the drop placed at the step's stop.

## Imagery
No photographs and no downloaded images. Everything is drawn in code as flat, confident anatomical shapes with a fine hatch on the muscle: the feel of a modern printed scientific plate, drawn fresh from the coordinates in this prompt, never traced from an atlas or textbook. For another [TOPIC], draw an equally simple cross-section on the same canvas with the same flat fills, tube walls, hatch, leaflet color and phosphor signal line.

## Tone
Clear, curious and exact, like a good teacher at a whiteboard. Short sentences and concrete verbs. No hype, no drama and no health advice.

---
— Prompt by VibeFather · https://vibefather.ai/t/how-the-human-heart-works · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

改成你自己的

  • 一位生物老师:把 BRAND 设成你的名字,保留 TOPIC 为人体心脏,并为你课上讲的循环路径重写滚动停靠点。
  • 一位科学传播者:把 TOPIC 指向另一个身体系统,把钴蓝和猩红映射到它的两个状态,并在同一画布上重绘示意图。
  • 一位工程教育者:把 TOPIC 设为四冲程发动机,从活塞循环中取十个停靠点,并把心电图描记换成压力信号。
  • 一个博物馆或外展团队:把 AUDIENCE 设为来访家庭,缩短步骤说明,并保留心率滑块作为动手控件。

人体心脏如何工作:常见问题

页面上的跳动心脏示意图和心电图描记如何保持同步?

人体心脏如何工作模板为整个页面运行一个时钟。每一帧推进该时钟一次,然后根据同一个时间值绘制所有运动部件:心腔大小、瓣膜叶片、血液粒子和磷绿色心电图扫掠。由于没有任何 CSS 动画或独立时间线驱动跳动部件,示意图和描记图不会彼此漂移,拖动速率滑块时会在同一帧生效。

我移动 BPM 滑块时,它实际改变了什么?

人体心脏如何工作模板中的滑块把心率设定在每分钟 40 到 180 次之间,起始值为 72。改变心率会重新计算整个周期:收缩部分大致保持不变,而静息和充盈部分缩短,所以在高心率下心室明显充盈更少。拖动时模板会保持你在当前心跳中的位置,因此动画不会跳变。

怎么用 AI 做一个人体心脏如何工作?

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