Skip to content
Shell
7.8 KB
Raw Blame

EJB.Ventures v2 - Three.js Flower Landscape

WATCHER Protocol

Claude's Role: Orchestrator and quality gate. Each phase completes with:

  1. Verification checkpoint (tests, visual inspection via Playwright)
  2. Debug any issues found
  3. Explicit greenlight before advancing

Phase 1: Foundation Setup

Goal: Three.js scene with flower image visible

Assigned Tools

Tool Purpose
Subagent: fullstack-developer Build initial HTML/JS structure
MCP: Playwright Visual verification of rendering
Skill: ui-builder Style loading screen

Tasks

  1. Create /v2/ directory structure
  2. Copy and optimize source image (remove watermark, create resolutions)
  3. Set up Three.js scene (renderer, camera, scene)
  4. Load flower texture on PlaneGeometry
  5. Add OrbitControls for dev exploration

Verification (WATCHER)

  • Playwright screenshot confirms flower renders full-frame
  • OrbitControls work (can rotate/zoom)
  • No console errors
  • Image loads < 3 seconds

Phase 2: Camera Path System

Goal: Scroll-controlled camera movement along predefined path

Assigned Tools

Tool Purpose
Subagent: fullstack-developer Implement camera path logic
MCP: Playwright Test scroll interactions

Tasks

  1. Define waypoint array (positions, rotations, labels)
  2. Map scroll wheel to path progress (0-1)
  3. Implement smooth camera interpolation (lerp/slerp)
  4. Add waypoint snapping with debounce

Verification (WATCHER)

  • Playwright: scroll through all waypoints
  • Camera moves smoothly without jitter
  • Waypoint labels match expected positions

Phase 3: Particle System

Goal: Convert image to interactive particle point cloud

Assigned Tools

Tool Purpose
Subagent: fullstack-developer Core particle implementation
Plugin: performance-optimizer Ensure 60fps target
MCP: Playwright Visual verification

Tasks

  1. Extract pixel data via offscreen canvas
  2. Generate BufferGeometry (50k particles)
  3. Create PointsMaterial with vertexColors
  4. Implement scatter/assemble animations
  5. Add mouse proximity interaction

Verification (WATCHER)

  • Particles form recognizable flower shape
  • Colors match original image
  • Mouse interaction displaces nearby particles
  • Performance: 60fps on desktop (measure via console)

Phase 4: Mode Toggle & Transition

Goal: Switch between Color (Personal) and Particle (Professional) modes

Assigned Tools

Tool Purpose
Subagent: frontend-developer Toggle UI component
Skill: ui-builder Style toggle button
MCP: Playwright Test transitions

Tasks

  1. Create fixed-position toggle button
  2. Implement 1.5s transition animation
  3. State management with localStorage

Verification (WATCHER)

  • Toggle switches modes visually
  • Transition animation smooth (no flicker)
  • State persists across page reload
  • Keyboard shortcut (P) works

Phase 5: Content Overlays

Goal: Display text/links at each waypoint

Assigned Tools

Tool Purpose
Subagent: frontend-developer Overlay system
Skill: ui-builder Typography/layout
MCP: Playwright Verify content sync

Tasks

  1. HTML overlay container (absolute positioned)
  2. Define content for each waypoint × mode
  3. Sync fade in/out with camera position
  4. Add links to existing MDX routes

Verification (WATCHER)

  • Content appears at correct waypoints
  • Fades are smooth, no abrupt cuts
  • Links navigate to /personal/, /pro/ correctly
  • Typography legible on all backgrounds

Phase 6: Leafhopper Easter Egg Setup

Goal: Define hit zone and interaction for hidden leafhopper

Assigned Tools

Tool Purpose
Subagent: fullstack-developer Hit detection logic
MCP: Playwright Test hover/click

Tasks

  1. Define hit region at (42%, 58%) with 5% radius
  2. Implement hover detection via raycaster
  3. Add visual feedback (glow, cursor change)
  4. Branch click handler by current mode

Verification (WATCHER)

  • Hover triggers visual feedback at correct location
  • Cursor changes on hover
  • Click in Personal mode → triggers Phase 7
  • Click in Professional mode → triggers Phase 8

Phase 7: Kirlian Effect (Personal Mode Easter Egg)

Goal: Transform flower into electric Kirlian photograph

Assigned Tools

Tool Purpose
Subagent: fullstack-developer Shader implementation
MCP: Perplexity Research Kirlian shader techniques
MCP: Playwright Visual verification

Tasks

  1. Fade to black background
  2. Implement edge detection (Sobel shader)
  3. Animate corona discharge (blue/cyan/violet)
  4. Exit on click

Verification (WATCHER)

  • Kirlian effect visually striking
  • Colors: electric blue, cyan, violet, white
  • Animation flickers naturally
  • Click exits back to normal mode

Phase 8: Hand Tracking Demo (Professional Mode Easter Egg)

Goal: Control particles with webcam hand tracking

Assigned Tools

Tool Purpose
Subagent: ai-engineer MediaPipe integration
MCP: Playwright Permission flow testing
Plugin: testing-suite Hand tracking accuracy

Tasks

  1. Prompt + webcam permission flow
  2. Lazy-load MediaPipe Hands
  3. Map landmarks to controls (position, pinch, wave)
  4. PiP feedback overlay
  5. Exit via timeout or gesture

Verification (WATCHER)

  • Permission request appears correctly
  • Hand detected and visualized
  • Particle control responsive
  • Exit works (timeout 30s or gesture)

Phase 9: Mobile & Gyroscope

Goal: Device orientation navigation for mobile

Assigned Tools

Tool Purpose
Subagent: frontend-developer Gyro/touch implementation
MCP: Playwright Emulate mobile viewport
Plugin: performance-optimizer Mobile performance tuning

Tasks

  1. Device detection
  2. Gyroscope permission + calibration UX
  3. Map tilt to path progress
  4. Touch fallback (swipe)
  5. Reduce particle count for 30fps target

Verification (WATCHER)

  • Mobile viewport renders correctly
  • Touch navigation works
  • Performance acceptable (measure fps)
  • No layout breaks

Phase 10: Polish & Deploy

Goal: Production-ready experience

Assigned Tools

Tool Purpose
Plugin: performance-optimizer Final profiling
Plugin: testing-suite Cross-browser tests
Subagent: code-reviewer Final code review
MCP: Playwright Full journey test

Tasks

  1. Loading experience (progress bar, particle formation)
  2. Cross-browser testing (Chrome, Firefox, Safari, Edge)
  3. Performance profiling + optimization
  4. Deploy to ejb.ventures root

Verification (WATCHER)

  • All browsers render correctly
  • Full journey works: start → petals → center → return
  • Easter eggs functional
  • Performance: 60fps desktop, 30fps mobile
  • No console errors/warnings

Source Assets

  • Image: _DSF0127.jpeg (watermark to be removed)
  • Leafhopper location: 42% X, 58% Y (5% hit radius)

Files to Create

/v2/
├── index.html       # Main entry
├── assets/
│   ├── flower-4k.jpg   # Full res (watermark removed)
│   ├── flower-2k.jpg   # Desktop
│   └── flower-1k.jpg   # Mobile
└── README.md

Existing Files to Preserve

  • /app/personal/* - MDX routes
  • /app/pro/* - MDX routes
  • /content/* - MDX content

Success Criteria

  1. 60fps desktop, 30fps mobile
  2. Smooth mode transitions
  3. Cinematic camera path
  4. Easter eggs discoverable but not obvious
  5. MDX content links functional
  6. All major browsers + mobile supported