
Huashu Design
- 33 installs
- 459 repo stars
- Updated July 31, 2026
- mxyhi/ok-skills
Helps with design & ui/ux tasks.
About
huashu-design is a Claude Code skill for design & ui/ux. It helps solo builders move faster with AI-assisted coding.
- huashu-design
- Design & UI/UX
- AI-coding skill
Huashu Design by the numbers
- 33 all-time installs (skills.sh)
- +5 installs in the week ending Jul 26, 2026 (Skillselion tracking)
- Ranked #1,309 of 1,880 Design & UI/UX skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mxyhi/ok-skills --skill huashu-designAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 33 |
|---|---|
| repo stars | ★ 459 |
| Last updated | July 31, 2026 |
| Repository | mxyhi/ok-skills ↗ |
What it does
Helps with design & ui/ux tasks.
Files
# 豆包语音 TTS(火山引擎 openspeech)
# 申请地址:https://console.volcengine.com/speech
DOUBAO_TTS_API_KEY=your_api_key_here
DOUBAO_TTS_VOICE_ID=your_clone_voice_id_here
DOUBAO_TTS_CLUSTER=volcano_icl
DOUBAO_TTS_ENDPOINT=https://openspeech.bytedance.com/api/v1/tts
# macOS
.DS_Store
**/.DS_Store
# Video render temp (render-video.js 产物)
.video-tmp-*/
**/.video-tmp-*/
# Personal asset index(个人真实数据,只保留 .example.json 模板)
assets/personal-asset-index.json
# 环境变量(API key 等敏感信息,只保留 .env.example 模板)
.env
.env.local
# Voiceover 工作目录(TTS mp3、timeline.json 临时产物,可重新生成)
**/_narration/
**/_narration_*/
# Node / editor / OS
node_modules/
*.swp
.idea/
.vscode/
Thumbs.db
# Verification artifacts(截图、临时测试脚本)
demos/_frames_*.png
demos/_verify.js
demos/_verify.mjs
# 开发/测试中间产物(skill 内部研发用,不分发给用户)
_style-research/
**/design-demos/
# Demo 大视频(用 GitHub Releases 分发,不进仓库膨胀)
demos/**/*.mp4
/**
* AndroidFrame — Android设备边框(参考Pixel 8系列)
*
* 含:punch-hole相机 + 状态栏 + 导航栏 + 圆角
*
* 用法:
* <AndroidFrame time="9:41" battery={85}>
* <YourAppContent />
* </AndroidFrame>
*/
const androidFrameStyles = {
wrapper: {
display: 'inline-block',
padding: 10,
background: '#1a1a1a',
borderRadius: 44,
boxShadow: '0 0 0 2px #2a2a2a, 0 20px 60px rgba(0,0,0,0.3)',
position: 'relative',
},
screen: {
position: 'relative',
borderRadius: 36,
overflow: 'hidden',
background: '#fff',
},
statusBar: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: 32,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '0 24px',
fontSize: 14,
fontWeight: 500,
fontFamily: 'Roboto, -apple-system, sans-serif',
zIndex: 20,
pointerEvents: 'none',
},
punchHole: {
position: 'absolute',
top: 10,
left: '50%',
transform: 'translateX(-50%)',
width: 14,
height: 14,
background: '#000',
borderRadius: '50%',
zIndex: 30,
},
statusIcons: {
display: 'flex',
alignItems: 'center',
gap: 6,
},
batteryText: {
fontSize: 11,
fontWeight: 600,
marginLeft: 2,
},
content: {
position: 'absolute',
top: 32,
left: 0,
right: 0,
bottom: 24,
overflow: 'auto',
},
navBar: {
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
height: 24,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 60,
zIndex: 10,
},
navButton: {
width: 36,
height: 4,
background: 'rgba(0,0,0,0.3)',
borderRadius: 999,
},
};
function AndroidFrame({
children,
width = 412,
height = 892,
time = '9:41',
battery = 100,
darkMode = false,
navStyle = 'gesture',
}) {
const textColor = darkMode ? '#fff' : '#1a1a1a';
return (
<div style={androidFrameStyles.wrapper}>
<div style={{
...androidFrameStyles.screen,
width,
height,
background: darkMode ? '#000' : '#fff',
}}>
<div style={{ ...androidFrameStyles.statusBar, color: textColor }}>
<span>{time}</span>
<div style={androidFrameStyles.statusIcons}>
<svg width="14" height="10" viewBox="0 0 14 10" fill="currentColor">
<rect x="0" y="6" width="2" height="4" rx="0.5" />
<rect x="4" y="4" width="2" height="6" rx="0.5" />
<rect x="8" y="2" width="2" height="8" rx="0.5" />
<rect x="12" y="0" width="2" height="10" rx="0.5" />
</svg>
<svg width="14" height="10" viewBox="0 0 14 10" fill="none">
<path d="M7 9a1 1 0 100-2 1 1 0 000 2z" fill="currentColor" />
<path d="M3 6a5 5 0 018 0" stroke="currentColor" strokeWidth="1.2" />
<path d="M0.5 3.5a11 11 0 0113 0" stroke="currentColor" strokeWidth="1.2" opacity="0.6" />
</svg>
<div style={{
width: 22,
height: 10,
border: '1.5px solid currentColor',
borderRadius: 2,
padding: 1,
position: 'relative',
}}>
<div style={{
width: `${battery}%`,
height: '100%',
background: 'currentColor',
borderRadius: 1,
}} />
</div>
<span style={androidFrameStyles.batteryText}>{battery}%</span>
</div>
</div>
<div style={androidFrameStyles.punchHole} />
<div style={androidFrameStyles.content}>
{children}
</div>
{navStyle === 'gesture' && (
<div style={androidFrameStyles.navBar}>
<div style={{
...androidFrameStyles.navButton,
width: 100,
height: 4,
background: darkMode ? 'rgba(255,255,255,0.5)' : 'rgba(0,0,0,0.4)',
}} />
</div>
)}
{navStyle === 'buttons' && (
<div style={androidFrameStyles.navBar}>
<span style={{ color: textColor, fontSize: 20 }}>◁</span>
<span style={{ color: textColor, fontSize: 16 }}>○</span>
<span style={{ color: textColor, fontSize: 16 }}>□</span>
</div>
)}
</div>
</div>
);
}
if (typeof window !== 'undefined') {
window.AndroidFrame = AndroidFrame;
}
/**
* animations.jsx — 时间轴动画引擎
*
* Stage + Sprite 模式,借鉴Remotion但轻量化。
*
* 导出(挂到 window.Animations):
* - Stage: 整个动画容器,提供时间+控制
* - Sprite: 时间片段,start/end内显示,提供本地进度
* - useTime(): 读全局时间(秒)
* - useSprite(): 读本地进度 {t: 0→1, elapsed: seconds, duration: seconds}
* - Easing: {linear, easeIn, easeOut, easeInOut, spring, anticipation}
* - interpolate(t, [input0, input1], [output0, output1], easing?)
*
* 用法:
* <Stage duration={10}>
* <Sprite start={0} end={3}>
* <Title />
* </Sprite>
* <Sprite start={2} end={5}>
* <Subtitle />
* </Sprite>
* </Stage>
*
* 在Sprite子组件里用 useSprite() 读当前片段进度。
*/
(function() {
const { createContext, useContext, useState, useEffect, useRef, useCallback } = React;
const TimeContext = createContext({ time: 0, duration: 10, playing: false });
const SpriteContext = createContext(null);
const Easing = {
linear: t => t,
easeIn: t => t * t,
easeOut: t => 1 - (1 - t) * (1 - t),
easeInOut: t => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2,
// expoOut: Anthropic-level 主 easing (cubic-bezier(0.16, 1, 0.3, 1))
// 迅速启动 + 缓慢刹车,给数字元素物理重量感
expoOut: t => t === 1 ? 1 : 1 - Math.pow(2, -10 * t),
// overshoot: 带弹性的 toggle/按钮弹出 (cubic-bezier(0.34, 1.56, 0.64, 1))
overshoot: t => {
const c1 = 1.70158, c3 = c1 + 1;
return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
},
spring: t => {
const c = (2 * Math.PI) / 3;
return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * c) + 1;
},
anticipation: t => {
if (t < 0.2) return -0.3 * (t / 0.2) * (t / 0.2);
const adjusted = (t - 0.2) / 0.8;
return -0.012 + 1.012 * adjusted * adjusted * (3 - 2 * adjusted);
},
};
function interpolate(t, input, output, easing) {
const [inStart, inEnd] = input;
const [outStart, outEnd] = output;
if (t <= inStart) return outStart;
if (t >= inEnd) return outEnd;
let progress = (t - inStart) / (inEnd - inStart);
if (easing) {
progress = easing(progress);
}
return outStart + (outEnd - outStart) * progress;
}
function useTime() {
const ctx = useContext(TimeContext);
return ctx.time;
}
function useSprite() {
const sprite = useContext(SpriteContext);
if (!sprite) {
return { t: 0, elapsed: 0, duration: 0 };
}
return sprite;
}
const stageStyles = {
wrapper: {
position: 'fixed',
inset: 0,
background: '#000',
display: 'flex',
flexDirection: 'column',
fontFamily: '-apple-system, sans-serif',
},
stageHolder: {
flex: 1,
position: 'relative',
overflow: 'hidden',
},
canvas: {
position: 'absolute',
top: '50%',
left: '50%',
transformOrigin: 'center center',
background: '#111',
overflow: 'hidden',
},
controls: {
position: 'fixed',
bottom: 0,
left: 0,
right: 0,
background: 'rgba(0, 0, 0, 0.8)',
backdropFilter: 'blur(10px)',
padding: '12px 20px',
display: 'flex',
alignItems: 'center',
gap: 16,
color: '#fff',
fontSize: 12,
zIndex: 100,
},
button: {
background: 'none',
border: '1px solid rgba(255,255,255,0.3)',
color: '#fff',
padding: '6px 14px',
borderRadius: 4,
cursor: 'pointer',
fontSize: 12,
},
timeDisplay: {
fontFamily: 'ui-monospace, monospace',
fontVariantNumeric: 'tabular-nums',
minWidth: 90,
},
scrubber: {
flex: 1,
height: 4,
background: 'rgba(255,255,255,0.2)',
borderRadius: 2,
position: 'relative',
cursor: 'pointer',
},
scrubberFill: {
position: 'absolute',
top: 0,
left: 0,
height: '100%',
background: '#fff',
borderRadius: 2,
pointerEvents: 'none',
},
scrubberHandle: {
position: 'absolute',
top: '50%',
width: 12,
height: 12,
background: '#fff',
borderRadius: '50%',
transform: 'translate(-50%, -50%)',
pointerEvents: 'none',
},
};
function Stage({ duration = 10, width = 1920, height = 1080, fps = 60, loop = true, children, bgColor = '#fff' }) {
const [time, setTime] = useState(0);
const [playing, setPlaying] = useState(true);
const [scale, setScale] = useState(1);
const rafRef = useRef(null);
const startTimeRef = useRef(performance.now());
const canvasRef = useRef(null);
// Recording mode: render-video.js injects window.__recording = true before goto.
// When set, force loop=false so the export ends on the final frame instead of
// wrapping back to t=0 and capturing the start of the next cycle.
// (Browsers viewing manually still loop because __recording is undefined there.)
const effectiveLoop = (typeof window !== 'undefined' && window.__recording) ? false : loop;
useEffect(() => {
function updateScale() {
const vw = window.innerWidth;
const vh = window.innerHeight - 56;
const s = Math.min(vw / width, vh / height);
setScale(s);
}
updateScale();
window.addEventListener('resize', updateScale);
return () => window.removeEventListener('resize', updateScale);
}, [width, height]);
useEffect(() => {
// Seek-render mode (render-video-seek.js sets window.__seekRender): freeze the
// self-driven clock and let the external renderer advance each frame via
// window.__seek(t). No rAF self-drive here — every frame is a deterministic seek.
if (typeof window !== 'undefined' && window.__seekRender) {
window.__ready = true;
window.__seek = (t) => setTime(Math.min(t, duration - 0.001));
return;
}
if (!playing) return;
let cancelled = false;
let last = null;
function tick(now) {
if (cancelled) return;
if (last === null) {
// First animation frame. Set last=now so delta starts at 0,
// AND announce readiness for video export.
// This pairing is critical: window.__ready must flip to true at
// the exact moment WebM captures frame 0 of the animation, so
// render-video.js's trim offset equals the pre-animation gap.
last = now;
if (typeof window !== 'undefined') window.__ready = true;
}
const delta = (now - last) / 1000;
last = now;
setTime(prev => {
const next = prev + delta;
if (next >= duration) {
// effectiveLoop honors window.__recording (forced non-loop during export).
// Stop just shy of duration so the final-frame state stays rendered
// (avoids exiting all Sprites that end exactly at `duration`).
return effectiveLoop ? 0 : duration - 0.001;
}
return next;
});
rafRef.current = requestAnimationFrame(tick);
}
// Wait for fonts before starting the clock — makes frame 0 the
// real "finished-loading" frame users see, not a fallback-font flash.
const startAfterFonts = () => {
if (cancelled) return;
rafRef.current = requestAnimationFrame(tick);
};
if (typeof document !== 'undefined' && document.fonts && document.fonts.ready) {
document.fonts.ready.then(startAfterFonts);
} else {
startAfterFonts();
}
return () => {
cancelled = true;
cancelAnimationFrame(rafRef.current);
};
}, [playing, duration, effectiveLoop]);
const handleScrub = useCallback((e) => {
const rect = e.currentTarget.getBoundingClientRect();
const ratio = (e.clientX - rect.left) / rect.width;
setTime(Math.max(0, Math.min(duration, ratio * duration)));
}, [duration]);
const handleSeek = useCallback((e) => {
handleScrub(e);
setPlaying(false);
}, [handleScrub]);
const progress = time / duration;
const ctx = {
time,
duration,
playing,
setPlaying,
setTime,
};
const canvasStyle = {
...stageStyles.canvas,
width,
height,
background: bgColor,
transform: `translate(-50%, -50%) scale(${scale})`,
};
return (
<TimeContext.Provider value={ctx}>
<div style={stageStyles.wrapper}>
<div style={stageStyles.stageHolder}>
<div ref={canvasRef} style={canvasStyle}>
{children}
</div>
</div>
<div style={stageStyles.controls}>
<button
style={stageStyles.button}
onClick={() => setPlaying(p => !p)}
>
{playing ? '⏸ 暂停' : '▶ 播放'}
</button>
<button
style={stageStyles.button}
onClick={() => setTime(0)}
>
⏮ 开始
</button>
<div style={stageStyles.timeDisplay}>
{time.toFixed(2)}s / {duration.toFixed(2)}s
</div>
<div style={stageStyles.scrubber} onMouseDown={handleSeek}>
<div style={{ ...stageStyles.scrubberFill, width: `${progress * 100}%` }} />
<div style={{ ...stageStyles.scrubberHandle, left: `${progress * 100}%` }} />
</div>
</div>
</div>
</TimeContext.Provider>
);
}
function Sprite({ start = 0, end, children, style }) {
const { time } = useContext(TimeContext);
const actualEnd = end == null ? Infinity : end;
if (time < start || time >= actualEnd) {
return null;
}
const duration = actualEnd - start;
const elapsed = time - start;
const t = duration === 0 ? 1 : Math.max(0, Math.min(1, elapsed / duration));
const spriteValue = { t, elapsed, duration, start, end: actualEnd };
return (
<SpriteContext.Provider value={spriteValue}>
<div style={{ position: 'absolute', inset: 0, ...style }}>
{children}
</div>
</SpriteContext.Provider>
);
}
if (typeof window !== 'undefined') {
window.Animations = {
Stage,
Sprite,
useTime,
useSprite,
Easing,
interpolate,
};
}
})();
<svg width="1200" height="400" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=Noto+Serif+SC:wght@700;900&display=swap');
</style>
<!-- Warm accent gradients for mini mockup highlights -->
<linearGradient id="hdBarGrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#D4532B"/>
<stop offset="100%" stop-color="#A83518"/>
</linearGradient>
<linearGradient id="hdBarGradSoft" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#8B5E3C"/>
<stop offset="100%" stop-color="#6E4A2E"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="1200" height="400" fill="#111111"/>
<!-- Left accent line (Pentagram-style editorial vertical rule) -->
<rect x="60" y="48" width="3" height="304" fill="#D4532B"/>
<!-- Top horizontal rule -->
<rect x="60" y="48" width="760" height="2" fill="#FFFFFF" opacity="0.15"/>
<!-- Bottom horizontal rule -->
<rect x="60" y="350" width="760" height="1" fill="#FFFFFF" opacity="0.15"/>
<!-- Thin divider between text and viz -->
<rect x="860" y="80" width="1" height="240" fill="#FFFFFF" opacity="0.08"/>
<!-- ============================================================ -->
<!-- LEFT: TEXT BLOCK -->
<!-- ============================================================ -->
<!-- CATEGORY LABEL -->
<text
x="80"
y="88"
font-family="'Inter', system-ui, -apple-system, sans-serif"
font-size="11"
font-weight="700"
letter-spacing="3"
fill="#D4532B"
>CLAUDE CODE SKILL · DESIGN</text>
<!-- MAIN TITLE -->
<text
x="80"
y="178"
font-family="'Inter', system-ui, -apple-system, sans-serif"
font-size="88"
font-weight="900"
fill="#FFFFFF"
letter-spacing="-3"
>Huashu Design</text>
<!-- Chinese subtitle -->
<text
x="80"
y="222"
font-family="'Noto Serif SC', 'Source Han Serif', 'Inter', serif"
font-size="22"
font-weight="700"
fill="#EEEEEE"
letter-spacing="1"
>用 HTML 做设计的 skill</text>
<!-- Tagline -->
<text
x="80"
y="284"
font-family="'Inter', system-ui, -apple-system, sans-serif"
font-size="15"
font-weight="500"
fill="#BBBBBB"
letter-spacing="0.5"
>高保真原型</text>
<text x="176" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="700" fill="#D4532B">·</text>
<text x="188" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="500" fill="#BBBBBB" letter-spacing="0.5">幻灯片</text>
<text x="260" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="700" fill="#D4532B">·</text>
<text x="272" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="500" fill="#BBBBBB" letter-spacing="0.5">动画</text>
<text x="320" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="700" fill="#D4532B">·</text>
<text x="332" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="500" fill="#BBBBBB" letter-spacing="0.5">信息图</text>
<text x="404" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="700" fill="#D4532B">·</text>
<text x="416" y="284" font-family="'Inter', sans-serif" font-size="15" font-weight="500" fill="#BBBBBB" letter-spacing="0.5">App 原型</text>
<!-- Second tagline row -->
<text
x="80"
y="312"
font-family="'Inter', system-ui, -apple-system, sans-serif"
font-size="14"
font-weight="400"
fill="#888888"
letter-spacing="0.3"
>20 种设计哲学 · 5 维专家评审 · 发布会级动画导出</text>
<!-- Footer credit -->
<text
x="80"
y="370"
font-family="'Inter', system-ui, -apple-system, sans-serif"
font-size="12"
font-weight="400"
fill="#666666"
letter-spacing="0.3"
>for Claude Code & Agent-agnostic</text>
<!-- ============================================================ -->
<!-- RIGHT: MINI MOCKUP GRID (2×2) -->
<!-- Each mock represents one output form of huashu-design -->
<!-- Viewport right area: x 880-1160, y 90-330 -->
<!-- 2×2 grid, tile ≈ 128×104, gap 16 -->
<!-- ============================================================ -->
<!-- Section label -->
<text x="890" y="108" font-family="'Inter', sans-serif" font-size="10" font-weight="700" letter-spacing="2" fill="#D4532B" opacity="0.9">OUTPUT SURFACES</text>
<!-- Grid coordinates:
Col1 x=890 (width 128) Col2 x=1034 (width 128)
Row1 y=122 (height 100) Row2 y=238 (height 100) -->
<!-- ============ TILE 1 · SLIDES (top-left) ============ -->
<rect x="890" y="122" width="128" height="100" rx="2" fill="#1A1A1A" stroke="#333333" stroke-width="1"/>
<!-- slide stack visual: 3 stacked rectangles offset to imply deck -->
<rect x="902" y="138" width="88" height="56" fill="#2A2A2A" stroke="#3A3A3A" stroke-width="0.5"/>
<rect x="906" y="142" width="88" height="56" fill="#353535"/>
<rect x="910" y="146" width="88" height="56" fill="#E8E2D4"/>
<!-- slide headline stripes -->
<rect x="916" y="152" width="48" height="3" fill="#111111"/>
<rect x="916" y="160" width="72" height="1.5" fill="#666666"/>
<rect x="916" y="166" width="60" height="1.5" fill="#666666"/>
<rect x="916" y="176" width="32" height="14" fill="#D4532B"/>
<!-- tile label -->
<text x="902" y="216" font-family="'Inter', sans-serif" font-size="9" font-weight="500" letter-spacing="2" fill="#777777">SLIDES</text>
<!-- ============ TILE 2 · PROTOTYPE iPhone (top-right) ============ -->
<rect x="1034" y="122" width="128" height="100" rx="2" fill="#1A1A1A" stroke="#333333" stroke-width="1"/>
<!-- iPhone outline inside tile -->
<rect x="1080" y="130" width="36" height="76" rx="6" fill="#0A0A0A" stroke="#444444" stroke-width="1"/>
<!-- Dynamic island -->
<rect x="1092" y="134" width="12" height="3" rx="1.5" fill="#000000"/>
<!-- Screen content area -->
<rect x="1083" y="140" width="30" height="58" fill="#EEEAE0"/>
<!-- Tiny app UI elements -->
<rect x="1086" y="144" width="24" height="4" fill="#111111"/>
<rect x="1086" y="152" width="16" height="1.5" fill="#888888"/>
<rect x="1086" y="157" width="20" height="1.5" fill="#888888"/>
<rect x="1086" y="164" width="24" height="12" fill="#D4532B"/>
<rect x="1086" y="180" width="11" height="14" fill="#D1CAB8"/>
<rect x="1099" y="180" width="11" height="14" fill="#D1CAB8"/>
<!-- Home indicator -->
<rect x="1092" y="201" width="12" height="1" rx="0.5" fill="#444444"/>
<!-- tile label -->
<text x="1046" y="216" font-family="'Inter', sans-serif" font-size="9" font-weight="500" letter-spacing="2" fill="#777777">PROTOTYPE</text>
<!-- ============ TILE 3 · ANIMATION storyboard (bottom-left) ============ -->
<rect x="890" y="238" width="128" height="100" rx="2" fill="#1A1A1A" stroke="#333333" stroke-width="1"/>
<!-- 3 storyboard frames in a row -->
<rect x="898" y="252" width="34" height="44" fill="#252525" stroke="#3A3A3A" stroke-width="0.5"/>
<rect x="939" y="252" width="34" height="44" fill="#2E2E2E" stroke="#3A3A3A" stroke-width="0.5"/>
<rect x="980" y="252" width="34" height="44" fill="#353535" stroke="#3A3A3A" stroke-width="0.5"/>
<!-- motion dots -->
<circle cx="910" cy="274" r="6" fill="#666666"/>
<circle cx="956" cy="274" r="6" fill="#9C6A46"/>
<circle cx="997" cy="274" r="6" fill="#D4532B"/>
<!-- motion arc dashes -->
<path d="M 910 274 Q 933 258 956 274" stroke="#D4532B" stroke-width="0.8" fill="none" stroke-dasharray="2 2" opacity="0.6"/>
<path d="M 956 274 Q 977 258 997 274" stroke="#D4532B" stroke-width="0.8" fill="none" stroke-dasharray="2 2" opacity="0.6"/>
<!-- timeline ruler -->
<rect x="898" y="306" width="116" height="1" fill="#555555"/>
<rect x="898" y="306" width="2" height="4" fill="#D4532B"/>
<rect x="938" y="306" width="2" height="4" fill="#555555"/>
<rect x="978" y="306" width="2" height="4" fill="#555555"/>
<rect x="1012" y="306" width="2" height="4" fill="#555555"/>
<!-- tile label -->
<text x="902" y="332" font-family="'Inter', sans-serif" font-size="9" font-weight="500" letter-spacing="2" fill="#777777">ANIMATION</text>
<!-- ============ TILE 4 · INFOGRAPHIC bars (bottom-right) ============ -->
<rect x="1034" y="238" width="128" height="100" rx="2" fill="#1A1A1A" stroke="#333333" stroke-width="1"/>
<!-- bars chart -->
<rect x="1046" y="290" width="12" height="20" fill="url(#hdBarGradSoft)"/>
<rect x="1062" y="278" width="12" height="32" fill="url(#hdBarGradSoft)"/>
<rect x="1078" y="270" width="12" height="40" fill="url(#hdBarGradSoft)"/>
<rect x="1094" y="262" width="12" height="48" fill="url(#hdBarGrad)"/>
<rect x="1110" y="254" width="12" height="56" fill="url(#hdBarGrad)"/>
<rect x="1126" y="248" width="12" height="62" fill="url(#hdBarGrad)"/>
<!-- baseline -->
<rect x="1044" y="310" width="104" height="1" fill="#555555"/>
<!-- headline at top of tile -->
<rect x="1046" y="252" width="50" height="3" fill="#FFFFFF" opacity="0.85"/>
<rect x="1046" y="260" width="34" height="1.5" fill="#666666"/>
<!-- tile label -->
<text x="1046" y="332" font-family="'Inter', sans-serif" font-size="9" font-weight="500" letter-spacing="2" fill="#777777">INFOGRAPHIC</text>
</svg>
/**
* BrowserWindow — 浏览器窗口边框(Chrome风格)
*
* 含:traffic lights + tab bar + URL bar
*
* 用法:
* <BrowserWindow url="https://example.com" title="Example">
* <YourWebPage />
* </BrowserWindow>
*/
const browserWindowStyles = {
window: {
display: 'inline-block',
background: '#fff',
borderRadius: 10,
overflow: 'hidden',
boxShadow: '0 30px 80px rgba(0,0,0,0.25), 0 0 0 0.5px rgba(0,0,0,0.15)',
},
chrome: {
background: '#dee1e6',
paddingTop: 10,
paddingLeft: 10,
paddingRight: 10,
userSelect: 'none',
},
tabRow: {
display: 'flex',
alignItems: 'flex-end',
gap: 6,
position: 'relative',
},
trafficLights: {
display: 'flex',
gap: 8,
alignItems: 'center',
paddingBottom: 10,
marginRight: 8,
},
light: {
width: 12,
height: 12,
borderRadius: '50%',
border: '0.5px solid rgba(0,0,0,0.15)',
},
close: { background: '#ff5f57' },
minimize: { background: '#febc2e' },
maximize: { background: '#28c840' },
tab: {
background: '#fff',
padding: '8px 30px 8px 14px',
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
fontSize: 12,
color: '#222',
fontFamily: '-apple-system, sans-serif',
maxWidth: 220,
display: 'flex',
alignItems: 'center',
gap: 8,
position: 'relative',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
favicon: {
width: 14,
height: 14,
borderRadius: 2,
background: '#999',
flexShrink: 0,
},
navBar: {
background: '#fff',
padding: '8px 14px',
display: 'flex',
alignItems: 'center',
gap: 10,
borderBottom: '1px solid #e5e7eb',
},
navButtons: {
display: 'flex',
gap: 4,
color: '#5f6368',
fontSize: 16,
},
navButton: {
width: 28,
height: 28,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
borderRadius: '50%',
cursor: 'pointer',
},
urlBar: {
flex: 1,
background: '#f1f3f4',
borderRadius: 999,
padding: '7px 14px',
fontSize: 13,
color: '#333',
display: 'flex',
alignItems: 'center',
gap: 8,
fontFamily: '-apple-system, sans-serif',
},
lockIcon: {
color: '#5f6368',
fontSize: 12,
},
content: {
position: 'relative',
overflow: 'auto',
background: '#fff',
},
};
function BrowserWindow({
title = 'New Tab',
url = 'https://example.com',
width = 1200,
height = 800,
showTrafficLights = true,
children,
}) {
return (
<div style={browserWindowStyles.window}>
<div style={browserWindowStyles.chrome}>
<div style={browserWindowStyles.tabRow}>
{showTrafficLights && (
<div style={browserWindowStyles.trafficLights}>
<div style={{ ...browserWindowStyles.light, ...browserWindowStyles.close }} />
<div style={{ ...browserWindowStyles.light, ...browserWindowStyles.minimize }} />
<div style={{ ...browserWindowStyles.light, ...browserWindowStyles.maximize }} />
</div>
)}
<div style={browserWindowStyles.tab}>
<div style={browserWindowStyles.favicon} />
<span>{title}</span>
</div>
</div>
</div>
<div style={browserWindowStyles.navBar}>
<div style={browserWindowStyles.navButtons}>
<div style={browserWindowStyles.navButton}>←</div>
<div style={browserWindowStyles.navButton}>→</div>
<div style={browserWindowStyles.navButton}>↻</div>
</div>
<div style={browserWindowStyles.urlBar}>
<span style={browserWindowStyles.lockIcon}>🔒</span>
<span>{url}</span>
</div>
</div>
<div style={{ ...browserWindowStyles.content, width, height }}>
{children}
</div>
</div>
);
}
if (typeof window !== 'undefined') {
window.BrowserWindow = BrowserWindow;
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Deck · Multi-file Slide Index</title>
<!--
deck_index.html — 多文件 slide deck 拼接器 · 双概览模式
概览(默认进入,两种模式按 getSeconds()%5 随机:20% 画廊 / 80% 网格):
· grid 自适应网格墙:列数随页数+视口自适应,行多则倾斜变平,scale-to-fit 居中铺满(任意页数都不溢出/不失真)
· gallery 无限画廊:固定卡片大小,无缝无限平铺 + 缓慢漂移 + 轻微呼吸;一个 tile 含全部页(洗牌),看完所有页才重复
演示 present:单页 fit 缩放翻页。ESC / ⊞ 回概览。
性能:manifest 每项可带 thumb(预渲染缩略图),概览即用 <img> 平铺,避免 N 个 iframe 同时加载。
用法:复制为 index.html;建 slides/ 放每页独立 HTML;编辑 MANIFEST。
可选覆盖:window.DECK_OVERVIEW = 'grid' | 'gallery'(不写则随机);URL ?ov=grid|gallery 临时强制。
键盘(演示):← / → / Space / PgUp / PgDown / Home / End / 1-9 / P 打印 / ESC 回概览
-->
<script>
window.DECK_MANIFEST = [
{ file: "slides/01-cover.html", label: "Cover" /*, thumb: "thumbs/01.jpg" */ },
];
window.DECK_WIDTH = 1920;
window.DECK_HEIGHT = 1080;
window.GALLERY_CARD_W = 300; // 画廊卡片基准宽度
window.GALLERY_DRIFT_SECONDS = 80; // 画廊漂移一圈时长
// window.DECK_OVERVIEW = 'grid'; // 取消注释可固定概览模式
</script>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: -apple-system, "PingFang SC", sans-serif; background: #0a0a0a; }
.overview { position: fixed; inset: 0; }
body[data-mode="present"] .overview { display: none; }
body[data-mode="present"] .start-btn { display: none; }
body[data-mode="overview"] #present-ui { display: none; }
body[data-ov="grid"] #ov-gallery { display: none; }
body[data-ov="gallery"] #ov-grid { display: none; }
body[data-ov="gallery"][data-mode="overview"] { background: #0a0805; }
body[data-ov="grid"][data-mode="overview"] { background: #efece4; }
/* ════════ 模式 1 · 自适应网格墙(一屏装得下→居中轻斜;装不下→舒适大小竖向滚动)════════ */
#ov-grid { display: flex; justify-content: center; perspective: 2200px; perspective-origin: 50% 42%;
background: radial-gradient(120% 90% at 50% 0%, #f4f1e9, #e7e3d8 75%); }
body[data-grid="fit"] #ov-grid { overflow: hidden; align-items: center; }
body[data-grid="scroll"] #ov-grid { overflow-y: auto; overflow-x: hidden; align-items: flex-start; padding: 74px 0 110px; }
.wall-wrap { }
body[data-grid="fit"] .wall-wrap { transform: translateY(-3vh); }
.wall { display: grid; gap: 20px; transform-origin: center center; margin: 0 auto; } /* 不用 preserve-3d:整墙作单个倾斜平面,命中测试可靠 */
#ov-grid .card {
position: relative; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; background: #fff; cursor: pointer;
box-shadow: 0 16px 34px rgba(40,34,24,0.20), 0 3px 10px rgba(40,34,24,0.12);
transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s;
}
#ov-grid .card:hover {
transform: scale(1.18);
box-shadow: 0 48px 92px rgba(40,34,24,0.36), 0 14px 30px rgba(40,34,24,0.22); z-index: 20;
}
/* ════════ 模式 2 · 无限画廊 ════════ */
#ov-gallery { overflow: hidden; perspective: 2200px; perspective-origin: 50% 42%;
background: radial-gradient(130% 120% at 50% 38%, #1b1610, #0a0805 82%); }
.stage3d { --rx: 18; --rz: 9; position: absolute; inset: 0; transform-style: preserve-3d; transform: scale(1.22) rotateX(18deg) rotateZ(-9deg); transform-origin: center center; }
.breathe { position: absolute; inset: 0; animation: breathe 26s ease-in-out infinite; transform-origin: center center; transform-style: preserve-3d; }
.drift-layer { position: absolute; top: 0; left: 0; will-change: transform; animation: drift var(--driftSec, 80s) linear infinite; transform-style: preserve-3d; }
#ov-gallery:hover .drift-layer { animation-play-state: paused; }
.gallery { display: grid; }
#ov-gallery .card {
position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer;
box-shadow: 0 14px 30px rgba(0,0,0,0.42), 0 3px 9px rgba(0,0,0,0.3);
transition: transform .34s cubic-bezier(.2,.7,.2,1), box-shadow .34s; transform-style: preserve-3d; will-change: transform;
}
#ov-gallery .card:hover {
transform: translateZ(60px) rotateX(calc(var(--rx,18)*-1deg)) rotateZ(calc(var(--rz,9)*1deg)) scale(1.06);
box-shadow: 0 30px 64px rgba(0,0,0,0.55), 0 8px 20px rgba(0,0,0,0.4); z-index: 30;
}
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 20; box-shadow: inset 0 0 240px 70px rgba(8,6,3,0.62); }
@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(calc(var(--dx)*-1), calc(var(--dy)*-1), 0); } }
@keyframes breathe { 0%,100% { transform: scale(1.0); } 50% { transform: scale(1.045); } }
/* 卡片通用内容 */
.card .thumb { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: top left; pointer-events: none; }
.card .thumb iframe { width: 1920px; height: 1080px; border: 0; display: block; background: #fff; pointer-events: none; }
.card .thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card .num { position: absolute; bottom: 6px; left: 7px; background: rgba(16,12,7,0.76); color: #fff; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 5px; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; z-index: 3; pointer-events: none; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ov-gallery .card .num { opacity: 0; transition: opacity .25s; }
#ov-gallery .card:hover .num { opacity: 1; }
.overview-title { position: fixed; top: 24px; left: 0; right: 0; text-align: center; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; z-index: 40; pointer-events: none; }
body[data-ov="grid"] .overview-title { color: #5a5346; opacity: 0.66; }
body[data-ov="gallery"] .overview-title { color: rgba(244,238,224,0.7); text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.start-btn { position: fixed; bottom: 26px; right: 26px; border: 0; padding: 13px 24px; border-radius: 999px; font-size: 15px; font-family: inherit; letter-spacing: 0.04em; cursor: pointer; z-index: 200; transition: transform .18s, box-shadow .18s; }
body[data-ov="grid"] .start-btn { background: #1a1712; color: #fff; box-shadow: 0 8px 28px rgba(40,34,24,0.28); }
body[data-ov="gallery"] .start-btn { background: #f4eee0; color: #1a1712; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.start-btn:hover { transform: translateY(-2px); }
/* ════════ 演示模式 ════════ */
#stage { position: fixed; top: 50%; left: 50%; transform-origin: top left; will-change: transform; background: #fff; box-shadow: 0 10px 60px rgba(0,0,0,0.4); }
#stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.counter { position: fixed; bottom: 20px; right: 20px; background: rgba(0,0,0,0.65); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; z-index: 100; opacity: 0.7; }
.counter .label { color: rgba(255,255,255,0.7); margin-left: 8px; }
.overview-btn { position: fixed; top: 20px; left: 20px; background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.85); border: 0; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-family: inherit; cursor: pointer; z-index: 100; opacity: 0.6; }
.overview-btn:hover { opacity: 1; }
.nav-zone { position: fixed; top: 0; bottom: 0; width: 15%; cursor: pointer; z-index: 50; }
.nav-zone.left { left: 0; } .nav-zone.right { right: 0; }
.nav-hint { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); display: flex; align-items: center; justify-content: center; font-size: 22px; opacity: 0; transition: opacity .2s; }
.nav-zone.left .nav-hint { left: 20px; } .nav-zone.right .nav-hint { right: 20px; }
.nav-zone:hover .nav-hint { opacity: 1; }
@media print {
@page { size: 1920px 1080px; margin: 0; }
html, body { background: #fff; overflow: visible; height: auto; }
body[data-mode] .overview { display: none !important; }
#stage { position: static; transform: none !important; box-shadow: none; }
.counter, .nav-zone, .overview-btn, .start-btn { display: none !important; }
.print-stack { display: block; }
.print-stack iframe { width: 1920px; height: 1080px; page-break-after: always; display: block; }
}
</style>
</head>
<body data-mode="overview">
<div id="ov-grid" class="overview">
<div class="overview-title">Overview · 点击任意页进入演示</div>
<div class="wall-wrap"><div class="wall" id="wall"></div></div>
</div>
<div id="ov-gallery" class="overview">
<div class="stage3d"><div class="breathe"><div class="drift-layer" id="driftLayer"><div class="gallery" id="gallery"></div></div></div></div>
<div class="vignette"></div>
<div class="overview-title">Infinite Gallery · 悬停暂停 · 点击任意页进入演示</div>
</div>
<button class="start-btn" id="startBtn">▶ 开始演示</button>
<div id="present-ui">
<div id="stage"><iframe id="frame" src="about:blank"></iframe></div>
<button class="overview-btn" id="overviewBtn">⊞ 概览</button>
<div class="nav-zone left" id="navL"><div class="nav-hint">‹</div></div>
<div class="nav-zone right" id="navR"><div class="nav-hint">›</div></div>
<div class="counter" id="counter">1 / 1</div>
</div>
<div class="print-stack" id="printStack" style="display:none;"></div>
<script>
(function () {
const W = window.DECK_WIDTH || 1920;
const H = window.DECK_HEIGHT || 1080;
const deck = window.DECK_MANIFEST || [];
const CARD_W = window.GALLERY_CARD_W || 300;
const DRIFT_SEC = window.GALLERY_DRIFT_SECONDS || 80;
const stage = document.getElementById('stage');
const frame = document.getElementById('frame');
const counter = document.getElementById('counter');
const printStack = document.getElementById('printStack');
const wall = document.getElementById('wall');
const gallery = document.getElementById('gallery');
const driftLayer = document.getElementById('driftLayer');
const storageKey = 'deck-index-' + location.pathname;
let current = 0;
stage.style.width = W + 'px'; stage.style.height = H + 'px';
driftLayer.style.setProperty('--driftSec', DRIFT_SEC + 's');
// 概览模式:URL ?ov= > window.DECK_OVERVIEW > 随机(秒%5==0 → 20% 画廊)
const qp = new URLSearchParams(location.search).get('ov');
// 用户未指定时按秒数随机:网格(iframe 真页面) 60% / 无限画廊(图片缩略图) 40%。可用 ?ov=grid|gallery 或 window.DECK_OVERVIEW 固定。
const OVERVIEW = qp || window.DECK_OVERVIEW || ((new Date().getSeconds() % 5 < 2) ? 'gallery' : 'grid');
document.body.setAttribute('data-ov', OVERVIEW === 'gallery' ? 'gallery' : 'grid');
function setMode(mode) {
document.body.setAttribute('data-mode', mode);
if (mode === 'present') { fit(); show(current); }
else { requestAnimationFrame(buildOverview); }
}
/* ─ 媒体(缩略图优先,否则 iframe) ─ */
function makeCard(idx, useScale, useImg) {
const card = document.createElement('div');
card.className = 'card'; card.dataset.idx = idx;
const item = deck[idx];
if (useImg && item.thumb) {
// 仅画廊用:预渲染缩略图,扛无限平铺的性能
const im = document.createElement('img');
im.className = 'thumb-img'; im.src = item.thumb; im.decoding = 'async';
card.appendChild(im);
} else {
// 网格默认用:真实 HTML 子页面(清晰、所见即所得)
const thumb = document.createElement('div');
thumb.className = 'thumb';
if (useScale != null) thumb.style.transform = 'scale(' + useScale + ')';
const ifr = document.createElement('iframe');
ifr.src = item.file; ifr.setAttribute('scrolling', 'no');
thumb.appendChild(ifr); card.appendChild(thumb);
}
const num = document.createElement('div');
num.className = 'num';
num.textContent = (idx + 1) + (item.label ? ' · ' + item.label : '');
card.appendChild(num);
card.addEventListener('click', () => { current = idx; setMode('present'); });
return card;
}
function buildOverview() {
if (document.body.getAttribute('data-mode') !== 'overview') return;
if (OVERVIEW === 'gallery') buildGallery(); else buildGrid();
}
/* ════════ 网格墙(自适应) ════════ */
function buildGrid() {
const n = deck.length; if (!n) return;
wall.innerHTML = '';
for (let i = 0; i < n; i++) wall.appendChild(makeCard(i, null, false)); // 网格 = iframe 真页面
layoutWall();
}
const GRID_PAD = 74; // #ov-grid scroll 顶部 padding,算动态 transform-origin 用
function layoutWall() {
const n = deck.length; if (!n) return;
const vw = innerWidth, vh = innerHeight, gap = 26;
const availW = vw * 0.86; // 留 rotateZ 横向余量(强对角也不裁切)
const target = 280;
let cols = Math.max(3, Math.min(9, Math.floor((availW + gap) / (target + gap))));
cols = Math.min(cols, n);
const rows = Math.ceil(n / cols);
const cardW = Math.min(target + 40, (availW - (cols - 1) * gap) / cols);
const cardH = cardW * 9 / 16;
const baseW = cols * cardW + (cols - 1) * gap;
const wallH = rows * cardH + (rows - 1) * gap;
wall.style.gridTemplateColumns = 'repeat(' + cols + ', 1fr)';
wall.style.gap = gap + 'px';
wall.style.width = baseW + 'px';
// 单平面(无 preserve-3d)→任意角度都不重叠、可点;fit 与 scroll 都给强对角倾斜
if (wallH <= vh * 0.80) {
document.body.setAttribute('data-grid', 'fit');
const rx = Math.max(11, Math.min(15, 15 - (rows - 2) * 1.1));
const rz = Math.max(8, Math.min(11, 11 - (rows - 2) * 0.7));
wall.style.setProperty('--rx', rx); wall.style.setProperty('--rz', rz);
wall.style.transformOrigin = 'center center';
const tilt = 'rotateX(' + rx + 'deg) rotateZ(-' + rz + 'deg)';
wall.style.transform = tilt;
const r = wall.getBoundingClientRect();
let s = Math.min(vw * 0.92 / r.width, vh * 0.80 / r.height);
s = Math.max(0.6, Math.min(s, 1.6));
wall.style.transform = 'scale(' + s + ') ' + tilt;
} else {
// 多页:舒适大小竖向滚动 + 强对角倾斜;transform-origin 跟随滚动→消除高墙 rotateZ 把远端行甩出屏幕
document.body.setAttribute('data-grid', 'scroll');
wall.style.setProperty('--rx', 14); wall.style.setProperty('--rz', 7);
wall.style.transform = 'rotateX(14deg) rotateZ(-7deg)';
updateScrollOrigin();
}
wall.querySelectorAll('.card .thumb').forEach(t => { const c = t.parentElement; if (c.clientWidth) t.style.transform = 'scale(' + (c.clientWidth / W) + ')'; });
}
function updateScrollOrigin() {
if (document.body.getAttribute('data-grid') !== 'scroll') return;
const ovg = document.getElementById('ov-grid');
wall.style.transformOrigin = '50% ' + (ovg.scrollTop + window.innerHeight / 2 - GRID_PAD) + 'px';
}
/* ════════ 无限画廊(洗牌不重复) ════════ */
function mulberry32(a) { return function () { a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
function shuffledRange(n, seed) { const rnd = mulberry32(seed); const a = Array.from({ length: n }, (_, i) => i); for (let i = n - 1; i > 0; i--) { const j = Math.floor(rnd() * (i + 1)); const tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a; }
function buildGallery() {
const n = deck.length; if (!n) return;
const vw = innerWidth, vh = innerHeight, gap = 18;
const cardW = CARD_W, cardH = cardW * 9 / 16;
const cellW = cardW + gap, cellH = cardH + gap;
const visCols = Math.ceil(vw / cellW), visRows = Math.ceil(vh / cellH);
// tile:宽够铺满;行数取「够铺满」与「装下全部 N 页」的较大者 → 看完所有页才重复
const tileCols = visCols + 1;
const tileRows = Math.max(visRows + 1, Math.ceil(n / tileCols));
const tileCells = tileCols * tileRows;
const perm = shuffledRange(n, 0x9e3779b9); // 洗牌一次,打散规则感
const tilePage = new Array(tileCells);
for (let k = 0; k < tileCells; k++) tilePage[k] = perm[k % n];
const cols = tileCols * 2, rows = tileRows * 2; // 2× tile 保证无缝漂移
driftLayer.style.setProperty('--dx', (tileCols * cellW) + 'px');
driftLayer.style.setProperty('--dy', (tileRows * cellH) + 'px');
gallery.style.gridTemplateColumns = 'repeat(' + cols + ', ' + cardW + 'px)';
gallery.style.gridAutoRows = cardH + 'px';
gallery.style.gap = gap + 'px';
gallery.innerHTML = '';
const scale = cardW / W;
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
const idx = tilePage[(r % tileRows) * tileCols + (c % tileCols)];
gallery.appendChild(makeCard(idx, scale, true)); // 画廊 = 图片缩略图(性能)
}
}
}
/* ════════ 演示 ════════ */
function fit() {
const s = Math.min(innerWidth / W, innerHeight / H);
stage.style.transform = 'translate(' + ((innerWidth - W * s) / 2) + 'px, ' + ((innerHeight - H * s) / 2) + 'px) scale(' + s + ')';
stage.style.top = '0'; stage.style.left = '0';
}
function show(idx) {
if (idx < 0 || idx >= deck.length) return;
current = idx;
if (frame.getAttribute('src') !== deck[idx].file) frame.src = deck[idx].file;
counter.innerHTML = (idx + 1) + ' / ' + deck.length + ' <span class="label">' + (deck[idx].label || '') + '</span>';
try { localStorage.setItem(storageKey, String(idx)); } catch (_) {}
if (location.hash !== '#' + (idx + 1)) history.replaceState(null, '', '#' + (idx + 1));
}
function next() { show(Math.min(current + 1, deck.length - 1)); }
function prev() { show(Math.max(current - 1, 0)); }
document.addEventListener('keydown', (e) => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
if (e.key === 'Escape') { if (document.body.getAttribute('data-mode') === 'present') { e.preventDefault(); setMode('overview'); } return; }
if (e.key === 'p' || e.key === 'P') { window.print(); return; }
if (document.body.getAttribute('data-mode') !== 'present') return;
switch (e.key) {
case 'ArrowRight': case ' ': case 'PageDown': e.preventDefault(); next(); break;
case 'ArrowLeft': case 'PageUp': e.preventDefault(); prev(); break;
case 'Home': e.preventDefault(); show(0); break;
case 'End': e.preventDefault(); show(deck.length - 1); break;
default: if (e.key >= '1' && e.key <= '9') { const i = parseInt(e.key, 10) - 1; if (i < deck.length) { e.preventDefault(); show(i); } }
}
});
document.getElementById('navL').addEventListener('click', prev);
document.getElementById('navR').addEventListener('click', next);
document.getElementById('startBtn').addEventListener('click', () => setMode('present'));
document.getElementById('overviewBtn').addEventListener('click', () => setMode('overview'));
let rT;
window.addEventListener('resize', () => { fit(); clearTimeout(rT); rT = setTimeout(buildOverview, 140); });
document.getElementById('ov-grid').addEventListener('scroll', updateScrollOrigin, { passive: true });
window.addEventListener('hashchange', () => { const m = location.hash.match(/^#(\d+)$/); if (m) { current = parseInt(m[1], 10) - 1; setMode('present'); } });
const hashMatch = location.hash.match(/^#(\d+)$/);
if (hashMatch) current = Math.min(parseInt(hashMatch[1], 10) - 1, deck.length - 1);
else { try { const v = parseInt(localStorage.getItem(storageKey), 10); if (!isNaN(v) && v >= 0 && v < deck.length) current = v; } catch (_) {} }
fit(); show(current);
if (hashMatch) setMode('present'); else { setMode('overview'); buildOverview(); }
window.addEventListener('beforeprint', () => { printStack.innerHTML = ''; deck.forEach(item => { const f = document.createElement('iframe'); f.src = item.file; printStack.appendChild(f); }); printStack.style.display = 'block'; stage.style.display = 'none'; });
window.addEventListener('afterprint', () => { printStack.innerHTML = ''; printStack.style.display = 'none'; stage.style.display = ''; });
})();
</script>
</body>
</html>
/**
* <deck-stage> — HTML幻灯片外壳web component
*
* 提供功能:
* - 固定尺寸canvas(默认1920×1080)+ auto-scale + letterbox
* - 键盘导航(←/→/Space/Home/End/Esc)
* - 左右点击区域导航
* - slide counter (当前/总数)
* - localStorage持久化当前slide
* - Speaker notes postMessage (支持外层渲染)
* - Hash导航 (#slide-5 跳到第5张)
* - Print-to-PDF支持 (Cmd+P / Ctrl+P 一页一slide)
* - 自动给每个slide添加 data-screen-label
*
* 用法:
* <deck-stage>
* <section>Slide 1</section>
* <section>Slide 2</section>
* </deck-stage>
*
* 自定义尺寸:
* <deck-stage width="1080" height="1920">...</deck-stage>
*
* Speaker notes:在<head>加
* <script type="application/json" id="speaker-notes">
* ["slide 1 notes", "slide 2 notes"]
* </script>
*/
(function() {
const STORAGE_KEY_PREFIX = 'deck-stage-slide-';
class DeckStage extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this._currentSlide = 0;
this._slides = [];
this._storageKey = STORAGE_KEY_PREFIX + (location.pathname || 'default');
}
connectedCallback() {
this._width = parseInt(this.getAttribute('width')) || 1920;
this._height = parseInt(this.getAttribute('height')) || 1080;
// Shadow DOM 先渲染(独立于子节点,不受 parser 时机影响)
this._render();
// 防御:若 script 放在 <head> 里(而非 </deck-stage> 之后),
// parser 此刻可能还没处理完子 <section>,querySelectorAll 会返回空。
// 延迟到下一个事件循环,确保子节点都已 parse 完毕。
const init = () => {
this._collectSlides();
this._setupEventListeners();
this._restoreSlide();
this._updateDisplay();
this._setupPrintStyles();
};
if (this.ownerDocument.readyState === 'loading') {
// 文档还在 parse,等 DOMContentLoaded 一次搞定所有 section
this.ownerDocument.addEventListener('DOMContentLoaded', init, { once: true });
} else {
// 文档已 parse 完(script 在 body 底部或 defer),下一帧收集即可
requestAnimationFrame(init);
}
}
_render() {
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
position: fixed;
inset: 0;
background: #000;
overflow: hidden;
font-family: -apple-system, 'SF Pro Text', 'PingFang SC', sans-serif;
}
:host([noscale]) .stage {
transform: none !important;
top: 0 !important;
left: 0 !important;
}
.stage {
position: absolute;
top: 50%;
left: 50%;
transform-origin: top left;
will-change: transform;
background: #fff;
}
.slide-wrapper {
width: 100%;
height: 100%;
position: relative;
}
::slotted(section) {
display: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
::slotted(section.active) {
display: block;
}
.counter {
position: fixed;
bottom: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 6px 14px;
border-radius: 999px;
font-size: 13px;
font-variant-numeric: tabular-nums;
z-index: 100;
user-select: none;
opacity: 0.6;
transition: opacity 0.2s;
}
.counter:hover {
opacity: 1;
}
.nav-zone {
position: fixed;
top: 0;
bottom: 0;
width: 15%;
cursor: pointer;
z-index: 50;
}
.nav-zone.left { left: 0; }
.nav-zone.right { right: 0; }
.nav-hint {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 44px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.1);
color: rgba(255, 255, 255, 0.6);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
opacity: 0;
transition: opacity 0.2s;
}
.nav-zone.left .nav-hint { left: 20px; }
.nav-zone.right .nav-hint { right: 20px; }
.nav-zone:hover .nav-hint {
opacity: 1;
}
@media print {
:host {
position: static;
background: #fff;
}
.counter, .nav-zone {
display: none !important;
}
.stage {
position: static;
transform: none !important;
page-break-after: always;
}
::slotted(section) {
display: block !important;
position: relative !important;
page-break-after: always;
width: 100%;
height: 100%;
}
}
</style>
<div class="stage" id="stage" style="width: ${this._width}px; height: ${this._height}px;">
<div class="slide-wrapper">
<slot></slot>
</div>
</div>
<div class="nav-zone left" id="navLeft">
<div class="nav-hint">‹</div>
</div>
<div class="nav-zone right" id="navRight">
<div class="nav-hint">›</div>
</div>
<div class="counter" id="counter">1 / 1</div>
`;
}
_collectSlides() {
this._slides = Array.from(this.querySelectorAll(':scope > section'));
this._slides.forEach((slide, idx) => {
if (!slide.hasAttribute('data-screen-label')) {
const num = String(idx + 1).padStart(2, '0');
slide.setAttribute('data-screen-label', num);
}
if (!slide.hasAttribute('data-om-validate')) {
slide.setAttribute('data-om-validate', '');
}
});
}
_setupEventListeners() {
window.addEventListener('resize', () => this._updateScale());
document.addEventListener('keydown', (e) => {
if (e.target.matches('input, textarea, [contenteditable]')) return;
switch (e.key) {
case 'ArrowRight':
case ' ':
case 'PageDown':
e.preventDefault();
this.next();
break;
case 'ArrowLeft':
case 'PageUp':
e.preventDefault();
this.prev();
break;
case 'Home':
e.preventDefault();
this.goTo(0);
break;
case 'End':
e.preventDefault();
this.goTo(this._slides.length - 1);
break;
}
});
this.shadowRoot.getElementById('navLeft').addEventListener('click', () => this.prev());
this.shadowRoot.getElementById('navRight').addEventListener('click', () => this.next());
window.addEventListener('hashchange', () => this._handleHash());
if (location.hash) {
setTimeout(() => this._handleHash(), 0);
}
const observer = new MutationObserver(() => {
if (this.hasAttribute('noscale')) {
this._updateScale();
}
});
observer.observe(this, { attributes: true, attributeFilter: ['noscale'] });
}
_handleHash() {
const match = location.hash.match(/^#slide-(\d+)$/);
if (match) {
const idx = parseInt(match[1]) - 1;
if (idx >= 0 && idx < this._slides.length) {
this.goTo(idx);
}
}
}
_restoreSlide() {
try {
const stored = localStorage.getItem(this._storageKey);
if (stored !== null) {
const idx = parseInt(stored);
if (idx >= 0 && idx < this._slides.length) {
this._currentSlide = idx;
}
}
} catch (e) {}
}
_saveSlide() {
try {
localStorage.setItem(this._storageKey, String(this._currentSlide));
} catch (e) {}
}
_updateScale() {
if (this.hasAttribute('noscale')) {
const stage = this.shadowRoot.getElementById('stage');
stage.style.transform = 'none';
stage.style.top = '0';
stage.style.left = '0';
return;
}
const stage = this.shadowRoot.getElementById('stage');
if (!stage) return;
const viewportW = window.innerWidth;
const viewportH = window.innerHeight;
const scale = Math.min(viewportW / this._width, viewportH / this._height);
const scaledW = this._width * scale;
const scaledH = this._height * scale;
const offsetX = (viewportW - scaledW) / 2;
const offsetY = (viewportH - scaledH) / 2;
stage.style.transform = `translate(${offsetX}px, ${offsetY}px) scale(${scale})`;
stage.style.top = '0';
stage.style.left = '0';
}
_updateDisplay() {
this._slides.forEach((slide, idx) => {
slide.classList.toggle('active', idx === this._currentSlide);
});
const counter = this.shadowRoot.getElementById('counter');
if (counter) {
counter.textContent = `${this._currentSlide + 1} / ${this._slides.length}`;
}
this._updateScale();
try {
window.postMessage({
slideIndexChanged: this._currentSlide,
totalSlides: this._slides.length
}, '*');
} catch (e) {}
try {
if (window.parent && window.parent !== window) {
window.parent.postMessage({
slideIndexChanged: this._currentSlide,
totalSlides: this._slides.length
}, '*');
}
} catch (e) {}
}
_setupPrintStyles() {
const printStyle = document.createElement('style');
printStyle.textContent = `
@media print {
@page {
size: ${this._width}px ${this._height}px;
margin: 0;
}
body {
margin: 0;
padding: 0;
}
deck-stage {
position: static !important;
}
deck-stage > section {
display: block !important;
position: relative !important;
width: ${this._width}px !important;
height: ${this._height}px !important;
page-break-after: always;
overflow: hidden;
}
deck-stage > section:last-child {
page-break-after: auto;
}
}
`;
document.head.appendChild(printStyle);
}
next() {
if (this._currentSlide < this._slides.length - 1) {
this._currentSlide++;
this._saveSlide();
this._updateDisplay();
}
}
prev() {
if (this._currentSlide > 0) {
this._currentSlide--;
this._saveSlide();
this._updateDisplay();
}
}
goTo(idx) {
if (idx >= 0 && idx < this._slides.length) {
this._currentSlide = idx;
this._saveSlide();
this._updateDisplay();
}
}
get currentSlide() {
return this._currentSlide;
}
get totalSlides() {
return this._slides.length;
}
}
customElements.define('deck-stage', DeckStage);
window.DeckStage = DeckStage;
})();
/**
* DesignCanvas — 变体并排网格布局
*
* 用于展示2+个静态设计variations让用户对比选择。
* 每个variation有label,可hover放大。
*
* 用法:
* <DesignCanvas
* title="Hero区设计探索"
* subtitle="3个方向对比"
* columns={3}
* >
* <Variation label="Minimal" description="极简克制版">
* <div>...你的设计1...</div>
* </Variation>
* <Variation label="Editorial" description="杂志编辑风">
* <div>...你的设计2...</div>
* </Variation>
* <Variation label="Brutalist" description="粗粝原始">
* <div>...你的设计3...</div>
* </Variation>
* </DesignCanvas>
*
* 配合React+Babel使用。放在合适的script里,然后window.DesignCanvas/window.Variation可用。
*/
const canvasStyles = {
container: {
minHeight: '100vh',
background: '#F5F5F0',
padding: '40px 60px',
fontFamily: '-apple-system, "SF Pro Text", "PingFang SC", sans-serif',
},
header: {
marginBottom: 48,
maxWidth: 900,
},
title: {
fontSize: 36,
fontWeight: 600,
marginBottom: 12,
color: '#1A1A1A',
letterSpacing: '-0.02em',
},
subtitle: {
fontSize: 16,
color: '#666',
lineHeight: 1.5,
},
grid: {
display: 'grid',
gap: 32,
},
cell: {
display: 'flex',
flexDirection: 'column',
gap: 12,
},
cellHeader: {
display: 'flex',
alignItems: 'baseline',
gap: 12,
paddingBottom: 8,
borderBottom: '1px solid #E0E0DA',
},
label: {
fontSize: 14,
fontWeight: 600,
color: '#1A1A1A',
letterSpacing: '-0.01em',
},
description: {
fontSize: 13,
color: '#888',
},
frame: {
background: '#fff',
borderRadius: 4,
border: '1px solid #E0E0DA',
overflow: 'hidden',
position: 'relative',
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
cursor: 'pointer',
},
frameInner: {
position: 'relative',
width: '100%',
},
badge: {
position: 'absolute',
top: 12,
left: 12,
background: 'rgba(0, 0, 0, 0.7)',
color: '#fff',
padding: '3px 8px',
borderRadius: 4,
fontSize: 11,
fontWeight: 500,
letterSpacing: '0.5px',
textTransform: 'uppercase',
zIndex: 10,
pointerEvents: 'none',
},
};
function DesignCanvas({ title, subtitle, columns = 3, children }) {
const [expanded, setExpanded] = React.useState(null);
const gridStyle = {
...canvasStyles.grid,
gridTemplateColumns: `repeat(${columns}, 1fr)`,
};
return (
<div style={canvasStyles.container}>
{(title || subtitle) && (
<div style={canvasStyles.header}>
{title && <h1 style={canvasStyles.title}>{title}</h1>}
{subtitle && <p style={canvasStyles.subtitle}>{subtitle}</p>}
</div>
)}
<div style={gridStyle}>
{React.Children.map(children, (child, idx) =>
React.isValidElement(child)
? React.cloneElement(child, {
_index: idx,
_expanded: expanded === idx,
_onToggle: () => setExpanded(expanded === idx ? null : idx),
})
: child
)}
</div>
{expanded !== null && (
<div
onClick={() => setExpanded(null)}
style={{
position: 'fixed',
inset: 0,
background: 'rgba(0, 0, 0, 0.75)',
zIndex: 1000,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
padding: 40,
cursor: 'zoom-out',
}}
>
<div
onClick={e => e.stopPropagation()}
style={{
background: '#fff',
borderRadius: 8,
overflow: 'hidden',
maxWidth: '90vw',
maxHeight: '90vh',
position: 'relative',
}}
>
{React.Children.toArray(children)[expanded]}
</div>
</div>
)}
</div>
);
}
function Variation({ label, description, number, children, _index, _expanded, _onToggle, aspectRatio = '4 / 3' }) {
const displayNumber = number || String(_index + 1).padStart(2, '0');
return (
<div style={canvasStyles.cell}>
<div style={canvasStyles.cellHeader}>
<span style={{ ...canvasStyles.label, color: '#999', fontFamily: 'ui-monospace, monospace', fontSize: 12 }}>
{displayNumber}
</span>
<span style={canvasStyles.label}>{label}</span>
{description && <span style={canvasStyles.description}>— {description}</span>}
</div>
<div
onClick={_onToggle}
style={{
...canvasStyles.frame,
aspectRatio,
}}
onMouseEnter={e => {
e.currentTarget.style.boxShadow = '0 8px 24px rgba(0,0,0,0.08)';
}}
onMouseLeave={e => {
e.currentTarget.style.boxShadow = 'none';
}}
>
<div style={canvasStyles.frameInner}>
{children}
</div>
</div>
</div>
);
}
if (typeof window !== 'undefined') {
Object.assign(window, { DesignCanvas, Variation });
}
/**
* IosFrame — iPhone设备边框
*
* 参考iPhone 15 Pro(393×852 logical pixels)
* 含:灵动岛 + 状态栏(时间/信号/电池)+ Home Indicator + 圆角
*
* 用法:
* <IosFrame time="9:41" battery={85}>
* <YourAppContent />
* </IosFrame>
*
* 自定义:
* <IosFrame width={390} height={844} darkMode showKeyboard>
* ...
* </IosFrame>
*/
const iosFrameStyles = {
wrapper: {
display: 'inline-block',
padding: 12,
background: '#000',
borderRadius: 60,
boxShadow: '0 0 0 2px #1f2937, 0 20px 60px rgba(0,0,0,0.3)',
position: 'relative',
},
screen: {
position: 'relative',
borderRadius: 48,
overflow: 'hidden',
background: '#fff',
},
statusBar: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: 54,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '0 32px 0 32px',
fontSize: 16,
fontWeight: 600,
fontFamily: '-apple-system, "SF Pro Text", sans-serif',
zIndex: 20,
pointerEvents: 'none',
},
dynamicIsland: {
position: 'absolute',
top: 12,
left: '50%',
transform: 'translateX(-50%)',
width: 124,
height: 36,
background: '#000',
borderRadius: 999,
zIndex: 30,
},
statusIcons: {
display: 'flex',
alignItems: 'center',
gap: 6,
},
signalIcon: {
display: 'flex',
alignItems: 'flex-end',
gap: 2,
height: 12,
},
signalBar: {
width: 3,
background: 'currentColor',
borderRadius: 1,
},
wifiIcon: {
width: 16,
height: 12,
position: 'relative',
},
batteryIcon: {
width: 26,
height: 12,
border: '1.5px solid currentColor',
borderRadius: 3,
padding: 1,
position: 'relative',
opacity: 0.8,
},
batteryCap: {
position: 'absolute',
top: 3,
right: -3,
width: 2,
height: 6,
background: 'currentColor',
borderRadius: '0 1px 1px 0',
},
content: {
position: 'absolute',
top: 54,
left: 0,
right: 0,
bottom: 34,
overflow: 'auto',
},
homeIndicator: {
position: 'absolute',
bottom: 10,
left: '50%',
transform: 'translateX(-50%)',
width: 140,
height: 5,
background: 'rgba(0,0,0,0.3)',
borderRadius: 999,
zIndex: 10,
},
homeIndicatorDark: {
background: 'rgba(255,255,255,0.5)',
},
};
function IosFrame({
children,
width = 393,
height = 852,
time = '9:41',
battery = 100,
darkMode = false,
showStatusBar = true,
showDynamicIsland = true,
showHomeIndicator = true,
}) {
const textColor = darkMode ? '#fff' : '#000';
return (
<div style={iosFrameStyles.wrapper}>
<div style={{
...iosFrameStyles.screen,
width,
height,
background: darkMode ? '#000' : '#fff',
}}>
{showStatusBar && (
<div style={{ ...iosFrameStyles.statusBar, color: textColor }}>
<span>{time}</span>
<div style={iosFrameStyles.statusIcons}>
<div style={iosFrameStyles.signalIcon}>
<div style={{ ...iosFrameStyles.signalBar, height: 4 }} />
<div style={{ ...iosFrameStyles.signalBar, height: 6 }} />
<div style={{ ...iosFrameStyles.signalBar, height: 9 }} />
<div style={{ ...iosFrameStyles.signalBar, height: 11 }} />
</div>
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" style={{ color: textColor }}>
<path d="M8 11.5a1 1 0 100-2 1 1 0 000 2z" fill="currentColor" />
<path d="M3 7.5a7 7 0 0110 0" stroke="currentColor" strokeWidth="1.3" fill="none" strokeLinecap="round" />
<path d="M1 4.5a11 11 0 0114 0" stroke="currentColor" strokeWidth="1.3" fill="none" strokeLinecap="round" opacity="0.7" />
</svg>
<div style={iosFrameStyles.batteryIcon}>
<div style={{
width: `${battery}%`,
height: '100%',
background: 'currentColor',
borderRadius: 1,
opacity: 0.9,
}} />
<div style={iosFrameStyles.batteryCap} />
</div>
</div>
</div>
)}
{showDynamicIsland && <div style={iosFrameStyles.dynamicIsland} />}
<div style={iosFrameStyles.content}>
{children}
</div>
{showHomeIndicator && (
<div style={{
...iosFrameStyles.homeIndicator,
...(darkMode ? iosFrameStyles.homeIndicatorDark : {}),
}} />
)}
</div>
</div>
);
}
if (typeof window !== 'undefined') {
window.IosFrame = IosFrame;
}
/**
* MacosWindow — macOS应用窗口边框(含traffic lights)
*
* 用法:
* <MacosWindow title="Finder">
* <YourAppContent />
* </MacosWindow>
*/
const macosWindowStyles = {
window: {
display: 'inline-block',
background: '#fff',
borderRadius: 10,
overflow: 'hidden',
boxShadow: '0 30px 80px rgba(0,0,0,0.25), 0 0 0 0.5px rgba(0,0,0,0.15)',
},
titleBar: {
height: 38,
background: 'linear-gradient(to bottom, #e8e8e8, #d8d8d8)',
display: 'flex',
alignItems: 'center',
padding: '0 14px',
borderBottom: '0.5px solid rgba(0,0,0,0.1)',
position: 'relative',
userSelect: 'none',
},
trafficLights: {
display: 'flex',
gap: 8,
alignItems: 'center',
},
light: {
width: 12,
height: 12,
borderRadius: '50%',
border: '0.5px solid rgba(0,0,0,0.15)',
},
close: { background: '#ff5f57' },
minimize: { background: '#febc2e' },
maximize: { background: '#28c840' },
title: {
position: 'absolute',
left: 0,
right: 0,
textAlign: 'center',
fontSize: 13,
color: '#333',
fontWeight: 500,
fontFamily: '-apple-system, "SF Pro Text", sans-serif',
pointerEvents: 'none',
},
content: {
position: 'relative',
overflow: 'auto',
},
titleBarDark: {
background: 'linear-gradient(to bottom, #3c3c3c, #2c2c2c)',
borderBottom: '0.5px solid rgba(255,255,255,0.1)',
},
titleDark: {
color: '#ddd',
},
};
function MacosWindow({ title = '', width = 900, height = 600, darkMode = false, children }) {
return (
<div style={{ ...macosWindowStyles.window, background: darkMode ? '#1e1e1e' : '#fff' }}>
<div style={{
...macosWindowStyles.titleBar,
...(darkMode ? macosWindowStyles.titleBarDark : {}),
}}>
<div style={macosWindowStyles.trafficLights}>
<div style={{ ...macosWindowStyles.light, ...macosWindowStyles.close }} />
<div style={{ ...macosWindowStyles.light, ...macosWindowStyles.minimize }} />
<div style={{ ...macosWindowStyles.light, ...macosWindowStyles.maximize }} />
</div>
{title && (
<div style={{
...macosWindowStyles.title,
...(darkMode ? macosWindowStyles.titleDark : {}),
}}>
{title}
</div>
)}
</div>
<div style={{ ...macosWindowStyles.content, width, height }}>
{children}
</div>
</div>
);
}
if (typeof window !== 'undefined') {
window.MacosWindow = MacosWindow;
}
/**
* narration_stage.jsx · 解说驱动 Stage
*
* ╔══════════════════════════════════════════════════════════════════╗
* ║ 🛑 用这套工具之前必读:references/voiceover-pipeline.md ║
* ║ ║
* ║ 铁律 #1: 整片是一个连续的运动叙事,不是一组独立场景 ║
* ║ You are not making 7 slides. You are directing 1 movie. ║
* ║ ║
* ║ 铁律 #2: 选定 hero element 跨 scene 持续存在,不要每段一个新布局║
* ║ ║
* ║ 铁律 #3: scene 之间禁止硬切(opacity 1→0/0→1) ║
* ║ 要 morph,不要 cut ║
* ║ ║
* ║ 失败模式 #1(本 skill v1 实战踩坑): ║
* ║ 每个 Scene 各自独立 layout + cue 用 fade-up + scene 切换║
* ║ 整页 opacity 切换 = 带配音的 PowerPoint = 质感归零 ║
* ║ ║
* ║ 正确做法:把 hero 直接放在 <NarrationStage> 子级(不进 Scene) ║
* ║ 用 useNarration() 在 hero 里读 time/scene/cue 状态 ║
* ║ hero 自己根据当前时间决定形态 → 跨 scene 连续运动 ║
* ╚══════════════════════════════════════════════════════════════════╝
*
* 用法(inline 进 HTML 的 <script type="text/babel">):
* const { NarrationStage, Scene, Cue, useNarration } = NarrationStageLib;
*
* const App = () => (
* <NarrationStage timeline={TIMELINE} audioSrc="voiceover.mp3"
* width={1920} height={1080}>
* <Scene id="intro">
* <h1>什么是 token</h1>
* <Cue id="question">
* {(triggered) => triggered && <p>↑ 这是问题</p>}
* </Cue>
* </Scene>
* <Scene id="token-2">
* <Cue id="split">
* {(triggered, progress) => (
* <div style={{opacity: triggered ? 1 : 0.3}}>...</div>
* )}
* </Cue>
* </Scene>
* </NarrationStage>
* );
*
* 时间源(自动二选一):
* - 录视频模式(window.__recording === true):走 window.__time(外部 driver 推帧)
* - 实播模式:走 <audio> 的 currentTime(用户点播放时和音频严格同步)
*
* 与 render-video.js 兼容:
* - tick 第一帧设 window.__ready = true
* - 录视频时检测 window.__recording 强制不播 audio、用 window.__time
* - 暴露 window.__totalDuration 给 driver 算总帧数
*
* 依赖:React 18 + ReactDOM 18 + Babel standalone(同 animations.jsx)
*/
const NarrationStageLib = (() => {
const NarrationContext = React.createContext({
time: 0,
scene: null,
sceneTime: 0,
isCueTriggered: () => false,
cueProgress: () => 0,
});
/**
* 主组件:吃 timeline + audio,提供 context
*
* Props:
* timeline timeline.json 对象(必需)
* audioSrc voiceover.mp3 路径(必需)
* width/height Stage 尺寸,默认 1920x1080
* background 默认 '#0e0e0e'
* controls 是否显示底部播放条,默认 true
* children 动画内容(用 <Scene>/<Cue> 组织)
*/
function NarrationStage({
timeline,
audioSrc,
width = 1920,
height = 1080,
background = '#0e0e0e',
controls = true,
children,
}) {
const audioRef = React.useRef(null);
const [time, setTime] = React.useState(0);
const [playing, setPlaying] = React.useState(false);
const recording = typeof window !== 'undefined' && window.__recording === true;
// 暴露给 render-video.js
React.useEffect(() => {
if (typeof window === 'undefined') return;
window.__totalDuration = timeline.totalDuration;
window.__ready = true;
}, [timeline.totalDuration]);
// 时间 tick
React.useEffect(() => {
let raf;
if (recording) {
// Seek-render(render-video-seek.js 注入 window.__seekRender):冻结自驱时钟,
// 由外部 window.__seek(t) 逐帧推进。每帧都是确定性 seek,不起 rAF。
if (typeof window !== 'undefined' && window.__seekRender) {
window.__seek = (t) => setTime(Math.min(t, timeline.totalDuration));
return;
}
// 录视频模式:rAF wall-clock 自驱动从 0 开始
// 兼容 render-video.js(它依赖动画自然推进 + window.__seek 复位)
let startedAt = null;
const tick = (now) => {
if (startedAt === null) startedAt = now;
setTime(Math.min((now - startedAt) / 1000, timeline.totalDuration));
raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
// 暴露 __seek 给 render-video.js 在 ready 后调 __seek(0) 复位
if (typeof window !== 'undefined') {
window.__seek = (t) => {
startedAt = performance.now() - t * 1000;
setTime(t);
};
}
} else {
// 实播模式:跟随 audio.currentTime
const tick = () => {
if (audioRef.current && !audioRef.current.paused) {
setTime(audioRef.current.currentTime);
}
raf = requestAnimationFrame(tick);
};
tick();
}
return () => cancelAnimationFrame(raf);
}, [recording, timeline.totalDuration]);
// 当前 scene
const currentScene = React.useMemo(() => {
if (!timeline.scenes) return null;
// 找到 start <= time < end 的段。最后一段保留到 end
for (let i = 0; i < timeline.scenes.length; i++) {
const s = timeline.scenes[i];
const next = timeline.scenes[i + 1];
if (time >= s.start && (!next || time < next.start)) return s;
}
return timeline.scenes[0];
}, [time, timeline.scenes]);
const sceneTime = currentScene ? Math.max(0, time - currentScene.start) : 0;
// 找 cue 状态(按 absoluteTime 比较,跨 scene 也能查)
const allCues = React.useMemo(() => {
const map = {};
for (const s of timeline.scenes || []) {
for (const c of s.cues || []) {
map[c.id] = c;
}
}
return map;
}, [timeline.scenes]);
const isCueTriggered = React.useCallback(
(cueId) => {
const c = allCues[cueId];
if (!c) return false;
return time >= c.absoluteTime;
},
[allCues, time],
);
/** 触发后多少秒 0→1,>1 后保持 1。用于 cue 后做渐入动画 */
const cueProgress = React.useCallback(
(cueId, ramp = 0.5) => {
const c = allCues[cueId];
if (!c) return 0;
const dt = time - c.absoluteTime;
if (dt <= 0) return 0;
if (dt >= ramp) return 1;
return dt / ramp;
},
[allCues, time],
);
const ctx = { time, scene: currentScene, sceneTime, isCueTriggered, cueProgress, timeline };
// play/pause/seek 控制
const handlePlayPause = () => {
if (!audioRef.current) return;
if (audioRef.current.paused) {
audioRef.current.play();
setPlaying(true);
} else {
audioRef.current.pause();
setPlaying(false);
}
};
const handleSeek = (e) => {
if (!audioRef.current) return;
const t = parseFloat(e.target.value);
audioRef.current.currentTime = t;
setTime(t);
};
const handleAudioEnded = () => setPlaying(false);
return (
<NarrationContext.Provider value={ctx}>
<div
style={{
position: 'relative',
width,
height,
background,
overflow: 'hidden',
color: '#fff',
fontFamily: '-apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif',
}}
>
{children}
</div>
{!recording && (
<audio
ref={audioRef}
src={audioSrc}
preload="auto"
onEnded={handleAudioEnded}
/>
)}
{!recording && controls && (
<div
style={{
display: 'flex',
alignItems: 'center',
gap: 12,
padding: '12px 16px',
background: '#1a1a1a',
color: '#ddd',
fontFamily: 'monospace',
fontSize: 13,
width,
boxSizing: 'border-box',
}}
>
<button
onClick={handlePlayPause}
style={{
padding: '6px 14px',
background: '#fff',
color: '#000',
border: 0,
borderRadius: 4,
cursor: 'pointer',
fontWeight: 600,
}}
>
{playing ? '❚❚ Pause' : '▶ Play'}
</button>
<input
type="range"
min={0}
max={timeline.totalDuration}
step={0.01}
value={time}
onChange={handleSeek}
style={{ flex: 1 }}
/>
<span style={{ minWidth: 110, textAlign: 'right' }}>
{time.toFixed(2)} / {timeline.totalDuration.toFixed(2)}s
</span>
<span
style={{
padding: '4px 10px',
background: '#2a2a2a',
borderRadius: 4,
minWidth: 100,
textAlign: 'center',
}}
>
{currentScene ? currentScene.id : '—'}
</span>
</div>
)}
</NarrationContext.Provider>
);
}
/**
* Scene 包裹器:只在指定 scene id 激活时渲染 children
*
* Props:
* id scene id(对应 timeline.scenes[].id)
* children 渲染内容;可以是 ReactNode 或 (sceneTime, sceneInfo) => ReactNode
* keepMounted 默认 false。设 true 则一直挂载只切换 visibility(动画连贯需要时用)
*/
function Scene({ id, children, keepMounted = false }) {
const { scene, sceneTime } = React.useContext(NarrationContext);
const isActive = scene && scene.id === id;
if (!isActive && !keepMounted) return null;
const content = typeof children === 'function' ? children(sceneTime, scene) : children;
return (
<div
style={{
position: 'absolute',
inset: 0,
opacity: isActive ? 1 : 0,
pointerEvents: isActive ? 'auto' : 'none',
transition: keepMounted ? 'opacity 0.2s' : undefined,
}}
>
{content}
</div>
);
}
/**
* Cue 包裹器:监听 cue 触发状态
*
* Props:
* id cue id(对应 timeline.scenes[].cues[].id)
* ramp cue 触发后 progress 0→1 的 ramp 时长(秒),默认 0.5
* children 必须是函数:(triggered: bool, progress: 0-1) => ReactNode
*/
function Cue({ id, ramp = 0.5, children }) {
const { isCueTriggered, cueProgress } = React.useContext(NarrationContext);
const triggered = isCueTriggered(id);
const progress = cueProgress(id, ramp);
return children(triggered, progress);
}
/** Hook:在自定义组件里直接拿 narration 状态 */
function useNarration() {
return React.useContext(NarrationContext);
}
/**
* splitChunkToLines · 把一段文字按标点切成 ≤maxLen 字的短行
*
* 用于字幕显示——B 站标准是单行 ≤12 字便于阅读。本函数:
* 1. 先按强标点(。!?\n)切句,绝不跨句号截断
* 2. 每句 ≤ maxLen 直接用,否则按弱标点(,、;:)切片合并
* 3. 中英混合:英文/数字按 0.5 字算视觉宽度
* 4. 兜底硬切(罕见:单个标点段超 maxLen)
*
* @param text 原文
* @param maxLen 单行最大视觉长度,默认 13(≈12 字 + 一个标点)
* @returns 切好的字幕行数组
*/
function visualLen(s) {
let n = 0;
for (const ch of s) n += /[a-zA-Z0-9 .,'":;\-]/.test(ch) ? 0.5 : 1;
return n;
}
function splitChunkToLines(text, maxLen = 13) {
const lines = [];
const sentences = [];
let buf = '';
for (const ch of text) {
buf += ch;
if ('。!?\n'.includes(ch)) { if (buf.trim()) sentences.push(buf.trim()); buf = ''; }
}
if (buf.trim()) sentences.push(buf.trim());
for (const sent of sentences) {
if (visualLen(sent) <= maxLen) { lines.push(sent); continue; }
const parts = [];
let pbuf = '';
for (const ch of sent) {
pbuf += ch;
if (',、;:'.includes(ch)) { parts.push(pbuf); pbuf = ''; }
}
if (pbuf) parts.push(pbuf);
let merged = '';
for (const p of parts) {
if (visualLen(merged) + visualLen(p) <= maxLen) merged += p;
else { if (merged) lines.push(merged); merged = p; }
}
if (merged) {
if (visualLen(merged) <= maxLen) lines.push(merged);
else {
let hbuf = '';
for (const ch of merged) { hbuf += ch; if (visualLen(hbuf) >= maxLen) { lines.push(hbuf); hbuf = ''; } }
if (hbuf) lines.push(hbuf);
}
}
}
return lines.filter(l => l.trim());
}
/**
* Subtitles · B 站风格字幕组件(白光晕深墨字,无背景,按 chunks 时间显示)
*
* 自动从当前 scene.chunks 取活动 chunk,按 splitChunkToLines 切成短行,
* 按字数比例分配 chunk 时间窗给每行显示。
*
* 必需:timeline.scenes[].chunks[](narrate-pipeline.mjs 已默认输出)
*
* Props(可覆盖默认样式):
* bottom 距底部像素,默认 90(不贴边)
* fontSize 字号,默认 32
* color 字色,默认深墨 #1a1a1a(适合浅纸白底)
* haloColor 光晕色,默认 rgba(245,241,232,0.9)(适合 #f5f1e8 底)
* maxLen 单行最大视觉长度,默认 13
*
* 深底场景:把 color 改成 '#fff',haloColor 改成 'rgba(0,0,0,0.85)' 即可。
*/
function Subtitles({ bottom = 90, fontSize = 32, color = '#1a1a1a', haloColor = 'rgba(245,241,232,0.9)', maxLen = 13 } = {}) {
const { time, scene } = React.useContext(NarrationContext);
if (!scene || !scene.chunks) return null;
const active = scene.chunks.find(c => time >= c.absoluteStart && time < c.absoluteEnd);
if (!active) return null;
const lines = splitChunkToLines(active.text, maxLen);
if (lines.length === 0) return null;
const totalLen = lines.reduce((s, l) => s + visualLen(l), 0);
const chunkDur = active.absoluteEnd - active.absoluteStart;
let acc = active.absoluteStart;
let activeLine = lines[lines.length - 1];
let lineStart = active.absoluteStart;
for (const line of lines) {
const dur = (visualLen(line) / totalLen) * chunkDur;
if (time < acc + dur) { activeLine = line; lineStart = acc; break; }
acc += dur;
}
const lineProg = Math.min(1, (time - lineStart) / 0.15);
return React.createElement('div', {
style: { position: 'absolute', left: 0, right: 0, bottom, display: 'flex', justifyContent: 'center', pointerEvents: 'none', zIndex: 50 },
}, React.createElement('div', {
key: lineStart,
style: {
fontFamily: '"PingFang SC", "Noto Sans SC", -apple-system, sans-serif',
fontSize, fontWeight: 600, color,
letterSpacing: '0.04em', lineHeight: 1.2, textAlign: 'center',
textShadow: `0 0 6px ${haloColor}, 0 0 12px ${haloColor}, 0 1px 2px rgba(255,255,255,0.5)`,
opacity: lineProg, transform: `translateY(${(1 - lineProg) * 4}px)`,
},
}, activeLine));
}
/**
* useSceneFade · scene 内辅助元素的软淡入淡出 helper
*
* 铁律第二条要求 scene 之间禁止硬切——但 scene 内辅助元素(数据卡、引用块)
* 一旦 cue 触发后默认会一直亮到 scene 结束。如果不淡出,离开本段进入下段时
* 这些元素会突兀地存在或瞬间消失。本 hook 提供 [入场淡入 → hold → 出场淡出] 的统一软切换。
*
* 用法(把 op 乘进辅助元素的 opacity):
* const op = useSceneFade('md-side', 0.6, 0.8); // 进 0.6s, 出 0.8s
* <Cue id="agents-md">{(t, p) => (
* <div style={{ opacity: op * p }}>...</div>
* )}</Cue>
*
* 这样数据卡片在 md-side 段开始 0.6s 内淡入,在段结束前 0.8s 开始淡出,
* 与下一段的辅助元素淡入形成 overlap,画面不出现硬切。
*
* @param sceneId scene id
* @param fadeIn 入场淡入秒数(默认 0.5)
* @param fadeOut 出场淡出秒数(默认 0.5)
* @returns 0-1 之间的不透明度倍率
*/
function useSceneFade(sceneId, fadeIn = 0.5, fadeOut = 0.5) {
const { time, timeline } = React.useContext(NarrationContext);
if (!timeline) return 0;
const s = timeline.scenes.find(x => x.id === sceneId);
if (!s) return 0;
const inT = (time - s.start) / fadeIn;
const outT = (s.end - time) / fadeOut;
const v = Math.min(1, Math.min(inT, outT));
return Math.max(0, v);
}
return { NarrationStage, Scene, Cue, useNarration, useSceneFade, Subtitles, splitChunkToLines };
})();
if (typeof window !== 'undefined') {
Object.assign(window, { NarrationStageLib });
}
{
"_meta": {
"description": "个人素材索引模板 — 复制此文件并填入你的真实数据",
"how_to_use": "1. 复制此文件到 ~/.claude/memory/personal-asset-index.json 2. 填入你的真实信息 3. design-philosophy skill 会自动读取",
"note": "真实数据文件不要放在 skill 目录内,避免随 skill 分发泄露隐私"
},
"identity": {
"real_name": "你的真名",
"pen_names": ["笔名1", "笔名2"],
"english_name": "English Name",
"title": "你的头衔/一句话介绍",
"bio_short": "50-100字简介",
"bio_long": "200-300字详细介绍",
"avatar_url": "头像URL",
"source": "数据来源备注"
},
"contact": {
"email": "your@email.com",
"wechat_personal": "微信号",
"source": "数据来源备注"
},
"social_media": {
"github": {
"url": "https://github.com/yourname",
"username": "yourname"
},
"youtube": {
"url": "https://www.youtube.com/@YourChannel",
"channel_name": "频道名"
},
"source": "数据来源备注"
},
"websites": {
"main_site": {
"url": "https://yoursite.com",
"description": "网站描述",
"local_path": "/path/to/local/project/"
}
},
"products": {
"product_1": {
"name": "产品名",
"type": "iOS App / Web App / CLI Tool / 电子书",
"achievement": "主要成就",
"icon_path": "/path/to/icon.png",
"project_path": "/path/to/project/"
}
},
"stats": {
"social_followers": "粉丝数",
"product_users": "用户数",
"source": "数据来源备注"
},
"design_assets": {
"article_images": {
"base_path": "/path/to/images/",
"notable_sets": []
}
},
"knowledge_base": {
"wechat_articles": "/path/to/knowledge_base/"
}
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1200">
<title>Claude Code Agent - Build Studio Style</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1200px;
height: 510px;
overflow: hidden;
margin: 0;
background: #FAFAF8;
font-family: 'Inter', sans-serif;
position: relative;
}
/* Subtle top gradient wash */
.wash {
position: absolute;
top: 0;
left: 0;
width: 1200px;
height: 510px;
background: radial-gradient(ellipse 800px 400px at 30% 40%, rgba(212, 165, 116, 0.06) 0%, transparent 70%);
z-index: 0;
}
/* Main layout */
.layout {
position: absolute;
top: 0;
left: 0;
width: 1200px;
height: 510px;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.center-block {
text-align: center;
max-width: 700px;
margin-top: -24px; /* slight upward shift for golden ratio vertical center */
}
/* Floating "Agent" */
.floating-agent {
font-family: 'Inter', sans-serif;
font-weight: 200;
font-size: 128px;
letter-spacing: -4px;
color: #1A1A18;
line-height: 1;
margin-bottom: 16px;
position: relative;
}
.floating-agent span {
position: relative;
display: inline-block;
}
/* Slight weight shift on first letter for visual interest */
.floating-agent .accent-letter {
font-weight: 300;
color: #2A2A28;
}
/* Gold underline accent */
.gold-line {
width: 48px;
height: 1px;
background: #D4A574;
margin: 0 auto 32px;
opacity: 0.7;
}
/* Subtitle — label tier: smallest text, widest spacing */
.subtitle {
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 10px;
letter-spacing: 6px;
text-transform: uppercase;
color: #B0ACA4;
margin-bottom: 24px;
}
/* Description line — body tier */
.desc {
font-family: 'Inter', sans-serif;
font-weight: 300;
font-size: 13px;
color: #A8A4A0;
letter-spacing: 0.3px;
line-height: 2;
max-width: 400px;
margin: 0 auto;
}
/* Minimal agent indicators — 8 thin vertical lines */
.agent-indicators {
position: absolute;
bottom: 48px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 16px;
align-items: flex-end;
z-index: 2;
}
.indicator {
width: 1px;
background: #D8D4CE;
border-radius: 0.5px;
}
.indicator.gold {
background: #D4A574;
width: 1.5px;
opacity: 0.8;
}
/* Corner marks */
.corner-mark {
position: absolute;
z-index: 2;
}
.corner-mark svg {
display: block;
}
.corner-tl { top: 48px; left: 48px; }
.corner-br { bottom: 48px; right: 48px; transform: rotate(180deg); }
/* Side text */
.side-label {
position: absolute;
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 8px;
letter-spacing: 4px;
text-transform: uppercase;
color: #CBC7C0;
z-index: 2;
}
.side-left {
left: 48px;
top: 50%;
transform: translateY(-50%) rotate(-90deg);
transform-origin: center center;
}
.side-right {
right: 48px;
top: 50%;
transform: translateY(-50%) rotate(90deg);
transform-origin: center center;
}
/* Removed shadow-card — Build purity demands uninterrupted whitespace */
/* Number 8 whisper */
.number-whisper {
position: absolute;
top: 48px;
right: 96px;
font-family: 'Inter', sans-serif;
font-weight: 200;
font-size: 24px;
color: #D4A574;
opacity: 0.35;
z-index: 2;
}
</style>
</head>
<body>
<div class="wash"></div>
<!-- Corner marks -->
<div class="corner-mark corner-tl">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L0 20" stroke="#D4A574" stroke-width="0.5" opacity="0.4"/>
<path d="M0 0L20 0" stroke="#D4A574" stroke-width="0.5" opacity="0.4"/>
</svg>
</div>
<div class="corner-mark corner-br">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L0 20" stroke="#D4A574" stroke-width="0.5" opacity="0.4"/>
<path d="M0 0L20 0" stroke="#D4A574" stroke-width="0.5" opacity="0.4"/>
</svg>
</div>
<!-- Side labels -->
<div class="side-label side-left">Claude Code</div>
<div class="side-label side-right">Parallel Workflow</div>
<!-- Number whisper -->
<div class="number-whisper">8</div>
<!-- Main content -->
<div class="layout">
<div class="center-block">
<div class="subtitle">Parallel Architecture</div>
<div class="floating-agent"><span><span class="accent-letter">A</span>gent</span></div>
<div class="gold-line"></div>
<div class="desc">
Eight autonomous agents orchestrated in parallel,<br>
each solving a distinct piece of the whole.
</div>
</div>
</div>
<!-- Agent indicators -->
<div class="agent-indicators">
<div class="indicator" style="height: 20px;"></div>
<div class="indicator" style="height: 28px;"></div>
<div class="indicator gold" style="height: 36px;"></div>
<div class="indicator" style="height: 22px;"></div>
<div class="indicator" style="height: 32px;"></div>
<div class="indicator gold" style="height: 40px;"></div>
<div class="indicator" style="height: 24px;"></div>
<div class="indicator" style="height: 30px;"></div>
</div>
</body>
</html><!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1200">
<title>Agent Parallel — Pentagram Style Cover</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1200px;
height: 510px;
overflow: hidden;
margin: 0;
background: #FFFFFF;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
position: relative;
}
/* Grid rules — Swiss grid visible structure */
.rule-h {
position: absolute;
left: 64px;
right: 64px;
height: 1px;
background: #000;
opacity: 0.06;
}
.rule-v {
position: absolute;
top: 0;
bottom: 0;
width: 1px;
background: #000;
opacity: 0.04;
}
/* Giant typographic element — the "8" bleeds off right edge */
.type-anchor {
position: absolute;
right: -60px;
top: 50%;
transform: translateY(-50%);
font-family: 'Helvetica Neue', Arial, sans-serif;
font-weight: 900;
font-size: 640px;
line-height: 0.82;
color: #000;
opacity: 0.07;
z-index: 0;
user-select: none;
}
/* Red geometric dot grid — 8 dots representing 8 agents */
.dot-grid {
position: absolute;
right: 340px;
top: 50%;
transform: translateY(-50%);
display: grid;
grid-template-columns: repeat(4, 24px);
grid-template-rows: repeat(2, 24px);
gap: 16px;
z-index: 1;
}
.dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #000;
opacity: 0.12;
align-self: center;
justify-self: center;
}
.dot.active {
background: #E63946;
opacity: 0.8;
width: 10px;
height: 10px;
}
/* Primary content zone — left-aligned on Swiss grid */
.content {
position: absolute;
left: 64px;
top: 56px;
z-index: 2;
}
.label {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 11px;
font-weight: 700;
letter-spacing: 4px;
text-transform: uppercase;
color: #E63946;
margin-bottom: 16px;
}
.title {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-weight: 900;
font-size: 120px;
line-height: 0.9;
color: #000;
letter-spacing: -5px;
}
.title .accent {
color: #E63946;
}
/* Bottom information bar */
.bottom-bar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 48px;
background: #000;
z-index: 2;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 64px;
}
.bottom-left {
display: flex;
align-items: center;
gap: 24px;
}
.bottom-stat {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
text-transform: uppercase;
color: #fff;
opacity: 0.6;
}
.bottom-stat strong {
color: #E63946;
opacity: 1;
font-size: 16px;
margin-right: 6px;
}
.bottom-right {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 10px;
font-weight: 700;
letter-spacing: 3px;
text-transform: uppercase;
color: #fff;
opacity: 0.4;
}
/* Subtitle */
.subtitle {
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 14px;
font-weight: 500;
color: #999;
letter-spacing: 0.5px;
margin-top: 20px;
}
/* Horizontal red rule through center */
.center-rule {
position: absolute;
left: 64px;
width: 240px;
height: 3px;
background: #E63946;
top: 306px;
z-index: 2;
}
</style>
</head>
<body>
<!-- Grid structure -->
<div class="rule-h" style="top: 56px;"></div>
<div class="rule-v" style="left: 64px;"></div>
<div class="rule-v" style="left: 600px;"></div>
<div class="rule-v" style="right: 64px;"></div>
<!-- Typographic anchor — bleeds right -->
<div class="type-anchor">8</div>
<!-- 8-dot grid representing agents -->
<div class="dot-grid">
<div class="dot active"></div>
<div class="dot"></div>
<div class="dot active"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot active"></div>
<div class="dot"></div>
<div class="dot active"></div>
</div>
<!-- Content -->
<div class="content">
<div class="label">Claude Code Architecture</div>
<div class="title">Agent<br><span class="accent">Parallel</span></div>
<div class="subtitle">8 autonomous agents running in unified workflow</div>
</div>
<!-- Red horizontal rule -->
<div class="center-rule"></div>
<!-- Black bottom bar with data -->
<div class="bottom-bar">
<div class="bottom-left">
<div class="bottom-stat"><strong>8</strong>Agents</div>
<div class="bottom-stat"><strong>3.2x</strong>Faster</div>
<div class="bottom-stat"><strong>1</strong>Workflow</div>
</div>
<div class="bottom-right">Pentagram Design System</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1200">
<title>Claude Code Agent - Takram Style</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Noto+Serif+SC:wght@300;400;500;600&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1200px;
height: 510px;
overflow: hidden;
margin: 0;
background: #F5F0EB;
font-family: 'Inter', sans-serif;
position: relative;
}
/* Subtle paper texture overlay */
.texture {
position: absolute;
top: 0; left: 0;
width: 1200px;
height: 510px;
background:
radial-gradient(ellipse 500px 400px at 72% 50%, rgba(168, 181, 160, 0.06) 0%, transparent 70%),
radial-gradient(ellipse 300px 250px at 15% 40%, rgba(232, 228, 220, 0.2) 0%, transparent 60%);
z-index: 0;
}
/* Flow diagram — the art piece */
.diagram {
position: absolute;
top: 0; left: 0;
width: 1200px;
height: 510px;
z-index: 1;
}
/* Left text panel */
.text-panel {
position: absolute;
left: 72px;
top: 56px;
z-index: 2;
max-width: 360px;
}
.text-panel .label {
font-family: 'Inter', sans-serif;
font-weight: 500;
font-size: 9px;
letter-spacing: 3px;
text-transform: uppercase;
color: #6B8F71;
margin-bottom: 20px;
opacity: 0.8;
}
.text-panel .title-main {
font-family: 'Noto Serif SC', serif;
font-weight: 500;
font-size: 52px;
color: #2D3436;
line-height: 1.15;
letter-spacing: -0.5px;
margin-bottom: 4px;
}
.text-panel .title-sub {
font-family: 'Noto Serif SC', serif;
font-weight: 300;
font-size: 20px;
color: #6D685F;
line-height: 1.4;
margin-bottom: 16px;
}
.text-panel .title-en {
font-family: 'Inter', sans-serif;
font-weight: 300;
font-size: 13px;
color: #9A958D;
letter-spacing: 0.3px;
line-height: 1.8;
}
/* Bottom annotation */
.annotation {
position: absolute;
left: 72px;
bottom: 40px;
z-index: 2;
}
.annotation .note {
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 10px;
color: #B0AAA0;
letter-spacing: 0.3px;
}
.annotation .note-serif {
font-family: 'Noto Serif SC', serif;
font-weight: 300;
font-size: 11px;
color: #9A958D;
margin-top: 4px;
}
/* Right side number */
.spec-number {
position: absolute;
right: 72px;
bottom: 40px;
font-family: 'Inter', sans-serif;
font-weight: 300;
font-size: 10px;
color: #B0AAA0;
letter-spacing: 1px;
z-index: 2;
}
/* Agent node styling */
.node-label {
font-family: 'Inter', sans-serif;
font-size: 9px;
font-weight: 400;
fill: #8A857D;
letter-spacing: 0.5px;
}
.node-label-serif {
font-family: 'Noto Serif SC', serif;
font-size: 11px;
font-weight: 400;
fill: #6D685F;
}
.node-index {
font-family: 'Inter', sans-serif;
font-size: 7px;
font-weight: 400;
fill: #B0AAA0;
letter-spacing: 0.5px;
}
</style>
</head>
<body>
<div class="texture"></div>
<!-- Text panel -->
<div class="text-panel">
<div class="label">Speculative Architecture</div>
<div class="title-main">协作智能体</div>
<div class="title-sub">Parallel Workflow</div>
<div class="title-en">
Eight agents, each autonomous,<br>
converging toward a shared intent.
</div>
</div>
<!-- The diagram as art -->
<svg class="diagram" viewBox="0 0 1200 510" xmlns="http://www.w3.org/2000/svg">
<!-- Subtle background grid hints (Takram spec-drawing aesthetic) -->
<line x1="440" y1="0" x2="440" y2="510" stroke="#E8E4DC" stroke-width="0.3" opacity="0.4"/>
<line x1="760" y1="0" x2="760" y2="510" stroke="#E8E4DC" stroke-width="0.3" opacity="0.3"/>
<!-- Subtle outer orbital paths — layered ellipses for depth -->
<ellipse cx="760" cy="255" rx="260" ry="195" fill="none" stroke="#E0DCD5" stroke-width="0.5" stroke-dasharray="1,8" opacity="0.5"/>
<ellipse cx="760" cy="255" rx="180" ry="135" fill="none" stroke="#D8D3CB" stroke-width="0.4" stroke-dasharray="2,6" opacity="0.35"/>
<!-- Central orchestrator node — refined with layered depth -->
<circle cx="760" cy="255" r="48" fill="none" stroke="#6B8F71" stroke-width="0.5" opacity="0.12" stroke-dasharray="2,4"/>
<circle cx="760" cy="255" r="36" fill="none" stroke="#6B8F71" stroke-width="0.8" opacity="0.18"/>
<circle cx="760" cy="255" r="24" fill="none" stroke="#6B8F71" stroke-width="1.2" opacity="0.3"/>
<circle cx="760" cy="255" r="14" fill="rgba(107,143,113,0.05)"/>
<circle cx="760" cy="255" r="5.5" fill="#6B8F71" opacity="0.55"/>
<circle cx="760" cy="255" r="2" fill="#6B8F71" opacity="0.9"/>
<text x="760" y="312" text-anchor="middle" class="node-label-serif">Orchestrator</text>
<!-- Subtle cross-hair on center -->
<line x1="748" y1="255" x2="730" y2="255" stroke="#6B8F71" stroke-width="0.3" opacity="0.15"/>
<line x1="772" y1="255" x2="790" y2="255" stroke="#6B8F71" stroke-width="0.3" opacity="0.15"/>
<line x1="760" y1="243" x2="760" y2="225" stroke="#6B8F71" stroke-width="0.3" opacity="0.15"/>
<line x1="760" y1="267" x2="760" y2="285" stroke="#6B8F71" stroke-width="0.3" opacity="0.15"/>
<!-- Agent 1 — top-left (Research) -->
<line x1="738" y1="232" x2="598" y2="118" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="560" y="92" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="598" cy="111" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="598" y="144" text-anchor="middle" class="node-label">Research</text>
<text x="560" y="88" class="node-index">01</text>
<!-- Agent 2 — top (Analysis) -->
<line x1="760" y1="217" x2="760" y2="145" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="722" y="100" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="760" cy="119" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="760" y="152" text-anchor="middle" class="node-label">Analysis</text>
<text x="722" y="96" class="node-index">02</text>
<!-- Agent 3 — top-right (Code) -->
<line x1="782" y1="232" x2="918" y2="118" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="884" y="92" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="922" cy="111" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="922" y="144" text-anchor="middle" class="node-label">Code</text>
<text x="884" y="88" class="node-index">03</text>
<!-- Agent 4 — right (Test) -->
<line x1="786" y1="252" x2="940" y2="215" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="940" y="196" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="978" cy="215" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="978" y="248" text-anchor="middle" class="node-label">Test</text>
<text x="940" y="192" class="node-index">04</text>
<!-- Agent 5 — bottom-right (Review) -->
<line x1="782" y1="278" x2="918" y2="385" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="884" y="368" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="922" cy="387" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="922" y="420" text-anchor="middle" class="node-label">Review</text>
<text x="884" y="364" class="node-index">05</text>
<!-- Agent 6 — bottom (Deploy) -->
<line x1="760" y1="293" x2="760" y2="365" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="722" y="370" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="760" cy="389" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="760" y="422" text-anchor="middle" class="node-label">Deploy</text>
<text x="722" y="366" class="node-index">06</text>
<!-- Agent 7 — bottom-left (Monitor) -->
<line x1="738" y1="278" x2="600" y2="375" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="562" y="358" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="600" cy="377" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="600" y="410" text-anchor="middle" class="node-label">Monitor</text>
<text x="562" y="354" class="node-index">07</text>
<!-- Agent 8 — left (Design) -->
<line x1="734" y1="252" x2="578" y2="245" stroke="#C8C2B8" stroke-width="0.7" stroke-dasharray="3,5"/>
<rect x="502" y="226" width="76" height="38" rx="14" fill="rgba(245,240,235,0.7)" stroke="#B8B2A8" stroke-width="0.8"/>
<circle cx="540" cy="245" r="3.5" fill="#6B8F71" opacity="0.5"/>
<text x="540" y="278" text-anchor="middle" class="node-label">Design</text>
<text x="502" y="222" class="node-index">08</text>
<!-- Small annotation marks — Takram spec-drawing details -->
<circle cx="490" cy="120" r="1.2" fill="#B0AAA0" opacity="0.35"/>
<line x1="492" y1="120" x2="535" y2="120" stroke="#B0AAA0" stroke-width="0.4" opacity="0.25"/>
<circle cx="1040" cy="390" r="1.2" fill="#B0AAA0" opacity="0.35"/>
<line x1="1038" y1="390" x2="995" y2="390" stroke="#B0AAA0" stroke-width="0.4" opacity="0.25"/>
<!-- Dimension annotation line (top) -->
<line x1="540" y1="60" x2="980" y2="60" stroke="#D4CFC6" stroke-width="0.4" opacity="0.3"/>
<line x1="540" y1="55" x2="540" y2="65" stroke="#D4CFC6" stroke-width="0.4" opacity="0.3"/>
<line x1="980" y1="55" x2="980" y2="65" stroke="#D4CFC6" stroke-width="0.4" opacity="0.3"/>
<text x="760" y="54" text-anchor="middle" font-family="Inter" font-size="7" font-weight="300" fill="#C8C2B8" letter-spacing="1.5">AGENT FIELD</text>
<!-- Right-side vertical annotation -->
<line x1="1060" y1="130" x2="1060" y2="380" stroke="#D4CFC6" stroke-width="0.3" opacity="0.25"/>
<line x1="1056" y1="130" x2="1064" y2="130" stroke="#D4CFC6" stroke-width="0.3" opacity="0.25"/>
<line x1="1056" y1="380" x2="1064" y2="380" stroke="#D4CFC6" stroke-width="0.3" opacity="0.25"/>
<text x="1068" y="260" font-family="Inter" font-size="7" font-weight="300" fill="#D4CFC6" letter-spacing="0.5" transform="rotate(90, 1068, 260)">NETWORK DEPTH</text>
<!-- Subtle data pulse lines emanating from center (organic feel) -->
<path d="M 760 217 Q 755 200 758 185" fill="none" stroke="#6B8F71" stroke-width="0.3" opacity="0.12"/>
<path d="M 786 248 Q 810 230 835 225" fill="none" stroke="#6B8F71" stroke-width="0.3" opacity="0.12"/>
<path d="M 786 262 Q 815 275 840 290" fill="none" stroke="#6B8F71" stroke-width="0.3" opacity="0.12"/>
<!-- Top-right spec box -->
<rect x="1040" y="48" width="104" height="56" rx="3" fill="rgba(245,240,235,0.5)" stroke="#E0DCD5" stroke-width="0.6"/>
<text x="1052" y="66" font-family="Inter" font-size="8" font-weight="500" fill="#B0AAA0" letter-spacing="1.5">AGENTS</text>
<text x="1052" y="92" font-family="Inter" font-size="28" font-weight="300" fill="#6B8F71">8</text>
<text x="1082" y="92" font-family="Inter" font-size="9" font-weight="300" fill="#B0AAA0"> parallel</text>
</svg>
<!-- Bottom annotation -->
<div class="annotation">
<div class="note">Fig. 01 — Parallel Agent Architecture</div>
<div class="note-serif">Claude Code 协作编排模型</div>
</div>
<!-- Spec number -->
<div class="spec-number">v1.0 / 2026</div>
</body>
</html>Design Philosophy Showcases — 样例资产索引
8 种场景 × 3 种风格 = 24 个预制设计样例
用于 Phase 3 推荐设计方向时,直接展示「这个风格做出来长什么样」
风格说明
| 代号 | 流派 | 风格名称 | 视觉气质 |
|---|---|---|---|
| Pentagram | 信息建筑派 | Pentagram / Michael Bierut | 黑白克制、瑞士网格、强字体层级、#E63946红色强调 |
| Build | 极简主义派 | Build Studio | 奢侈品级留白(70%+)、微妙字重(200-600)、#D4A574暖金、精致 |
| Takram | 东方哲学派 | Takram | 柔和科技感、自然色(米色/灰/绿)、圆角、图表如艺术 |
场景速查表
内容设计场景
| # | 场景 | 规格 | Pentagram | Build | Takram |
|---|---|---|---|---|---|
| 1 | 公众号封面 | 1200×510 | cover/cover-pentagram | cover/cover-build | cover/cover-takram |
| 2 | PPT数据页 | 1920×1080 | ppt/ppt-pentagram | ppt/ppt-build | ppt/ppt-takram |
| 3 | 竖版信息图 | 1080×1920 | infographic/infographic-pentagram | infographic/infographic-build | infographic/infographic-takram |
网站设计场景
| # | 场景 | 规格 | Pentagram | Build | Takram |
|---|---|---|---|---|---|
| 4 | 个人主页 | 1440×900 | website-homepage/homepage-pentagram | website-homepage/homepage-build | website-homepage/homepage-takram |
| 5 | AI导航站 | 1440×900 | website-ai-nav/ainav-pentagram | website-ai-nav/ainav-build | website-ai-nav/ainav-takram |
| 6 | AI写作工具 | 1440×900 | website-ai-writing/aiwriting-pentagram | website-ai-writing/aiwriting-build | website-ai-writing/aiwriting-takram |
| 7 | SaaS落地页 | 1440×900 | website-saas/saas-pentagram | website-saas/saas-build | website-saas/saas-takram |
| 8 | 开发者文档 | 1440×900 | website-devdocs/devdocs-pentagram | website-devdocs/devdocs-build | website-devdocs/devdocs-takram |
每个条目同时有.html(源码)和.png(截图)两个文件
使用说明
Phase 3 推荐时引用
推荐设计方向后,可展示对应场景的预制截图:
「这是 Pentagram 风格做公众号封面的效果 → [展示 cover/cover-pentagram.png]」
「Takram 风格做 PPT 数据页是这种感觉 → [展示 ppt/ppt-takram.png]」场景匹配优先级
1. 用户需求的场景有精确匹配 → 直接展示对应场景 2. 无精确匹配但类型相近 → 展示最近似的场景(如「产品官网」→ 展示 SaaS 落地页) 3. 完全不匹配 → 跳过预制样例,直接进 Phase 3.5 现场生成
横向对比展示
同一场景的 3 个风格适合并排展示,帮助用户直观比较:
- 「这是同一个公众号封面,分别用 3 种风格实现的效果」
- 展示顺序:Pentagram(理性克制)→ Build(奢华极简)→ Takram(柔和温暖)
内容详情
公众号封面(cover/)
- 内容:Claude Code Agent 工作流 — 8 个并行 Agent 架构
- Pentagram:巨大红色「8」+ 瑞士网格线 + 数据条
- Build:超细字重「Agent」悬浮于 70% 留白中 + 暖金细线
- Takram:8 节点放射状流程图作为艺术品 + 米色底
PPT数据页(ppt/)
- 内容:GLM-4.7 开源模型 Coding 能力突破(AIME 95.7 / SWE-bench 73.8% / τ²-Bench 87.4)
- Pentagram:260px「95.7」锚点 + 红/灰/浅灰对比条形图
- Build:三组 120px 超细数字悬浮 + 暖金渐变对比条
- Takram:SVG 雷达图 + 三色叠加 + 圆角数据卡片
竖版信息图(infographic/)
- 内容:AI 记忆系统 CLAUDE.md 从 93KB 优化到 22KB
- Pentagram:巨大「93→22」数字 + 编号区块 + CSS 数据条
- Build:极致留白 + 柔影卡片 + 暖金连接线
- Takram:SVG 环形图 + 有机曲线流程图 + 毛玻璃卡片
个人主页(website-homepage/)
- 内容:独立开发者 Alex Chen 的作品集首页
- Pentagram:112px 大名 + 瑞士网格分栏 + 编辑数字
- Build:玻璃态导航 + 悬浮统计卡片 + 超细字重
- Takram:纸质纹理 + 小圆形头像 + 发丝细分隔线 + 不对称布局
AI导航站(website-ai-nav/)
- 内容:AI Compass — 500+ AI 工具目录
- Pentagram:方角搜索框 + 编号工具列表 + 大写分类标签
- Build:圆角搜索框 + 精致白色工具卡片 + 药丸标签
- Takram:有机错位卡片布局 + 柔和分类标签 + 图表式连接
AI写作工具(website-ai-writing/)
- 内容:Inkwell — AI 写作助手
- Pentagram:86px 大标题 + 线框编辑器模型 + 网格特性列
- Build:漂浮编辑器卡片 + 暖金 CTA + 奢华写作体验
- Takram:诗意衬线标题 + 有机编辑器 + 流程图
SaaS落地页(website-saas/)
- 内容:Meridian — 商业智能分析平台
- Pentagram:黑白分栏 + 结构化仪表盘 + 140px「3x」锚点
- Build:悬浮仪表盘卡片 + SVG 面积图 + 暖金渐变
- Takram:圆角柱状图 + 流程节点 + 柔和地球色
开发者文档(website-devdocs/)
- 内容:Nexus API — 统一 AI 模型网关
- Pentagram:左侧导航栏 + 方角代码块 + 红色字符串高亮
- Build:居中漂浮代码卡片 + 柔影 + 暖金图标
- Takram:米色代码块 + 流程图连接 + 虚线特性卡片
文件统计
- HTML 源文件:24 个
- PNG 截图:24 个
- 总资产:48 个文件
---
版本:v1.0 创建日期:2026-02-13 适用于:design-philosophy skill Phase 3 推荐环节
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440">
<title>Alex Chen — Indie Developer & AI Creator</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&display=swap" rel="stylesheet">
<script src="https://unpkg.com/lucide@latest"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 1440px;
height: 900px;
overflow: hidden;
margin: 0;
background: #FAFAF8;
font-family: 'Inter', sans-serif;
color: #2A2A28;
position: relative;
}
/* GLASSMORPHISM NAV */
nav {
position: fixed;
top: 0;
left: 0;
width: 1440px;
height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 80px;
background: rgba(250, 250, 248, 0.72);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border-bottom: 1px solid rgba(0,0,0,0.04);
z-index: 100;
}
nav .logo {
font-weight: 500;
font-size: 15px;
letter-spacing: 0.02em;
color: #2A2A28;
}
nav .logo .dot { color: #D4A574; }
nav ul {
list-style: none;
display: flex;
gap: 40px;
}
nav ul li a {
font-weight: 400;
font-size: 13px;
color: #888;
text-decoration: none;
letter-spacing: 0.01em;
transition: color 0.3s;
}
nav ul li a:hover { color: #2A2A28; }
nav .nav-cta a {
font-weight: 400;
font-size: 12px;
color: #2A2A28;
text-decoration: none;
padding: 8px 24px;
border: 1px solid rgba(0,0,0,0.08);
border-radius: 2px;
transition: all 0.3s;
letter-spacing: 0.02em;
}
nav .nav-cta a:hover {
border-color: #D4A574;
color: #D4A574;
}
/* HERO LAYOUT */
.hero {
position: absolute;
top: 0;
left: 0;
width: 1440px;
height: 900px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 80px;
}
.hero-content {
display: flex;
align-items: center;
gap: 96px;
width: 100%;
max-width: 1200px;
}
/* LEFT: TEXT */
.hero-text {
flex: 1;
}
.hero-text .greeting {
font-weight: 400;
font-size: 11px;
color: #B0ACA4;
letter-spacing: 4px;
text-transform: uppercase;
margin-bottom: 24px;
}
.hero-text h1 {
font-weight: 200;
font-size: 80px;
line-height: 1.02;
letter-spacing: -0.04em;
color: #2A2A28;
}
.hero-text h1 strong {
font-weight: 500;
}
.hero-text h1 .gold-period {
color: #D4A574;
font-weight: 300;
}
.hero-text .tagline {
font-weight: 300;
font-size: 16px;
line-height: 1.8;
color: #999;
margin-top: 32px;
max-width: 440px;
}
/* CTA BUTTONS */
.hero-cta {
display: flex;
gap: 16px;
margin-top: 48px;
}
.btn-primary {
display: inline-flex;
align-items: center;
gap: 8px;
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 13px;
color: #FAFAF8;
background: #2A2A28;
border: none;
padding: 14px 32px;
border-radius: 2px;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
letter-spacing: 0.02em;
}
.btn-primary:hover { background: #3A3A38; }
.btn-secondary {
display: inline-flex;
align-items: center;
gap: 8px;
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 13px;
color: #888;
background: transparent;
border: 1px solid rgba(0,0,0,0.08);
padding: 14px 32px;
border-radius: 2px;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
letter-spacing: 0.02em;
}
.btn-secondary:hover { border-color: #D4A574; color: #D4A574; }
/* RIGHT: CARDS + PORTRAIT */
.hero-visual {
flex: 0 0 460px;
position: relative;
height: 520px;
}
/* PORTRAIT */
.portrait {
width: 200px;
height: 200px;
border-radius: 50%;
background: #EDECE8;
position: absolute;
top: 0;
right: 40px;
box-shadow: 0 20px 60px rgba(0,0,0,0.06);
overflow: hidden;
}
.portrait::after {
content: '';
position: absolute;
bottom: 0; left: 50%;
transform: translateX(-50%);
width: 110px;
height: 130px;
background: #D8D6D0;
border-radius: 55px 55px 0 0;
}
/* FLOATING CARDS */
.card {
position: absolute;
background: #FFFFFF;
border: 1px solid rgba(0,0,0,0.04);
border-radius: 2px;
padding: 24px;
box-shadow: 0 4px 24px rgba(0,0,0,0.03);
}
.card-1 {
top: 60px;
left: 0;
width: 220px;
}
.card-2 {
top: 240px;
left: 60px;
width: 240px;
}
.card-3 {
top: 180px;
right: 0;
width: 200px;
}
.card .card-number {
font-weight: 200;
font-size: 32px;
letter-spacing: -0.02em;
color: #2A2A28;
line-height: 1;
}
.card .card-number .gold { color: #D4A574; font-weight: 300; }
.card .card-label {
font-weight: 400;
font-size: 10px;
color: #B0ACA4;
margin-top: 8px;
letter-spacing: 2px;
text-transform: uppercase;
}
.card .card-desc {
font-weight: 300;
font-size: 12px;
color: #999;
margin-top: 8px;
line-height: 1.5;
}
/* GOLD ACCENT LINE */
.accent-line {
position: absolute;
bottom: 0;
left: 100px;
width: 48px;
height: 2px;
background: #D4A574;
border-radius: 1px;
}
/* Removed dot-grid — Build: zero decorative elements */
/* BOTTOM TICKER */
.bottom-bar {
position: absolute;
bottom: 0;
left: 0;
width: 1440px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
gap: 48px;
border-top: 1px solid rgba(0,0,0,0.04);
}
.bottom-bar span {
font-weight: 300;
font-size: 11px;
color: #BBB;
letter-spacing: 0.08em;
}
.bottom-bar .sep {
width: 4px;
height: 4px;
border-radius: 50%;
background: #D4A574;
opacity: 0.5;
}
</style>
</head>
<body>
<!-- NAV -->
<nav>
<div class="logo">alex chen<span class="dot"> .</span></div>
<ul>
<li><a href="#work">Work</a></li>
<li><a href="#content">Content</a></li>
<li><a href="#services">Services</a></li>
</ul>
<div class="nav-cta">
<a href="#contact">Get in Touch</a>
</div>
</nav>
<!-- HERO -->
<div class="hero">
<div class="hero-content">
<!-- TEXT -->
<div class="hero-text">
<div class="greeting">Indie Developer & AI Creator</div>
<h1>Alex<br><strong>Chen</strong><span class="gold-period">.</span></h1>
<p class="tagline">Building tools at the intersection of AI and creativity. Shipping products, writing stories, shaping ideas.</p>
<div class="hero-cta">
<a href="#work" class="btn-primary">
View Work
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
</a>
<a href="#content" class="btn-secondary">Read Articles</a>
</div>
</div>
<!-- VISUAL -->
<div class="hero-visual">
<div class="portrait"></div>
<div class="card card-1">
<div class="card-number">300K<span class="gold">+</span></div>
<div class="card-label">Followers</div>
<div class="card-desc">Across platforms, building in public</div>
</div>
<div class="card card-2">
<div class="card-number"><span class="gold">#</span>1</div>
<div class="card-label">App Store</div>
<div class="card-desc">Top paid app, shipped as a solo developer</div>
</div>
<div class="card card-3">
<div class="card-number">100<span class="gold">+</span></div>
<div class="card-label">Articles</div>
<div class="card-desc">On AI, dev, and creative tools</div>
</div>
<div class="accent-line"></div>
</div>
</div>
</div>
<!-- BOTTOM BAR -->
<div class="bottom-bar">
<span>Developer</span>
<div class="sep"></div>
<span>Writer</span>
<div class="sep"></div>
<span>AI Creator</span>
<div class="sep"></div>
<span>Speaker</span>
</div>
</body>
</html>