用这个模板做的 2 个案例
同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。关于这个模板
Quietwave 是一个单页交互式解说页,讲解降噪耳机的工作原理,版式像印刷科学杂志里的一篇专题。开头是一个大号衬线标题和一道缓慢漂移的声波。接着带读者走过四个章节:什么是声波、反相声波如何抵消它、耳罩里有什么、以及为什么仍有部分噪音会漏进来。最后是一个四题测验,即时给出反馈。
它适合科学作者、教师、博物馆与科普团队、需要解释自家技术的硬件创业公司,以及任何想讲透一个概念、而不是罗列功能的人。所有图形都用代码绘制。声波是 Canvas 2D,耳罩剖面图和频率图是内联 SVG,整站不使用照片、音频或麦克风权限,因此没有图片授权需要管理。
设计采用暖调米白纸色、深墨文字、细线分隔、图号和斜体图注。两种强调色承载含义:青色始终代表噪音,珊瑚色始终代表反噪。在滚动叙事章节中,粘性图会随着每个文字步骤滚入视野而改变状态。相位实验室让读者拖动珊瑚色波形或 0° 到 360° 的滑块,观察合成线在 180° 处变平,并实时显示结果有多响。耳罩示意图逐件构建,配有编号标注和引线。在减少动态效果模式下,声波保持静止,步骤切换不带动画,所有控件仍然可用。
要改编它,只需更换出版物名称、设备、噪声源、读者和期号标签。所有文案都放在一个内容文件里,示意图保持同样的四段结构:感知、计算、演示和检验。
模板提示词
在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。
# Interactive Science Explainer Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else. ## Brief A single-page scrollytelling science explainer titled 'Silence, made of sound', published by the invented magazine [BRAND]. It explains how [DEVICE] cancel [NOISE_SOURCE] in four chapters. (1) Sound as a pressure wave: a sticky live canvas changes state with each scroll step. (2) The anti-noise phase lab: the reader drags a coral anti-noise wave or a 0–360° slider, and the summed wave flattens at 180° while a live readout shows the resulting level. (3) Inside the earcup: a hand-drawn SVG cut-away builds up part by part with numbered callouts. (4) Limits: an animated SVG bar chart of active versus passive cancellation by frequency. A four-question quiz with instant feedback closes the page. Everything is drawn in Canvas 2D or inline SVG. There is no audio, no microphone and no images. - Audience: [READER]: curious, non-specialist readers who enjoy a well-made magazine feature and learn best by touching the idea, not by reading formulas. - Goal: Make one idea click: adding a wave that is exactly out of phase with the noise makes the noise disappear. Let readers prove it to themselves with the slider, see where it happens inside the device, and check their understanding with the quiz. - Tone: Calm, precise, warm, like a good science-magazine feature. Short declarative sentences, no exclamation marks, no hype, no jargon left unexplained. Figure numbers, captions and quiet confidence. ## Stack - Framework: Vite 5 + vanilla TypeScript - Styling: Plain CSS (custom properties) - Libraries: vite (MIT), typescript (Apache-2.0), @fontsource-variable/newsreader (OFL-1.1), @fontsource/ibm-plex-sans (OFL-1.1), @fontsource/ibm-plex-mono (OFL-1.1) - Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs. - Setup: - Scaffold with npm create vite@5 quietwave -- --template vanilla-ts. Add no framework and no runtime libraries beyond the three Fontsource packages. - vite.config.ts: base: './', build.outDir 'dist', build.sourcemap false, build.minify true. No plugins. - Import fonts in src/main.ts: '@fontsource-variable/newsreader/wght.css', '@fontsource-variable/newsreader/wght-italic.css', '@fontsource/ibm-plex-sans/400.css', '/500.css', '/600.css', '@fontsource/ibm-plex-mono/400.css', '/500.css'. - File layout: src/content.ts (every visible string, quiz data and variable values), src/styles/tokens.css (colors, type scale, spacing as CSS custom properties), src/styles/base.css, src/styles/sections.css, src/lib/canvas.ts (DPR-aware canvas setup with ResizeObserver), src/lib/motion.ts (prefers-reduced-motion flag plus lerp/ease helpers), src/figures/pressure.ts (Figure 1), src/figures/phaseLab.ts (Figure 2), src/figures/earcup.ts (builds the SVG for Figure 3), src/figures/bands.ts (Figure 4), src/scrolly.ts (IntersectionObserver step engine), src/quiz.ts, src/main.ts. - Define the variables at the top of src/content.ts as a const VARS object (BRAND, DEVICE, NOISE_SOURCE, READER, ISSUE_LABEL) and build every string from it with template literals. If the values differ from the defaults, rewrite the section copy so it reads naturally for the new device and noise source. Keep the structure, step count and quiz length. - index.html holds only the semantic skeleton (header, main with section ids hero, chapter-1, chapter-2, chapter-3, chapter-4, quiz, footer). main.ts fills text from content.ts and mounts the figures. - Every canvas: set width/height to CSS size × devicePixelRatio (cap DPR at 2), scale the context, redraw on ResizeObserver, and run requestAnimationFrame only while the canvas is on screen (IntersectionObserver), cancelling the frame when it leaves. - All keyframes and transitions live in src/styles/sections.css. JS changes state only through data-attributes (data-step, data-active, data-state) and CSS custom properties. - public/favicon.svg: a 32×32 square in #F6F2EA with a teal (#1F7A7A) sine wave and a coral (#E0654A) inverted sine wave crossing, and a flat ink (#1B1E23) line through the middle. Link it from index.html. Document <title>: '[BRAND] — How [DEVICE] work'. - package.json scripts: dev = vite, build = tsc --noEmit && vite build, preview = vite preview. ## Variables - [BRAND] — Publication name (default: "Kestrel Review"). The invented magazine that publishes the explainer; shown in the masthead and footer. - [DEVICE] — Device being explained (plural noun phrase) (default: "noise-cancelling headphones"). Used in the title, dek and chapter copy, e.g. 'How [DEVICE] work'. - [NOISE_SOURCE] — Steady noise being cancelled (default: "the low hum of a jet cabin"). Lower-case phrase used mid-sentence; should be a steady, low-pitched sound. - [READER] — Who the piece is for (default: "curious commuters"). Plural noun phrase used in the hero byline and the closing step. - [ISSUE_LABEL] — Issue / section label (default: "Issue 14 · Acoustics"). Short label in the masthead, next to the brand. - [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/interactive-science-explainer 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.
Pro 模板
解锁完整提示词和源码
- 完整提示词:设计、版块、动效、素材
- 每个在线演示的源码
- 商用授权
在线演示和 DESIGN.md 仍然免费。
DESIGN.md
单独的设计规范:配色、字体、间距和动效。可以把这套视觉用到你已有的项目上。
---
name: "Interactive Science Explainer"
colors:
paper: "#F6F2EA"
paper_deep: "#EDE6D8"
ink: "#1B1E23"
ink_muted: "#5C6169"
rule: "#D8D0C0"
teal: "#1F7A7A"
teal_wash: "#D5E8E5"
coral: "#E0654A"
coral_wash: "#F7DDD4"
typography:
display_serif_h1_h2_step_headings_pull_quote_captions_italic_masthead_wordmark: { family: "Newsreader (variable, with italic)", weights: [400, 500, 600] }
text_sans_body_copy_dek_fallback_buttons_quiz_options: { family: "IBM Plex Sans", weights: [400, 500, 600] }
mono_kickers_figure_numbers_callout_numbers_readouts_axis_labels: { family: "IBM Plex Mono", weights: [400, 500] }
spacing: "8px base unit. Page max-width 1200px with 32px side gutters (20px under 720px). 12-column grid, 24px gap. Reading column max-width 640px (about 66ch). Section padding 160px top/bottom on desktop, 96px on mobile. Each scroll step min-height 80vh. Type scale: H1 clamp(3rem, 6.5vw, 6rem), line-height 0.98, letter-spacing -0.02em, Newsreader 500. H2 clamp(2.25rem, 4vw, 3.5rem), line-height 1.05, Newsreader 500. Step heading 1.5rem, Newsreader 600. Body 18px, line-height 1.65, IBM Plex Sans 400. Dek 1.5rem, Newsreader 400 italic. Caption 15px, Newsreader 400 italic, ink-muted. Kicker 12px, IBM Plex Mono 500, uppercase, letter-spacing 0.12em, teal. Readouts 28px IBM Plex Mono 500 with tabular-nums."
radius: "Nearly square: 2px on figure panels, cards and buttons; 999px only on the slider thumb, callout number circles and the 'Cancelled' badge."
---
# Interactive Science Explainer — 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
- **paper** `#F6F2EA` — Page background (warm off-white)
- **paper-deep** `#EDE6D8` — Figure panels, phase-lab card, quiz option hover, SVG cut-face fill
- **ink** `#1B1E23` — Body text, headings, summed wave, SVG outlines
- **ink-muted** `#5C6169` — Captions, bylines, inactive steps, axis labels
- **rule** `#D8D0C0` — Hairline rules (1px), grid lines on canvases, input track
- **teal** `#1F7A7A` — The noise / signal: noise wave, kickers, reading progress bar, correct answers
- **teal-wash** `#D5E8E5` — Teal tint behind correct quiz feedback and the 'Cancelled' badge
- **coral** `#E0654A` — The anti-noise: anti-noise wave, slider thumb, signal path in the earcup, incorrect answers
- **coral-wash** `#F7DDD4` — Coral tint behind incorrect quiz feedback
## Typography
- **Display serif: H1, H2, step headings, pull quote, captions (italic), masthead wordmark** — Newsreader (variable, with italic) (OFL), weights 400/500/600. Self-host the font files.
- **Text sans: body copy, dek fallback, buttons, quiz options** — IBM Plex Sans (OFL), weights 400/500/600. Self-host the font files.
- **Mono: kickers, figure numbers, callout numbers, readouts, axis labels** — IBM Plex Mono (OFL), weights 400/500. Self-host the font files.
## Spacing & shape
- Spacing: 8px base unit. Page max-width 1200px with 32px side gutters (20px under 720px). 12-column grid, 24px gap. Reading column max-width 640px (about 66ch). Section padding 160px top/bottom on desktop, 96px on mobile. Each scroll step min-height 80vh. Type scale: H1 clamp(3rem, 6.5vw, 6rem), line-height 0.98, letter-spacing -0.02em, Newsreader 500. H2 clamp(2.25rem, 4vw, 3.5rem), line-height 1.05, Newsreader 500. Step heading 1.5rem, Newsreader 600. Body 18px, line-height 1.65, IBM Plex Sans 400. Dek 1.5rem, Newsreader 400 italic. Caption 15px, Newsreader 400 italic, ink-muted. Kicker 12px, IBM Plex Mono 500, uppercase, letter-spacing 0.12em, teal. Readouts 28px IBM Plex Mono 500 with tabular-nums.
- Radius: Nearly square: 2px on figure panels, cards and buttons; 999px only on the slider thumb, callout number circles and the 'Cancelled' badge.
## Motion
- Canvas waves animate with requestAnimationFrame at a calm speed: one full cycle every 2.4s for the fundamental. They pause when off screen.
- Figure state changes between scroll steps interpolate wave parameters (amplitude, frequency, overlays) over 600ms with easeInOutCubic.
- Text steps: the inactive step sits at opacity 0.35 and the active one at 1. Transition 400ms ease.
- Paragraph and heading reveal on first entering the viewport: opacity 0→1 and translateY 12px→0, 600ms cubic-bezier(0.2,0.7,0.2,1), 80ms stagger. Runs once.
- Earcup parts draw in with stroke-dashoffset (700ms) and fill-opacity 0→1 (400ms, delayed 300ms). Callout circles scale 0.6→1 with 200ms ease-out. In the final step the signal path's dash pattern flows from outer mic to ear (stroke-dashoffset loop, 1.6s linear infinite).
- Phase-lab readouts tween numbers over 150ms. The 'Cancelled' badge fades and scales 0.9→1 in 200ms when |phase−180| ≤ 4.
- Frequency bars grow from height 0 when Figure 4 enters view: 800ms easeOutCubic, 60ms stagger per band.
- Reading progress hairline under the masthead fills with scroll position (transform: scaleX, no transition).
- prefers-reduced-motion: reduce. Waves render as a single static frame (t=0) and redraw only when inputs change. Step and state changes are instant. No reveal translate (opacity only, 0ms). The earcup signal path is a static dashed line. Bars appear at full height. The slider, drag and quiz all still work.
## Imagery
No photos and no bitmaps. All art is drawn in code: Canvas 2D line waves (2px strokes, round caps) on faint rule-colored grid lines, and inline SVG diagrams with 1.5px ink outlines. Cut faces use a 45° hatch pattern (ink at 25% opacity, 6px spacing) over paper-deep, and foam uses a dot pattern. Teal always means noise and coral always means anti-noise; ink is the result. Figures carry a mono figure number ('FIG. 2') and an italic caption under a hairline rule.
## Tone
Calm, precise, warm, like a good science-magazine feature. Short declarative sentences, no exclamation marks, no hype, no jargon left unexplained. Figure numbers, captions and quiet confidence.
---
— Prompt by VibeFather · https://vibefather.ai/t/interactive-science-explainer · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
改成你自己的
- 护耳品牌:把 DEVICE 设为工业耳罩,NOISE_SOURCE 设为机器嗡鸣,然后按自家产品部件重写耳罩标注。
- 物理老师:把 BRAND 设为学校院系,READER 设为学生,并重写测验题以匹配你关于波干涉的课程。
- 硬件创业公司:把 DEVICE 设为你的传感器或音频产品,保留相位实验室,把频率图标签换成你自己实测的频段。
- 科学博物馆:把 BRAND 设为展览名称,ISSUE_LABEL 设为展厅,并重写结尾步骤,邀请参观者在现场试试相位实验室。
交互式科学解说页:常见问题
如何把交互式科学解说页改成讲解其他设备,比如护耳器或麦克风?
把 DEVICE 变量设为新设备,把 NOISE_SOURCE 设为它抵消的稳定声音,然后重写四个章节的段落,让它们仍然遵循感知、计算、演示和检验的同一脉络。相位实验室、耳罩剖面图和频率图保持原有结构,测验保持四道题。所有文案都在一个内容文件里,不需要改其他地方。
怎么用 AI 做一个交互式科学解说页?
复制本页的完整提示词(Pro),或者运行 npx vibefather add interactive-science-explainer,把 [BRAND]、[DEVICE]、[READER]、[ISSUE_LABEL] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。