# manidhar8008/mw-ai-cinematic architecture

> Architecture diagram of the GitHub repository manidhar8008/mw-ai-cinematic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manidhar8008/mw-ai-cinematic
- Repository: https://github.com/manidhar8008/mw-ai-cinematic

## Overview

#### Purpose and Runtime

MW.AI is a static, scroll-driven cinematic landing page. React 18 and TypeScript run in a Vite-built browser application; visuals use native HTML5 2D Canvas and `requestAnimationFrame`, with no backend or animation service. Production output is static `dist/`, suitable for GitHub Pages or another static host.

Entry points: `index.html`, `src/main.tsx`, and `src/app/App.tsx`.

#### Application Shell

`src/main.tsx` mounts the React application. `src/app/App.tsx` composes the page-level experience, while `src/app/LandingPage.tsx` owns the fullscreen landing layout and scrollable document structure. The design uses a tall scroll region as input and a fixed viewport scene as output, rather than conventional routed screens.

Relevant paths:
- `src/main.tsx`
- `src/app/App.tsx`
- `src/app/LandingPage.tsx`

#### Timeline as the Core Contract

The central boundary is a pure timeline state model. Scroll progress is normalized to 0–1, then converted into visual parameters such as camera distance, subject scale, atmospheric/digital/logo opacity, wind, and turbulence. Canvas layers consume this shared state independently, keeping progression logic separate from drawing logic.

Relevant paths:
- `src/app/components/CinematicScene/timeline.ts`
- `src/app/components/CinematicScene/useTimeline.ts`
- `src/app/components/CinematicScene/index.tsx`

#### Scroll and Animation Control Flow

Browser scroll drives `useTimeline`, which reads `window.scrollY`, normalizes it against the intended scroll range, and updates timeline state. The fixed scene receives that state; individual renderers maintain canvas sizing and animation loops via browser resize events and `requestAnimationFrame`. This makes scroll position the authoritative experience controller, while time-based rendering supplies motion.

Flow: scroll position → `useTimeline` → timeline state → layered renderers.

#### Layered Cinematic Scene

`CinematicScene` is the orchestration point for the visual stack. It combines three canvas-based renderers and a DOM logo layer, allowing each effect system to fade or transform based on the same timeline values.

Relevant paths:
- `src/app/components/CinematicScene/index.tsx`
- `src/app/components/CinematicScene/renderers/AtmosphereCanvas.tsx`
- `src/app/components/CinematicScene/renderers/SkydiverCanvas.tsx`

#### Visual Transformation Stages

The timeline defines four phases: exit, fall, transform, and arrival. Atmosphere rendering handles sky, clouds, storms, lightning, and wind; the skydiver renderer handles the animated subject and turbulence; digital rendering introduces abstract grid, particle, and data effects during transformation. The final logo is DOM-rendered for text styling and reveal effects.

Relevant paths:
- `src/app/components/CinematicScene/renderers/AtmosphereCanvas.tsx`
- `src/app/components/CinematicScene/renderers/DigitalCanvas.tsx`
- `src/app/components/CinematicScene/renderers/MWLogo.tsx`

#### Styling, Analytics, and Delivery

Global visual behavior—including fullscreen layout, hidden scrollbar, responsive typography, fonts, and cookie styling—is distributed under `src/styles/`. `src/app/Analytics.tsx` is the integration boundary for client-side analytics. Static legal, SEO, and deployment-host artifacts live in `public/`; CI deployment is defined in `.github/workflows/deploy.yml`.

Relevant paths:
- `src/styles/index.css`
- `src/app/Analytics.tsx`
- `.github/workflows/deploy.yml`

