# profkarim22/birthday-gift-webapp architecture

> Architecture diagram of the GitHub repository profkarim22/birthday-gift-webapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/profkarim22/birthday-gift-webapp
- Repository: https://github.com/profkarim22/birthday-gift-webapp

## Overview

This is a browser-based birthday greeting: a visitor starts an animated countdown, opens an envelope, advances through photo slides, and reaches a heart-shaped photo collage and closing message. The runtime is concentrated in script.js, which also handles ambient visuals and audio. The excerpts show the interaction hooks, slideshow-to-collage transition, and media-loading support; the README is empty, and index.html and style.css were not sampled, so their wiring is not represented.

Main entry points: [`script.js`](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js) (Interaction runtime), [`Cards_Photos`](https://github.com/profkarim22/birthday-gift-webapp/tree/main/Cards_Photos) (Card photos), [`Heart_Photos`](https://github.com/profkarim22/birthday-gift-webapp/tree/main/Heart_Photos) (Heart photos), [`Sound.mp3`](https://github.com/profkarim22/birthday-gift-webapp/blob/main/Sound.mp3) (Sound track)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Greeting experience"]
  node_runtime["Interaction runtime<br/>[script.js]"]
  node_countdown["Matrix countdown<br/>[script.js]"]
  node_envelope["Envelope interaction<br/>[script.js]"]
  node_photo_slides["Photo slideshow<br/>[script.js]"]
  node_heart_collage["Heart collage<br/>[script.js]"]
  node_closing_scene["Closing scene<br/>[script.js]"]
end

subgraph group_media["Media and ambience"]
  node_ambient_effects["Ambient effects<br/>[script.js]"]
  node_background_audio["Background audio<br/>[script.js]"]
  node_card_photos["Card photos"]
  node_heart_photos["Heart photos"]
  node_sound_track["Sound track<br/>[Sound.mp3]"]
end

node_visitor(("Visitor"))

node_visitor -->|"clicks or presses"| node_envelope
node_runtime -->|"runs sequence"| node_countdown
node_envelope -->|"advances slides"| node_photo_slides
node_photo_slides -->|"launches collage"| node_heart_collage
node_heart_collage -->|"shows message"| node_closing_scene
node_runtime -->|"creates effects"| node_ambient_effects
node_runtime -->|"initializes playback"| node_background_audio
node_background_audio -->|"tries audio candidates"| node_sound_track
node_photo_slides -->|"loads folder images"| node_card_photos
node_heart_collage -->|"loads folder images"| node_heart_photos

click node_runtime "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_countdown "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_envelope "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_photo_slides "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_heart_collage "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_closing_scene "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_ambient_effects "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_background_audio "https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js"
click node_card_photos "https://github.com/profkarim22/birthday-gift-webapp/tree/main/Cards_Photos"
click node_heart_photos "https://github.com/profkarim22/birthday-gift-webapp/tree/main/Heart_Photos"
click node_sound_track "https://github.com/profkarim22/birthday-gift-webapp/blob/main/Sound.mp3"

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_runtime,node_countdown,node_envelope,node_photo_slides,node_heart_collage,node_closing_scene toneBlue
class node_ambient_effects,node_background_audio,node_card_photos,node_heart_photos,node_sound_track toneAmber
class node_visitor toneIndigo
```

## Components

### Greeting experience

- [Interaction runtime](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Matrix countdown](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Envelope interaction](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Photo slideshow](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Heart collage](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Closing scene](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`

### Media and ambience

- [Ambient effects](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Background audio](https://github.com/profkarim22/birthday-gift-webapp/blob/main/script.js): `script.js`
- [Card photos](https://github.com/profkarim22/birthday-gift-webapp/tree/main/Cards_Photos): `Cards_Photos`
- [Heart photos](https://github.com/profkarim22/birthday-gift-webapp/tree/main/Heart_Photos): `Heart_Photos`
- [Sound track](https://github.com/profkarim22/birthday-gift-webapp/blob/main/Sound.mp3): `Sound.mp3`

### Other components

- **Visitor**

## Connections

- Visitor → Envelope interaction: clicks or presses (evidence: `script.js`)
- Interaction runtime → Matrix countdown: runs sequence (evidence: `script.js`)
- Envelope interaction → Photo slideshow: advances slides (evidence: `script.js`)
- Photo slideshow → Heart collage: launches collage (evidence: `script.js`)
- Heart collage → Closing scene: shows message (evidence: `script.js`)
- Interaction runtime → Ambient effects: creates effects (evidence: `script.js`)
- Interaction runtime → Background audio: initializes playback (evidence: `script.js`)
- Background audio → Sound track: tries audio candidates (evidence: `script.js`)
- Photo slideshow → Card photos: loads folder images (evidence: `script.js`)
- Heart collage → Heart photos: loads folder images (evidence: `script.js`)
