# rickycooper/parallax-pixel-art-scroll-animation architecture

> Architecture diagram of the GitHub repository rickycooper/parallax-pixel-art-scroll-animation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rickycooper/parallax-pixel-art-scroll-animation
- Repository: https://github.com/rickycooper/parallax-pixel-art-scroll-animation

## Overview

1. **Project type and scope**  
   This is a browser-only front-end project built to recreate a Firewatch-inspired parallax scrolling scene using pixel art. There is no backend, API layer, database, or server-side rendering in the repository.

2. **Core runtime and build stack**  
   The app is a **Vite + React + TypeScript** project. Vite handles local development and bundling, React provides the component model, and TypeScript adds type checking. The architecture is therefore centered on a small client-side component tree rather than multiple services.

3. **Entry and bootstrapping path**  
   The application starts from `src/main.tsx`, which mounts the React app into `index.html`. From there, the root UI is rendered through `src/App.tsx`. This is the main composition boundary for the experience.

4. **Top-level UI composition**  
   `App.tsx` is the likely orchestrator for the scrolling scene: it assembles the page structure, places the visual layers, and wires the main layout together. `src/app.module.scss` suggests the root component uses scoped styling for the overall scene and positioning.

5. **Primary visual subsystem: PixelArt**  
   The main reusable visual unit is `src/components/PixelArt/PixelArt.tsx`, backed by its own module stylesheet. This component is the natural boundary for the parallax artwork layers, likely receiving props for image source, position, or depth behavior and rendering one visual layer at a time.

6. **Parallax effect architecture**  
   The parallax effect is probably achieved in the browser by combining scroll position, layered positioning, and CSS transforms/offsets. The key architectural idea is that the scene is decomposed into independent layers that move at different rates, rather than a single flat background image.

7. **Static asset pipeline**  
   All artwork and supporting files live in `public/assets`, including fonts and a `mountains_sunset` asset set. These assets are served statically by Vite and referenced directly by the React components. That means the visual fidelity depends heavily on the public asset bundle, not runtime data.

8. **Styling boundaries**  
   The repo uses a mix of global and scoped styles: `src/index.css` for base/global rules and CSS modules like `app.module.scss` and `pixelart.module.scss` for component-local styling. This keeps the scene-specific layout isolated while still allowing shared page-level defaults.

9. **No external state or data services**  
   There is no evidence of state management libraries, routing, data fetching, or persistence. The data flow is therefore simple: static assets and component props flow into the React render tree, while scroll/input events influence visual presentation in the browser.

10. **Type and environment setup**  
   `tsconfig.json`, `tsconfig.node.json`, `src/index.d.ts`, and `src/vite-env.d.ts` indicate a standard Vite TypeScript setup with environment typing support. These files support development correctness but do not add runtime architecture.

11. **Deployment shape**  
   Because the project is purely static, the deployable unit is the built front-end bundle plus the `public` assets. Any static hosting platform would be sufficient; the repo itself does not define infrastructure beyond the Vite build.

12. **Diagram takeaway**  
   If you are drawing the architecture, the most accurate picture is: browser entrypoint → React root → `App` scene composition → reusable `PixelArt` layer components → static assets in `public/assets`, with scroll-driven visual motion happening entirely on the client side.

