Repository navigation
差点爆了 - #47
Merged
Merged
差点爆了#47
Conversation
设计基于 SHARP 单图→3DGS 的沉浸式 3D 主菜单插件:赛博都市天台场景 + 镜头推移 + 全息面板。采用全屏 Overlay Portal 方案(零核心改动、 可逆),待 v2 P3-1 ExtensionPoint 落地后自动升级为 home:renderer 贡献点。经 brainstorming 6 节逐节确认。
11 TDD tasks for com.bonnext.scene-menu plugin: - Scaffold + useOverlayVisibility/useCameraDolly/useLaunchLastInstance hooks - SceneRenderer (3DGS + WebGL fallback), MenuLayer (4 panels), SceneOverlay - createRoot lifecycle, styles, offline asset docs, QA checklist Architecture: ReactDOM.createRoot + window.location.hash + get_active_account auth gating. Fully reversible overlay - no core/HomePage changes.
…ing/parallax/transition)
…s + reduced-motion)
… leak - targetElement → rootElement (library's actual property name) - detectWebGL() now releases WebGL context via WEBGL_lose_context - Memoize detectWebGL() with useMemo to run once, not every render Root causes: 1. Viewer ignored targetElement, created canvas on document.body instead of inside our container → invisible model 2. detectWebGL() created a new WebGL context on every re-render, never released → "too many active WebGL contexts" → Viewer's context killed
- Disable built-in controls (was conflicting with dolly offset) - Increase breathing amplitude (0.1→0.2 x, 0.05→0.1 y, 0.03→0.05 z) - Increase parallax strength (0.15→0.25) - Increase transition push distance (0.4→0.6 menu, 0.5→0.8 launch) - Widen SAFE_RANGE (translate 0.3→0.4, push 0.5→0.8) - Update tests to match new range
…ming - MenuLayer applies parallax transform (translate + scale) based on camera offset, making buttons feel embedded in the 3D scene - Fix transition: push-in 500ms → fade-out 300ms → navigate (was: push-in + fade-out simultaneously, hiding the camera move) - Add will-change: transform to menuLayer for smooth performance
- Widen SAFE_RANGE (translate 0.4→0.8, push 0.8→2.0) for bigger moves - Replace expoEase with cinematicEase (ease-in-out cubic) for film feel - Extend transition duration 600ms→1000ms for visible push-in - Increase transition targets: z=1.5 for menu items, z=1.8 for launch with lateral offsets (x=0.4-0.6) for off-center close-up feel - Adjust transition timing: push 800ms → fade 300ms → navigate 1100ms - Boost MenuLayer parallax (translate 30→40px/m, scale 0.12→0.15/m) - Update test expectations for new SAFE_RANGE and transition timeout
- get_instances → list_instances (match actual Tauri command name) - Add invoke:core:accounts:read permission for auth state checks
…nEnd ref Root cause: onTransitionEnd was an inline function in SceneOverlay, creating a new reference on every render. This was in useCameraDolly's useEffect dependency array, causing the effect to re-run every frame, which reset transitionStartRef to null — so elapsed was always ~0 and the transition never advanced past the starting point. Fix: Store onTransitionEnd in a ref (updated via separate effect), remove it from the main effect's dependency array. Now the rAF loop runs stably and the transition timer accumulates correctly.
User feedback: '镜头默认不要抖来抖去的' (don't want camera shaking by default) Remove breathingOffset from the rAF loop. Default state is now static camera with only mouse parallax (interactive, not autonomous). Transition push-in on menu click remains unchanged.
…utton User feedback: '点击按钮后应该运镜到按钮所在的附近给个特写 先不要直接 跳转页面;另外现在点击按钮运镜结束后就不停在原地,而是闪回最开始的 镜头位置' Two fixes: 1. Remove onTransitionEnd callback — transitionTarget stays set after transition completes, so camera holds at the close-up position instead of snapping back to origin 2. Extend timing: push 1000ms → hold 500ms → fade 300ms → navigate 1800ms (was: push 800ms → fade 300ms → navigate 1100ms, no hold) Also fix transition directions to match button positions in 2x2 grid: - instances (top-right): x=+0.4, y=+0.2 (was correct) - store (bottom-left): x=-0.4, y=-0.2 (was x=+0.6, wrong direction) - settings (bottom-right): x=+0.4, y=-0.2 (was x=+0.5, y=-0.3)
User feedback: '现在是往下运镜 怎么回事 我要的是往按钮方向运镜' Root cause: Camera offset direction is opposite to screen movement direction because camera always lookAt(0,0,0). When camera moves right, scene appears to move left. Transition targets had positive x/y for top-right button, causing scene to move down-left (away from button). Fix: 1. Invert transition target x/y so scene moves toward button position - instances (top-right): x=-0.4, y=-0.2 (scene moves up-right) - store (bottom-left): x=+0.4, y=+0.2 (scene moves down-left) - settings (bottom-right): x=-0.4, y=+0.2 (scene moves down-right) 2. Invert MenuLayer parallax direction so buttons move same direction as scene (buttons feel embedded in scene, not floating opposite)
User feedback: '方向仍不对' + '默认就不要跟随鼠标移动镜头' + '3d模型没有占满屏幕,窗口下面露出了黑色' Three fixes: 1. Transition targets: x/y → 0, z-only push (eliminates direction confusion — all buttons get same straight push-in) 2. Remove parallax from rAF loop — camera is fully static by default, only moves during transition push-in 3. Camera: y 0.2→0 (level, was looking down), z 2→1.8 (closer), FOV 40→45 (wider) — model now fills screen, no black gap at bottom
User feedback: '不要纯推进 我要旋转方向丝滑推进到不同按钮在的位置 有3A大片感' Implement directional push-in with rotation: 1. Restore x/y offsets per button position (instances=top-right, store=bottom-left, settings=bottom-right) 2. Invert camera offset direction in SceneRenderer — offset.x/y positive now moves scene toward that direction (camera moves opposite, scene follows offset) 3. lookAt point offsets 50% of camera offset — creates rotation feel instead of pure translation (camera arcs around scene) 4. MenuLayer parallax back to normal direction (follows scene) Result: clicking a button pushes camera toward that button's position with a smooth arcing rotation, giving AAA cinematic feel.
User feedback: '调深度/距离' + '点击按钮没有把镜头对准按钮' Increase offsets and depth for more dramatic, aimed transitions: 1. Transition targets x/y: 0.4/0.2 → 0.6/0.3 (camera aims more toward button position, not just general direction) 2. Button depth translateZ: -200 → -300 (buttons start further away) 3. Pull-in amount: 150 → 250 (buttons travel from -300 to -50, larger zoom range = more dramatic push-in) 4. Parallax factors: 40→50px/m, 0.2→0.25/m (buttons follow camera more visibly)
User feedback: '太近了,把按钮放在远处建筑物那里。另外点击开始游戏
按钮只有平推'
Two fixes:
1. Button depth translateZ: -300 → -500 (buttons at far building
distance). Pull-in amount: 250 → 400 (travels from -500 to -100,
still keeps some distance at close-up)
2. Launch button transition: was {x:0, y:0, z:1.8} (pure push), now
{x:-0.6, y:0.3, z:1.8} (aims toward top-left where launch button
sits in 2x2 grid)
…ction) Hero: +3D perspective rotateX, scroll velocity blur, magnetic cursor (4→7) Manifesto: +line Y translate, line blur, background tint, keyword emphasis (1→5) DesignLanguage: +3D perspective, label slide-in, background position shift (3→6) Performance: +title line reveal, stat stagger, code window clip reveal (2→5) All sections now use useReducedMotion for accessibility. References Apple MacBook Pro cinematic techniques.
… sections All 4 sections implement medium animation density (5 techniques each): ContentPlatform: horizontal scroll drive, 3D card tilt, clip-path reveal, number counting, background parallax Architecture: layered parallax reveal, 3D depth stacking, connecting lines, core layer highlight, background grid shift CrossPlatform: card stagger, 3D flip, icon scale pop, platform detect pulse, magnetic hover Download: magnetic cursor, glow breathe, title char reveal, platform pulse, version typewriter + GitHub Releases integration All sections use useReducedMotion for accessibility.
- Add .github/workflows/deploy-web.yml: builds web/ and deploys to GitHub Pages on push to main. Uses --ignore-workspace to avoid pnpm workspace conflicts. - Remove legacy landing/ and site/ folders (replaced by web/)
- Add web/src/vite-env.d.ts: type declarations for CSS modules, images, SVG - Update web/vite.config.ts: use vitest/config defineConfig for test property - Build now passes: tsc -b && vite build succeeds with 452 modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
How Tested
pnpm buildpassescargo checkpassescargo testpassespnpm tauri devChecklist