How I shipped a Nadi (BNN) astrology calculator as one 200 KB HTML file
Описание и применение
Создано автономное приложение для нади‑астрологии, которое работает из одного HTML‑файла без сети, используя встроенный движок Astronomy Engine и фиксированный смещение UTC.
Задача
Deliver a Vedic astrology tool that runs offline from a single HTML file on a phone, without any build step, npm, server, or network calls.
Результат
A fully offline, single‑file Nadi astrology calculator that runs on a phone without internet, with a final size of 206 KB.
Рабочий процесс
- 1. Inline the Astronomy Engine UMD bundle into the HTML, ensuring the Closure runtime shim ($jscomp) is included by starting the slice at byte 0.
- 2. Replace the external ephemeris and timezone APIs with local data and a fixed UTC offset selectable by the user.
- 3. Implement Nadi bond calculation by grouping planets by sign and determining leading planets based on degree order.
- 4. Compute slow‑planet progression by assigning years per sign for each planet and handling retrograde motion with fractional transitions.
- 5. Concatenate the engine and UI code into one file, test the inlined bundle in isolation, and host the final file on GitHub Pages.
- 6. Publish the source on GitHub under an MIT license for reuse.
Доказательства
The tool had to run from a single file, opened straight from disk, on a phone, with no internet.
Astronomy Engine ships as a UMD bundle. Dropping it into a <script> tag works — it detects the absence of module and define and assigns itself to window.Astronomy.
ReferenceError: $jscomp is not defined
The timezone database. A real tz database is large, and historical offsets for India alone are messy. I replaced it with a fixed UTC offset the user selects.
The whole thing is 206 KB and works on a plane.
- Дата записи: 2026-10-20T14:42:48.124Z