Main entry points: [`src/App.tsx`](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/App.tsx) (App scene), [`src/main.tsx`](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/main.tsx) (Main entry), [`src/components/PixelArt/PixelArt.tsx`](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/components/PixelArt/PixelArt.tsx) (PixelArt), [`public/assets`](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets) (Asset bundle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tooling["Tooling"]
  node_vite_config["Vite config<br/>build config<br/>[vite.config.ts]"]
  node_package_json["Package manifest<br/>deps/scripts<br/>[package.json]"]
  node_tsconfig["TypeScript config<br/>ts config<br/>[tsconfig.json]"]
  node_tsconfig_node["Node TS config<br/>[tsconfig.node.json]"]
  node_vite_env["Vite types<br/>env typing<br/>[vite-env.d.ts]"]
  node_index_dts["Global types<br/>declarations<br/>[index.d.ts]"]
end

subgraph group_runtime["App Runtime"]
  node_index_html["HTML shell<br/>entry shell<br/>[index.html]"]
  node_main_tsx(("Main entry<br/>bootstrap<br/>[main.tsx]"))
  node_app_tsx["App scene<br/>root component<br/>[App.tsx]"]
  node_app_styles["App styles<br/>scss module<br/>[app.module.scss]"]
  node_global_css["Global styles<br/>base css<br/>[index.css]"]
end

subgraph group_visuals["Visual System"]
  node_pixelart_tsx["PixelArt<br/>layer component<br/>[PixelArt.tsx]"]
  node_pixelart_styles["Layer styles<br/>scss module"]
  node_scroll_layers{{"Parallax layers<br/>scene pattern"}}
end

subgraph group_assets["Static Assets"]
  node_public_assets[("Asset bundle<br/>static public")]
  node_mountains_set["Mountain set<br/>pixel art asset set"]
  node_fonts_dir["Fonts<br/>font assets"]
end

node_index_html -->|"loads"| node_main_tsx
node_main_tsx -->|"renders"| node_app_tsx
node_app_tsx -->|"uses"| node_app_styles
node_app_tsx -->|"inherits"| node_global_css
node_app_tsx -->|"composes"| node_pixelart_tsx
node_pixelart_tsx -->|"uses"| node_pixelart_styles
node_pixelart_tsx -->|"implements"| node_scroll_layers
node_scroll_layers -->|"consumes"| node_public_assets
node_public_assets -->|"includes"| node_mountains_set
node_public_assets -->|"includes"| node_fonts_dir
node_main_tsx -->|"built by"| node_vite_config
node_vite_config -->|"driven by"| node_package_json
node_tsconfig -->|"types"| node_vite_env
node_tsconfig -->|"types"| node_index_dts
node_tsconfig_node -->|"supports"| node_vite_config

click node_index_html "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/index.html"
click node_main_tsx "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/main.tsx"
click node_app_tsx "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/App.tsx"
click node_app_styles "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/app.module.scss"
click node_global_css "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/index.css"
click node_pixelart_tsx "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/components/PixelArt/PixelArt.tsx"
click node_pixelart_styles "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/components/PixelArt/pixelart.module.scss"
click node_public_assets "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets"
click node_mountains_set "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets/mountains_sunset"
click node_fonts_dir "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets/fonts"
click node_vite_config "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/vite.config.ts"
click node_package_json "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/package.json"
click node_tsconfig "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/tsconfig.json"
click node_tsconfig_node "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/tsconfig.node.json"
click node_vite_env "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/vite-env.d.ts"
click node_index_dts "https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/index.d.ts"

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_vite_config,node_package_json,node_tsconfig,node_tsconfig_node,node_vite_env,node_index_dts toneBlue
class node_index_html,node_main_tsx,node_app_tsx,node_app_styles,node_global_css toneAmber
class node_pixelart_tsx,node_pixelart_styles,node_scroll_layers toneMint
class node_public_assets,node_mountains_set,node_fonts_dir toneRose
```

## Components

### Tooling

Vite, TypeScript, and package setup for building the client app

- [Vite config](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/vite.config.ts): build config · Development and bundling configuration · `vite.config.ts`
- [Package manifest](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/package.json): deps/scripts · Project dependencies and npm scripts · `package.json`
- [TypeScript config](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/tsconfig.json): ts config · Type-checking and compiler settings · `tsconfig.json`
- [Node TS config](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/tsconfig.node.json): ts config · TypeScript settings for build-time Node files · `tsconfig.node.json`
- [Vite types](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/vite-env.d.ts): env typing · Environment type declarations for Vite · `src/vite-env.d.ts`
- [Global types](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/index.d.ts): declarations · Additional TypeScript declarations for the app · `src/index.d.ts`

### App Runtime

Browser entry and React scene composition

- [HTML shell](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/index.html): entry shell · Browser host page that mounts the app · `index.html`
- [Main entry](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/main.tsx): bootstrap · Mounts React into the page · `src/main.tsx`
- [App scene](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/App.tsx): root component · Top-level scene composition for the parallax experience · `src/App.tsx`
- [App styles](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/app.module.scss): scss module · Scoped layout and positioning for the root scene · `src/app.module.scss`
- [Global styles](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/index.css): base css · Shared page-wide defaults and resets · `src/index.css`

### Visual System

Reusable parallax artwork components and their styling

- [PixelArt](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/components/PixelArt/PixelArt.tsx): layer component · Reusable visual layer for pixel-art scene pieces · `src/components/PixelArt/PixelArt.tsx`
- [Layer styles](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/blob/main/src/components/PixelArt/pixelart.module.scss): scss module · Component-local styles for artwork placement and transforms · `src/components/PixelArt/pixelart.module.scss`
- **Parallax layers**: scene pattern · Client-side layered motion driven by scroll position

### Static Assets

Fonts and pixel-art source assets served from public

- [Asset bundle](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets): static public · Static files served directly by Vite · `public/assets`
- [Mountain set](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets/mountains_sunset): pixel art asset set · Sunset landscape assets used in the scene · `public/assets/mountains_sunset`
- [Fonts](https://github.com/rickycooper/parallax-pixel-art-scroll-animation/tree/main/public/assets/fonts): font assets · Bundled font files for the rendered experience · `public/assets/fonts`

## Connections

- HTML shell → Main entry: loads · The HTML shell loads the Vite entry script
- Main entry → App scene: renders · Bootstraps the root React component
- App scene → App styles: uses · Root scene uses scoped layout styles
- App scene → Global styles: inherits · Scene builds on global page defaults
- App scene → PixelArt: composes · App assembles multiple artwork layers
- PixelArt → Layer styles: uses · PixelArt relies on local styling for placement
- PixelArt → Parallax layers: implements · Component participates in the layered parallax motion pattern
- Parallax layers → Asset bundle: consumes · Layers render static artwork from the public asset bundle
- Asset bundle → Mountain set: includes · Contains the sunset mountain art set
- Asset bundle → Fonts: includes · Contains bundled font files
- Main entry → Vite config: built by · Entry code is bundled through Vite
- Vite config → Package manifest: driven by · Build tooling and scripts are defined in the package manifest
- TypeScript config → Vite types: types · TypeScript setup includes Vite environment typing
- TypeScript config → Global types: types · TypeScript setup includes app declarations
- Node TS config → Vite config: supports · Node-side TypeScript settings support build tooling
