From 2570372ebfc328e09a2a85df1aa7c3dcf693dd78 Mon Sep 17 00:00:00 2001 From: malonehunter Date: Thu, 28 May 2026 12:48:13 -0400 Subject: [PATCH] v2.2: progressive loading, configurable default loadout, 11 new ciphers - Progressive db loading: db_lite.json fast first paint -> full db.json swaps in - 11 new ciphers from Alektryon's fork (AGPLv3): polygonal family (Pentagonal..Decagonal), English Qabalah 31, Mars Kamea, Angelic, Bacon Standard/R Standard -> 95 total (80 English) - Configurable defaultEnabledCiphers + built-in Alphanumeric category + Base preset - Default match mode -> Same Cipher Match; breakCipher -> Ordinal; base-4-first order - Desktop keyboard nav for results modal; db cache-busting (databaseVersion ?v=N) - generate_db_json emits db_lite.json; CHANGELOG/README updated - db.json + db_lite.json ship as Release assets (gitignored) Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 32 ++ README.md | 18 +- calc/calc.js | 62 +++- calc/ciphers.js | 616 ++++++++++++++++++++++---------------- calc/database.js | 61 +++- calc/init-variables.js | 19 +- calc/styles.css | 19 ++ config.default.js | 10 +- index.html | 48 +-- tools/generate_db_json.py | 31 ++ 10 files changed, 605 insertions(+), 311 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd6292..58bd049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## v2.2 — Progressive Loading, Curated Default Loadout & 11 New Ciphers + +### Added +- **Progressive database loading**: a small `db_lite.json` (the default cipher set) loads + first for a ~2s first paint with immediate matching, then the full `db.json` streams in and + swaps in the background — the full cipher set no longer gates first-paint time. +- **11 new ciphers** ported from Alektryon's fork (AGPLv3, attributed): the polygonal family + (Pentagonal, Hexagonal, Heptagonal, Octagonal, Enneagonal, Decagonal), English Qabalah 31, + Mars Kamea Gematria, Angelic Gematria, and Bacon Standard / Bacon R Standard — **now 95 + ciphers (80 English-applicable)**. +- **Configurable default loadout** — `config.js` `defaultEnabledCiphers` sets which ciphers + are on at first load (and on "reset to defaults"); empty/omitted = the classic 4. +- **Built-in "Alphanumeric" category** grouping the alphanumeric family (Alphanumeric Qabbala, + Synx, Alphanumeric Case Sensitive, Alphanumeric Primes/Trigonal/Squares/Halves). +- **"Base" preset** button (the classic 4) in the Cyphers menu. +- **Keyboard navigation** for the results modal (desktop): ↑/↓ page, ←/→ minimize/restore; + typing snaps focus back to the phrase box. +- **db cache-busting** — `config.js` `databaseVersion` appends `?v=N` to the db fetch so an + updated database isn't served stale from browser cache. + +### Changed +- **Default match mode is now "Same Cipher Match"** (was "Cross Cipher Match") — tighter, more + relevant results, especially with a larger default loadout. +- Cipher menu/grid order: the base four lead. + +### Fixed +- Breakdown viewer defaulted to the stale name "English Ordinal" (renamed in v2.1) and opened + on the wrong cipher — now defaults to "Ordinal". + +### Tools +- `tools/generate_db_json.py` emits `db_lite.json` (the lite subset) alongside `db.json`. + ## v2.1 — Database Restoration & Bug Fixes ### Added diff --git a/README.md b/README.md index 9924e73..180bbe2 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ var CALC_CONFIG = { ], // Custom cipher category groupings customCategories: [ - { name: "CCRU", ciphers: ["Alphanumeric Qabbala", "Synx", "Keypad"] }, + { name: "Favorites", ciphers: ["Ordinal", "Reduction", "Alphanumeric Qabbala"] }, ], // See config.default.js for all options }; @@ -66,14 +66,14 @@ git pull origin master - ~7.7k recovered Thelemic/Hermetic terms (CCRU/Numogram, Crowley, Rosicrucian) - See [CHANGELOG.md](CHANGELOG.md) for the full v2.1 breakdown -### Pre-computed Mode (instant matching) +### Pre-computed Mode (instant matching + progressive loading) -Out of the box the calculator runs in **live mode** — it loads `db.txt` and computes cipher values on the fly (works immediately, ~2-5s per query). For **instant matching** (~100ms), use the pre-computed `db.json`: +Out of the box the calculator runs in **live mode** — it loads `db.txt` and computes cipher values on the fly (works immediately, ~2-5s per query). For **instant matching** (~100ms), use the pre-computed JSON: -- **Download** the prebuilt `db.json` from the [latest release](https://github.com/malonehunter/hyperdope-gematria/releases/latest) and drop it next to `index.html`, **or** -- **Rebuild** it from `db.txt`: `python3 tools/generate_db_json.py db.txt db.json` +- **Download** the prebuilt **`db.json` and `db_lite.json`** from the [latest release](https://github.com/malonehunter/hyperdope-gematria/releases/latest) and drop them next to `index.html`, **or** +- **Rebuild** both from `db.txt`: `python3 tools/generate_db_json.py db.txt db.json` (emits `db.json` + `db_lite.json`). -The calculator auto-detects `db.json` (tries it first, falls back to `db.txt`) — see `databaseMode` in `config.js` (default `"auto"`). No code changes needed. +With both present, the calculator **loads progressively**: `db_lite.json` (the default ciphers) paints in ~2s with immediate matching, then the full `db.json` streams in and swaps in the background. It auto-detects them (see `databaseMode` / `databaseLiteJsonUrl` in `config.js`). Bump `databaseVersion` in `config.js` whenever you update the databases to cache-bust browsers. ### Adding Entries @@ -81,8 +81,10 @@ Append phrases as new lines to `db.txt`. File must start with `CREATE_GEMATRO_DB ## Features -- 85 ciphers (69 English + Hebrew, Greek, Arabic, Russian) -- Pre-computed instant matching via db.json +- 95 ciphers (80 English-applicable + Hebrew, Greek, Arabic, Russian) +- Progressive pre-computed matching (fast lite first paint, full set in the background) +- Configurable default cipher loadout + Base/Default/All presets +- Desktop keyboard nav for the results modal (arrows page / minimize) - Auto-match on Enter (configurable toggle) - Escape closes modal / clears filter - Mobile optimized (keyboard dismisses, touch minimize) diff --git a/calc/calc.js b/calc/calc.js index 5f65cde..56726ac 100644 --- a/calc/calc.js +++ b/calc/calc.js @@ -51,8 +51,8 @@ var optGemSubstitutionMode = true; // simple substitution of characters with cor var optGemMultCharPos = false; // value of each character is multiplied by character index var optGemMultCharPosReverse = false; // value of each character is multiplied by character index in reverse order -var optFiltSameCipherMatch = false; // filter shows only phrases that match in the same cipher -var optFiltCrossCipherMatch = true; // filter shows only ciphers that have matching values +var optFiltSameCipherMatch = true; // DEFAULT: only phrases matching in the SAME cipher (tighter, more meaningful results) +var optFiltCrossCipherMatch = false; // phrases sharing a value across ANY enabled cipher (broader, noisier) var alphaHlt = 0.15; // opacity for values that do not match - change value here and in conf_SOM() var optAllowPhraseComments = true; // allow phrase comments, text inside [...] is not evaluated @@ -259,18 +259,20 @@ function createCiphersMenu() { o += '