# jamesalday/ladybug architecture

> Architecture diagram of the GitHub repository jamesalday/ladybug, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jamesalday/ladybug
- Repository: https://github.com/jamesalday/ladybug

## Overview

##### Project type and purpose
- This is a **static front-end website** whose sole function is to display a countdown timer (using the FlipClock.js library) and a few content pages (about, book, sermons).
- There is no server-side application logic beyond serving static files; customization is handled entirely in the browser via URL hash parsing.

##### File structure
- Top level:
- README.md – project description and usage instructions
- HTML files – index.html (home/countdown), about.html, book.html, sermons.html
- css/ – global stylesheets (flipclock.css, style.css)
- fonts/ – custom Novecento font files + CSS to load them
- images/ – any site images (not shown but implied by folder)
- js/ – JavaScript code (app.js, snow.js) and IE‐support shims (html5.js, pie.htc, respond.js)
- No “backend” or server-side code: this is a **purely client-side** application.

##### README for additional insights
- The homepage (index.html) initializes the FlipClock countdown, defaulting to 5 days in the future or a custom number of days if the visitor appends #<n> to the URL.
- FlipClock.js is loaded via the css/flipclock.css and likely via a script tag in index.html (not shown but implied).

##### Main components and relationships
a. Client (web browser)
b. Hosting environment / Static File Server or CDN
c. Static assets grouped by type:
- HTML pages (index.html, about.html, etc)
- CSS (style.css, flipclock.css)
- JS (app.js, snow.js, IE-support scripts)
- Fonts (Novecento webfont files + novecento-font.css)
- Images
d. External library: FlipClock.js (bundled in css/js directories or loaded via CDN)
e. Optional: URL hash parameter parsing logic in app.js

→ Relationships / Data Flow:
- Browser sends HTTP GET → Static Server/CDN → returns requested asset (HTML/CSS/JS/fonts/images)
- index.html and app.js run in the browser → initialize FlipClock with default or hash-derived value → render countdown.

##### Architectural patterns and design principles
- **Static-site architecture**: separation of concerns by asset type, no dynamic pages, high cacheability.
- **Progressive enhancement / graceful degradation**: IE-support scripts ensure HTML5 and CSS features work in older browsers.
- **Modularity**: styles, scripts, fonts, and images are organized in separate folders.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Client
    subgraph "Browser (Client)"
        direction TB
        A1["index.html"]:::html --> A2["style.css"]:::css
        A1 --> A3["flipclock.css"]:::css
        A1 --> A4["app.js"]:::js
        A4 --> A5["URL Hash Parsed"]:::process
        A5 --> A6["FlipClock Initialized"]:::process
        A4 --> A7["snow.js"]:::js
        A4 --> A8["html5.js (IE Shim)"]:::js
        A4 --> A9["respond.js (IE Polyfill)"]:::js
        A4 --> A10["pie.htc (IE Behavior)"]:::js
        A6 --> A11["FlipClock.js"]:::ext
    end

    %% Server / CDN
    subgraph "Static File Server / CDN"
        direction TB
        subgraph "HTML Pages"
            direction TB
            H1["index.html"]:::html
            H2["about.html"]:::html
            H3["book.html"]:::html
            H4["sermons.html"]:::html
        end
        subgraph "CSS Assets"
            direction TB
            C1["css/style.css"]:::css
            C2["css/flipclock.css"]:::css
            C3["fonts/novecento-font.css"]:::css
        end
        subgraph "JavaScript Assets"
            direction TB
            J1["js/app.js"]:::js
            J2["js/snow.js"]:::js
            J3["js/ie-support/html5.js"]:::js
            J4["js/ie-support/respond.js"]:::js
            J5["js/ie-support/pie.htc"]:::js
        end
        subgraph "Font Files"
            direction TB
            F1["Novecentosanswide-Bold-webfont.eot"]:::asset
            F2["Novecentosanswide-Book-webfont.eot"]:::asset
            F3["Novecentosanswide-DemiBold-webfont.eot"]:::asset
            F4["Novecentosanswide-Light-webfont.eot"]:::asset
            F5["Novecentosanswide-Medium-webfont.eot"]:::asset
            F6["Novecentosanswide-Normal-webfont.eot"]:::asset
        end
        subgraph "Images"
            direction TB
            IMG["images/"]:::asset
        end
        subgraph "Docs"
            README["README.md"]:::doc
        end
    end

    %% Data Flow
    A1 -->|GET index.html| H1
    A1 -->|GET CSS| C1
    A1 -->|GET CSS| C2
    A1 -->|GET JS| J1
    A4 -->|GET FlipClock.js| A11
    H1 -->|200 OK| A1
    C1 -->|200 OK| A2
    C2 -->|200 OK| A3
    J1 -->|200 OK| A4

    %% Click Events
    click H1 "https://github.com/jamesalday/ladybug/blob/master/index.html"
    click H2 "https://github.com/jamesalday/ladybug/blob/master/about.html"
    click H3 "https://github.com/jamesalday/ladybug/blob/master/book.html"
    click H4 "https://github.com/jamesalday/ladybug/blob/master/sermons.html"
    click C1 "https://github.com/jamesalday/ladybug/blob/master/css/style.css"
    click C2 "https://github.com/jamesalday/ladybug/blob/master/css/flipclock.css"
    click J1 "https://github.com/jamesalday/ladybug/blob/master/js/app.js"
    click J2 "https://github.com/jamesalday/ladybug/blob/master/js/snow.js"
    click J3 "https://github.com/jamesalday/ladybug/blob/master/js/ie-support/html5.js"
    click J4 "https://github.com/jamesalday/ladybug/blob/master/js/ie-support/respond.js"
    click J5 "https://github.com/jamesalday/ladybug/blob/master/js/ie-support/pie.htc"
    click C3 "https://github.com/jamesalday/ladybug/blob/master/fonts/novecento-font/novecento-font.css"
    click IMG "https://github.com/jamesalday/ladybug/tree/master/images/"
    click README "https://github.com/jamesalday/ladybug/blob/master/README.md"

    %% Styles
    classDef html fill:#ccf,stroke:#339,width:150px
    classDef css fill:#ccf,stroke:#339
    classDef js fill:#cfc,stroke:#393
    classDef asset fill:#fcf,stroke:#933
    classDef doc fill:#efe,stroke:#595
    classDef ext fill:#fff,stroke:#999,stroke-dasharray: 5 5
    classDef process fill:#ffd,stroke:#dd0

    class H1,H2,H3,H4,C1,C2 html
    class J1,J2,J3,J4,J5 js
    class F1,F2,F3,F4,F5,F6,IMG asset
    class README doc
    class A11 ext
    class A5,A6 process
```
