You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the section TODOs with full prose. Voice tracks zhui-guang's
rhythm — short sentences, dense images, technical content embedded
without becoming a code dump.
Each section's prose is shaped to coordinate with a future sketch
state on the left stage:
empty — sparse / single thread; setting up "what's missing".
strip — thread lays flat across the canvas; mirrors `breaks: 'none'`.
pipeline — three colored zones, the MEI → SVG → DOM transformation.
layers — multiple parallel threads, stacked.
lifecycle— fade-in / fade-out passes (mount on viewport, swap on nav).
ticking — two perpendicular pulses, slight phase offset (rAF vs
AudioContext).
recap — full weave, gentle breathing.
The sketch itself isn't here yet; the prose is the contract.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
第三步是运行时:rAF 每帧读一次音频钟,把 pan 平移到对应的 x 位置;音频调度器独立排音符;播放头始终钉在屏幕同一个像素上。
44
+
45
+
渲染发生一次,播放发生千次。
70
46
71
47
</section>
72
48
73
49
<sectiondata-cue="layers">
74
50
75
-
{/* TODO: pan / chrome / staff-lines / playhead / hint 各管各。 */}
51
+
舞台不是一块,是好几块叠在一起的。
52
+
53
+
最底是 staff lines 那一层——5 条横线,单独画,单一来源。中间是 pan,盛着 Verovio 出的整块 SVG,每一帧靠 translate3d 横向平移。pan 上面盖一层 frozen header,也就是"假装不动"的谱号区域;它确实不动——pan 在它下面滑过而它本身物理上在另一个 DOM 节点里,永远固定在最左边。最上面是播放头那根竖线,加上"click to play"的提示文字。
54
+
55
+
这样分层是有理由的。让 pan 的同一块 SVG 同时承担"流动的音符"和"固定的报头",每次跨过谱号变化时——克隆的报头要跟着 pan 平移、再用 transform 抵消平移、再交叉淡入淡出——又复杂又容易抖。物理分层之后,pan 滚 pan 的,header 替 header 的,每一层只对自己的事情负责。
56
+
57
+
谁先画、谁压在谁上、谁有 mask、谁有 backdrop-filter,都是 z-index + position 的常规活。但前提是它们必须先分层。
0 commit comments