How zamancodexpress/thaqva-masjid works
This repo is a static single-page frontend website (no backend, no build pipeline) for a mosque community site. The “system” is primarily browser-side modules that:
• render static sections (story/about/location),
• fetch prayer times from azantimes.in,
• compute and animate a countdown to next Salah,
• keep the UI bilingual (EN/ML) via a separate translation module,
• embed a Google Map.
File structure analysis (map files → components)
Top-level is the whole app; each file is a major architectural unit:
• index.html
UI shell + section layout (navbar, hero, about, countdown, prayer table, map embed). This is the DOM contract that JS modules attach to.
• style.css
• script.js
Main runtime:
• API client logic (fetch azantimes.in)
• normalization of times (12h→24h)
• countdown engine (setInterval)
• DOM rendering of table/strip/countdown
• navbar interactions + active link tracking
• GSAP + ScrollTrigger animation orchestration
• translator.js
Independent translation subsystem (IIFE module):
• language toggle UI injection
• LocalStorage persistence
• translation of static strings
• MutationObserver-based translation of dynamic prayer names after script.js renders them
• README.md
Only documentation, but it reveals the key architectural “edges”: external API, GSAP, LocalStorage, Google Maps embed.
• azantimes.in Prayer Times API (network dependency; required for live times)
• Google Maps Embed (iframe/script embed; location display)
• GSAP 3 + ScrollTrigger (animation library used by script.js)
• Google Fonts (Amiri + Inter; external asset dependency)
• Web Storage API (LocalStorage) (browser persistence for language selection)
Shows the user, the browser SPA, and external services.
Breaks the SPA into the specific modules and subcomponents (API client, countdown engine, translation module, rendering targets).
This keeps it detailed without inventing backend components that don’t exist.
UI / DOM Structure (from index.html)
• Navbar + language toggle mount point
• Hero
• About
• Countdown section (digits + upcoming prayer label)
• Prayer Times table
• Prayer strip (highlight upcoming)
• Location section (Google map embed container)
Runtime logic (from script.js)
• Prayer Times API Client
• fetch() to azantimes.in
• response parse/normalize
• Prayer Schedule Model
• canonical list of prayers + times for the day
• current/upcoming prayer identification
• Countdown Engine
• computes next prayer
• runs 1-second tick loop
• Renderer / DOM Updater
• fills prayer times table
• updates highlight states
• updates countdown digits + labels
• Navigation Controller
• hamburger menu (small screens)
• active section highlighting on scroll
• Animation Orchestrator (GSAP/ScrollTrigger)
• on-load animations
• scroll-triggered reveals
• digit transitions for countdown
Translation subsystem (from translator.js)
• Language State Manager
• current language (EN/ML)
• persistence via LocalStorage
• Translator / Dictionary
• mapping keys for static + dynamic strings
• DOM Translator
• initial translation pass for static DOM
• MutationObserver pipeline to translate dynamic nodes created/updated by script.js
• Language Toggle UI
• injected into navbar
• event handlers to switch language
User → Browser SPA
• loads index.html, style.css, script.js, translator.js
script.js → azantimes.in API
• fetch prayer times for Kozhikode North
azantimes.in API → script.js
• returns today’s schedule
script.js → DOM
• renders prayer table, strip, next prayer label, countdown digits
script.js → GSAP
• triggers animations, scroll reveals, digit transitions
translator.js ↔ LocalStorage
• read saved language on load
• write language on toggle
translator.js → DOM
• translate static content immediately
translator.js (MutationObserver) → DOM
• watches for dynamic prayer labels and translates after script.js updates
UI embedding
• index.html → Google Maps Embed
• Loads from Google as an embedded widget (iframe)
• index.html/CSS → Google Fonts
• fonts loaded from external CDN
Architectural patterns / principles to highlight
• No backend: all logic runs client-side; external API is direct from the browser.
• Module separation by responsibility:
• script.js owns data fetching + timing + rendering + animations
• translator.js is intentionally decoupled and “observes” DOM changes rather than coupling to script.js
• Reactive-ish behavior via MutationObserver:
• translation is applied post-render to dynamic content
• Time-based loop:
• countdown uses setInterval tick; recalculates next prayer dynamically
• Actor: Visitor (mobile/desktop)
• Container: Browser running “Thaqva Masjid SPA”
• External: azantimes.in API
• External: Google Maps Embed
• External: Google Fonts
• Library: GSAP/ScrollTrigger (can be shown as external dependency or “included via CDN” inside browser)
Inside “Thaqva Masjid SPA”:
• UI Shell / Sections (index.html)
• Styling (style.css)
• script.js:
• API Client
• Schedule Model
• Countdown Engine
• Renderer (Table/Strip/Countdown)
• Navigation Controller
• GSAP Animation Orchestrator
• translator.js:
• Language Toggle UI
• LocalStorage Language State
• Static Translator
• MutationObserver Dynamic Translator
• Shared: DOM (as the integration hub)
• Browser service: LocalStorage
That set of components, with the interactions described above, is “as detailed as possible” for this repo without making assumptions.