Main entry points: [`src/app/components/CinematicScene/timeline.ts`](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/timeline.ts) (Timeline model), [`src/app/components/CinematicScene/index.tsx`](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/index.tsx) (Cinematic scene), [`src/app/LandingPage.tsx`](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/LandingPage.tsx) (Landing layout), [`src/app/App.tsx`](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/App.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser Application"]
  node_html["HTML entry<br/>Vite entry<br/>[index.html]"]
  node_main["React mount<br/>React bootstrap<br/>[main.tsx]"]
  node_app["App shell<br/>React composition<br/>[App.tsx]"]
  node_landing["Landing layout<br/>scroll document<br/>[LandingPage.tsx]"]
  node_styles["Global styles<br/>CSS<br/>[index.css]"]
  node_analytics["Analytics boundary<br/>client integration<br/>[Analytics.tsx]"]
end

subgraph group_scene["Cinematic Scene"]
  node_timeline["Timeline model<br/>pure state model<br/>[timeline.ts]"]
  node_use_timeline["Scroll timeline hook<br/>React hook<br/>[useTimeline.ts]"]
  node_cinematic_scene["Cinematic scene<br/>scene orchestrator<br/>[index.tsx]"]
  node_atmosphere["Atmosphere canvas<br/>Canvas renderer"]
  node_skydiver["Skydiver canvas<br/>Canvas renderer<br/>[SkydiverCanvas.tsx]"]
  node_digital["Digital canvas<br/>Canvas renderer<br/>[DigitalCanvas.tsx]"]
  node_logo["MW logo<br/>DOM overlay<br/>[MWLogo.tsx]"]
end

subgraph group_delivery["Delivery"]
  node_deploy["Static deployment<br/>CI workflow<br/>[deploy.yml]"]
  node_dist["Static dist output<br/>production artifact"]
end

node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"composes"| node_landing
node_app -->|"integrates"| node_analytics
node_landing -->|"scroll input"| node_use_timeline
node_use_timeline -->|"normalizes scroll to"| node_timeline
node_timeline -->|"shared state"| node_cinematic_scene
node_landing -->|"hosts fixed scene"| node_cinematic_scene
node_cinematic_scene -->|"layers"| node_atmosphere
node_cinematic_scene -->|"layers"| node_skydiver
node_cinematic_scene -->|"layers"| node_digital
node_cinematic_scene -->|"layers"| node_logo
node_timeline -->|"visual parameters"| node_atmosphere
node_timeline -->|"visual parameters"| node_skydiver
node_timeline -->|"visual parameters"| node_digital
node_timeline -->|"reveal state"| node_logo
node_styles -->|"styles"| node_landing
node_deploy -->|"builds and publishes"| node_dist

click node_html "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/index.html"
click node_main "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/main.tsx"
click node_app "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/App.tsx"
click node_landing "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/LandingPage.tsx"
click node_timeline "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/timeline.ts"
click node_use_timeline "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/useTimeline.ts"
click node_cinematic_scene "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/index.tsx"
click node_atmosphere "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/AtmosphereCanvas.tsx"
click node_skydiver "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/SkydiverCanvas.tsx"
click node_digital "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/DigitalCanvas.tsx"
click node_logo "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/MWLogo.tsx"
click node_styles "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/styles/index.css"
click node_analytics "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/Analytics.tsx"
click node_deploy "https://github.com/manidhar8008/mw-ai-cinematic/blob/main/.github/workflows/deploy.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_html,node_main,node_app,node_landing,node_styles,node_analytics toneBlue
class node_timeline,node_use_timeline,node_cinematic_scene,node_atmosphere,node_skydiver,node_digital,node_logo toneAmber
class node_deploy,node_dist toneMint
```

## Components

### Browser Application

- [HTML entry](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/index.html): Vite entry · `index.html`
- [React mount](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/main.tsx): React bootstrap · `src/main.tsx`
- [App shell](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/App.tsx): React composition · `src/app/App.tsx`
- [Landing layout](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/LandingPage.tsx): scroll document · Provides the tall scroll input and fixed viewport layout. · `src/app/LandingPage.tsx`
- [Global styles](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/styles/index.css): CSS · Defines fullscreen, responsive, font, scrollbar, and cookie presentation. · `src/styles/index.css`
- [Analytics boundary](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/Analytics.tsx): client integration · `src/app/Analytics.tsx`

### Cinematic Scene

- [Timeline model](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/timeline.ts): pure state model · Maps normalized progress to shared visual parameters and phases. · `src/app/components/CinematicScene/timeline.ts`
- [Scroll timeline hook](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/useTimeline.ts): React hook · Normalizes browser scroll position into timeline state. · `src/app/components/CinematicScene/useTimeline.ts`
- [Cinematic scene](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/index.tsx): scene orchestrator · Composes the fixed layered visual stack. · `src/app/components/CinematicScene/index.tsx`
- [Atmosphere canvas](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/AtmosphereCanvas.tsx): Canvas renderer · Draws sky, clouds, storms, lightning, and wind. · `src/app/components/CinematicScene/renderers/AtmosphereCanvas.tsx`
- [Skydiver canvas](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/SkydiverCanvas.tsx): Canvas renderer · Draws the animated subject and turbulence. · `src/app/components/CinematicScene/renderers/SkydiverCanvas.tsx`
- [Digital canvas](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/DigitalCanvas.tsx): Canvas renderer · Draws transformation grid, particles, and data effects. · `src/app/components/CinematicScene/renderers/DigitalCanvas.tsx`
- [MW logo](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/src/app/components/CinematicScene/renderers/MWLogo.tsx): DOM overlay · Reveals styled final branding from timeline state. · `src/app/components/CinematicScene/renderers/MWLogo.tsx`

### Delivery

- [Static deployment](https://github.com/manidhar8008/mw-ai-cinematic/blob/main/.github/workflows/deploy.yml): CI workflow · Builds and deploys the static production output. · `.github/workflows/deploy.yml`
- **Static dist output**: production artifact · Static files suitable for GitHub Pages or another static host.

## Connections

- HTML entry → React mount: loads
- React mount → App shell: mounts
- App shell → Landing layout: composes
- App shell → Analytics boundary: integrates
- Landing layout → Scroll timeline hook: scroll input
- Scroll timeline hook → Timeline model: normalizes scroll to
- Timeline model → Cinematic scene: shared state
- Landing layout → Cinematic scene: hosts fixed scene
- Cinematic scene → Atmosphere canvas: layers
- Cinematic scene → Skydiver canvas: layers
- Cinematic scene → Digital canvas: layers
- Cinematic scene → MW logo: layers
- Timeline model → Atmosphere canvas: visual parameters
- Timeline model → Skydiver canvas: visual parameters
- Timeline model → Digital canvas: visual parameters
- Timeline model → MW logo: reveal state
- Global styles → Landing layout: styles
- Static deployment → Static dist output: builds and publishes
