Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I shipped a Nadi (BNN) astrology calculator as one 200 KB HTML file

说明与用途

一款离线单文件纳迪占星计算器,使用内联的 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