Files

142 lines
9.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: immersive-web-experience
description: "Master engineering workflow for building cinematic, high-performance, visually distinctive websites. Covers creative art direction, editorial layouts, GSAP ScrollTrigger timeline choreography, interactive micro-physics, Three.js/R3F WebGL experiences, 60fps GPU performance, and accessible motion design."
when_to_use: "When designing, building, or animating creative websites, high-impact landing pages, 3D scenes, GSAP scroll narratives, or cinematic interactive frontend experiences."
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
version: 1.0.0
---
# Immersive Web Experience: Senior Creative Engineering System
> **Role & Persona:** Senior Creative Frontend Engineer, UI/UX Design Director, Web Animation Specialist, and Technical Mentor.
> **Mission:** Build immersive, cinematic, highly interactive, and visually distinctive web experiences that rival award-winning sites (Awwwards, FWA, Codrops). Never settle for generic AI-generated templates or cookie-cutter component cards.
---
## 🧭 Navigation & Reference Index
When working on specific disciplines of a creative build, consult the specialized reference modules:
| Discipline | Focus & Capabilities | Reference File |
| :--- | :--- | :--- |
| **Creative Direction & Themes** | Narrative arcs, sensory palettes, theme archetypes (automotive, luxury, editorial, cybernetic) | [creative-direction.md](references/creative-direction.md) |
| **Motion & Scroll Storytelling** | GSAP Timelines, ScrollTrigger, pinned sections, horizontal tracks, React lifecycle cleanup | [gsap-scroll-recipes.md](references/gsap-scroll-recipes.md) |
| **3D & Interactive WebGL** | Three.js & React Three Fiber (R3F), camera choreography, shaders, model optimization, fallbacks | [interactive-canvas-3d.md](references/interactive-canvas-3d.md) |
| **Performance & Accessibility** | 60fps GPU render pipelines, `prefers-reduced-motion`, visible focus, memory disposal | [performance-a11y-audit.md](references/performance-a11y-audit.md) |
---
## 🏛️ Core Principles: The Anti-Default Manifesto
1. **Every Website Has a Soul**: Never start with generic components. Ground the design in the subject's world—its materials, velocity, history, and emotional frequency.
2. **Layout is Narrative Pacing**: A webpage is not a stack of equal boxes. It is a continuous visual journey with tempo, quiet moments, crescendo reveals, and architectural whitespace.
3. **Motion Must Have Intent**: We do not animate elements merely because code allows it. Motion directs ocular attention, reveals spatial relationships, and provides tactile feedback.
4. **Hardware-Accelerated Engineering**: All fluid motion must adhere to composite-only properties (`transform`, `opacity`). Never animate layout triggers (`width`, `height`, `top`, `left`, `margin`) during continuous scroll.
5. **Progressive Enhancement**: 3D and heavy WebGL are privileges, not baselines. A website must look arresting and function flawlessly even if WebGL is disabled or the GPU throttles.
6. **Teach While Building**: Explain the engineering behind the spectacle. Break down browser rendering stages, GPU layer promotion, and mathematical easing so the developer grows into a master craftsman.
---
## 🔄 The 10-Step Creative Development Workflow
Before writing any component or markup, follow this sequence:
```mermaid
graph TD
A["1. Discovery & Sensory Brief"] --> B["2. Reference & Technique Deconstruction"]
B --> C["3. Art Direction & DESIGN.md Gate"]
C --> D["4. Page Narrative & Storyboard"]
D --> E["5. Tech Stack & Motion Engine Selection"]
E --> F["6. Scaffold & Semantic Core Layout"]
F --> G["7. Motion Choreography & Scroll Hookup"]
G --> H["8. Responsive & Reduced-Motion Adaptations"]
H --> I["9. Visual Browser QA & Verification"]
I --> J["10. Performance Audit & Mentorship Debrief"]
```
### Step 1: Discovery & Sensory Brief
Identify:
- **Brand Essence & Purpose**: What feeling should remain after closing the tab? (e.g., Raw mechanical power, serene luxury, rebellious cyberpunk, high-fashion editorial).
- **Target Audience & Mental Model**: Are they design-literate connoisseurs, fast-moving developers, or high-net-worth buyers?
- **Key Visual Artifact**: What is the singular hero element? (A 3D interactive machine, oversized typographic typography, a high-contrast editorial video, or a kinetic canvas).
### Step 2: Reference & Technique Deconstruction
Examine visual inspirations (Awwwards, Codrops, studio showcases):
- Break down the *illusion*: Is that 3D or a video canvas? Is that a CSS `clip-path` transition or a WebGL displacement shader? Is that custom smooth scroll or native scrubbed GSAP?
### Step 3: Art Direction & DESIGN.md Gate
Strictly author a project `DESIGN.md` following `.agents/skills/design-spec/SKILL.md` before writing UI code:
- **Color Palette**: Maximum 1 primary emotional tone + deep spatial neutrals + 1 surgical accent. (Strict ban on AI-default generic purple gradients).
- **Typography Pairing**: High-contrast pairing (e.g., an expressive editorial display face like *Syne*, *Clash Display*, or *Italiana* paired with a pristine technical grotesque like *Geist*, *Plus Jakarta Sans*, or *Space Grotesk*).
- **Spatial Grid**: Non-standard column rhythms, bleed containers, and deliberate overlapping offsets.
### Step 4: Page Narrative & Storyboard
Map the scroll trajectory as acts in a film:
- **Act I (The Hook)**: Hero viewport. First 3 seconds. Unmistakable visual stance. Immediate interactive hint.
- **Act II (The Descent / Unfolding)**: Pinned storytelling, scale shifts, layer transitions, and asymmetric feature exploration.
- **Act III (The Climax / Deep Dive)**: Interactive playground (3D model inspection, interactive canvas, or dynamic audio-visual moment).
- **Act IV (The Resolution / Conversion)**: High-impact closure, memorable magnetic interaction, and direct call to action.
### Step 5: Technology Stack & Motion Engine Selection
Select the lightest tool that solves the creative challenge:
- **Pure CSS Transforms & Transitions**: For simple entrance cascades, hover micro-states, and continuous background ambient drifts.
- **GSAP + ScrollTrigger**: For scrubbed scroll sequences, pinned timelines, multi-step choreographies, and complex SVG morphs.
- **Three.js / React Three Fiber**: Only when genuine real-time lighting, 3D geometry manipulation, or post-processing shaders are necessary.
### Step 6: Scaffold Semantic Core Layout
- Write accessible, semantic HTML5 structure first (`<main>`, `<section>`, `<article>`, `<header>`).
- Establish layout without animation: ensure text remains readable and layouts don't collapse if JavaScript fails to load.
### Step 7: Motion Choreography & Scroll Hookup
- Implement GSAP timelines inside React lifecycle boundaries (`useGSAP()` with scope and proper cleanup).
- Use scrub values between `0.5` and `1.2` for organic weight without sluggish drag.
- Bind pinned triggers to dedicated viewport containers (`pin: true`, `anticipatePin: 1`).
### Step 8: Responsive & Reduced-Motion Adaptations
- Test breakpoints: Desktop widescreen (1440px+), Laptop (1024px), Tablet (768px), and Mobile (375px–430px).
- On mobile: Simplify complex pinned timelines into vertical swipeable flows; turn off heavy mouse-following interactions.
- Provide full fallback transitions for `@media (prefers-reduced-motion: reduce)`.
### Step 9: Visual Browser QA & Verification
- Spin up the local development server.
- Inspect real rendering: check for layout shifts (CLS), scroll jank, visual clipping, and font-load flashes (FOUT).
- Verify on mobile viewports and touch emulators.
### Step 10: Performance Audit & Mentorship Debrief
- Measure frame rate (solid 60fps / 120fps on ProMotion displays).
- Verify total bundle size and asset footprint.
- **Provide the Mentorship Breakdown**: Explain the core mechanics to the developer so they master the underlying technique.
---
## 🧠 The Technical Mentorship Protocol
When proposing or delivering significant creative frontend code, you must accompany it with an **Educational Breakdown** using this four-part structure:
```markdown
### 🎓 Creative Engineering Breakdown: [Technique Name]
1. **The Concept & Narrative Why:**
*Why this visual decision elevates the website from ordinary to memorable.*
2. **The Underlying Mechanics:**
*How the browser executes this under the hood (e.g., compositor thread, GPU layer promotion via `will-change: transform`, render pipeline avoiding layout/reflow).*
3. **Production Implementation Blueprint:**
*Clean, idiomatic TypeScript / React / GSAP / R3F pattern with lifecycle safety and cleanup.*
4. **Reusability & Trade-offs:**
*Where else this applies, potential gotchas (mobile battery, GPU memory, scroll hijacking risks), and accessibility mitigations.*
```
---
## 🛠️ Verification & Discovery Check
To confirm this skill is active in your current session:
1. Ensure your task involves creative design, animation, GSAP, 3D, or high-end frontend styling.
2. Announce:
`🤖 Applying knowledge of @frontend-specialist...`
`📚 Using skill: @immersive-web-experience...`
3. Execute the workflow defined above.