v2.0.0: Pre-computed matching, curated database, new UX

Database:
- 145,821 curated entries (was 153,805 raw user searches)
- Removed 13,317 junk entries (spam, gibberish, personal rants)
- Added 8,536 terms across 17 research categories (occult, theology,
  9/11, gematria, psyop, cosmology, bitcoin, AI, coronavirus, world
  affairs, economics, health, intelligence, history, politics, civil
  liberties, free speech)
- ~90% signal quality (up from ~80%)

Pre-computed matching:
- db.json with all 69 cipher values pre-calculated per entry
- Query matching in ~100ms (was 2-5 seconds in live mode)
- db.txt fallback for forks that don't need pre-computed mode
- Generate db.json: see gematria_dbs/all_ciphers.py

UX improvements:
- Enter triggers auto-match AND adds to history
- Escape closes modal, clears highlight filter
- Automatch toggle (on desktop, off mobile by default)
- Own phrase pinned to top of match results
- Modal: close button, minimize/restore, positioned below ciphers
- Mobile: keyboard dismisses after Enter, filter box hidden
- 12 results per page, phrase truncation with ellipsis
- New phrases appear at top of history list

Branding / config.js:
- Copy config.default.js to config.js to customize your fork
- Configurable: site name, logo, colors, glow, about links, credits,
  database mode, defaults, custom cipher categories
- Matrix font hover effect on logo letters
- Custom cipher categories (e.g., CCRU section for AQ/Synx/Keypad)

Acknowledgments:
- Saun-Virroco: Original Gematro creator
- NetVoid (cyphers.news): Preserved codebase & database
- Alektryon: Cipher contributions
- Database curation assisted by Claude (Anthropic)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
malonehunterandClaude Opus 4.6 committed 2026-04-02 06:40:35 -04:00
1 parent 7863d73ef7
commit 0e96c610f2
30 files changed
+8938 -16518

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
config.js
db.json
+4
View File
@@ -0,0 +1,4 @@
# Enable compression for JSON and text content
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/json text/html text/plain text/css application/javascript
</IfModule>
+149 -24
View File
@@ -33,7 +33,7 @@ var sHistory = []; // user search history (history table)
var optPhraseLimit = 5; // word limit to enter input as separate phrases, "End" key
var compactHistoryTable = false; // compact mode - vertical cipher names
var optNewPhrasesGoFirst = false; // new phrases are inserted at the beginning of history table
var optNewPhrasesGoFirst = (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.newPhrasesOnTop !== undefined) ? CALC_CONFIG.newPhrasesOnTop : true;
var optCompactCiphCount = 8; // compact mode threshold
var optLoadUserHistCiphers = true; // load ciphers when CSV file is imported
@@ -58,7 +58,7 @@ var alphaHlt = 0.15; // opacity for values that do not match - change value here
var optAllowPhraseComments = true; // allow phrase comments, text inside [...] is not evaluated
var liveDatabaseMode = true; // live database mode
var dbPageItems = 15; // number of phrases in one section
var dbPageItems = (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.resultsPerPage) ? CALC_CONFIG.resultsPerPage : 12;
var dbScrollItems = 1; // used for scrolling
var optGradientCharts = true; // gradient fill for breakdown/cipher charts
@@ -146,7 +146,8 @@ function initCalc(defSet = false) {
createCalcMenus();
enableDefaultCiphers();
saveCalcSettingsLocalStorage(true); // save default settings
showWelcomeMessage("hyper calc");
var welcomeMsg = (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.welcomeMessage) ? CALC_CONFIG.welcomeMessage : "loading cypher database...";
showWelcomeMessage(welcomeMsg);
}
var welcomeShown = false;
@@ -177,7 +178,7 @@ function configureCalcInterface(initRun = false) {
optCompactCiphCount = 4;
chLimit = 17; // character limit, used to switch to a long breakdown style
maxRowWidth = 20; // one row character limit (long breakdown)
$("#queryDBbtn").val("Q"); // change Query button label
$("#queryDBbtn").val("\uD83D\uDD2E"); // 🔮 crystal ball on mobile
} else {
// desktop
encodingMenuColumns = 4;
@@ -186,7 +187,7 @@ function configureCalcInterface(initRun = false) {
optCompactCiphCount = 8;
chLimit = 30; // character limit, used to switch to a long breakdown style
maxRowWidth = 36; // one row character limit (long breakdown)
$("#queryDBbtn").val("Query"); // change Query button label
$("#queryDBbtn").val("\uD83D\uDD2E Query"); // 🔮 Query on desktop
}
if (optForceTwoColumnLayout && $(window).width() > compactViewportWidth) {
// override layout for desktop
@@ -295,7 +296,71 @@ function createCiphersMenu() {
displayCipherCatDetailed(cCat[0]); // open first available category
}
// Auto-match state — read from config, fallback to desktop=on mobile=off
var autoMatchEnabled = (typeof CALC_CONFIG !== 'undefined')
? (navigator.maxTouchPoints > 0 ? CALC_CONFIG.autoMatchMobile : CALC_CONFIG.autoMatchDesktop)
: (navigator.maxTouchPoints <= 1);
// Add phrase to list only (↵ button) — update modal only if already open and maximized
function addPhraseOnly() {
var phr = sVal();
if (phr == "") return;
// If modal is open AND not minimized, refresh it with new query
var qa = document.getElementById("queryArea");
if (qa && !$("#queryArea").hasClass("minimizeQuery")) {
queryDatabase();
}
// Add to history
if (optNewPhrasesGoFirst) {
addPhraseToHistoryUnshift(phr, true);
} else {
addPhraseToHistory(phr, true);
}
document.getElementById("phraseBox").value = "";
document.getElementById("phraseBox").focus();
}
function toggleAutoMatch() {
autoMatchEnabled = !autoMatchEnabled;
var btn = document.getElementById("autoMatchBtn");
if (autoMatchEnabled) {
btn.classList.remove("matchOff");
btn.title = "Auto-match ON — click to disable";
} else {
btn.classList.add("matchOff");
btn.title = "Auto-match OFF — click to enable";
}
document.getElementById("phraseBox").focus();
}
$(document).ready(function () {
// Global Escape key handler
$(document).on("keydown", function(e) {
if (e.keyCode === 27 || e.key === "Escape") {
// If highlight filter has content, clear it first
var hBox = document.getElementById("highlightBox");
if (hBox && hBox.value !== "") {
if (typeof userOpenCiphers !== 'undefined' && userOpenCiphers.length > 0) {
removeActiveFilter(); // Enter was pressed, do full restore
} else {
// Just typed numbers without Enter — clear highlights
$("#clearFilterButton").html("");
hBox.value = "";
freq = [];
autoHistoryTableLayout();
updateHistoryTable();
}
document.getElementById("phraseBox").focus();
return;
}
// Otherwise close matches modal
if (document.getElementById("queryArea") !== null) {
clearDatabaseQueryTable();
document.getElementById("phraseBox").focus();
}
}
});
$("body").on("mouseover", ".ciphCatButton", function () {
// mouse over cipher category button
displayCipherCatDetailed($(this).val());
@@ -319,9 +384,22 @@ function displayCipherCatDetailed(curCat) {
'&quot;)">';
o += '<div style="padding: 0.25em;"></div>';
}
// Check if this is a custom config category
var customCipherNames = null;
if (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.customCategories) {
for (var cc = 0; cc < CALC_CONFIG.customCategories.length; cc++) {
if (CALC_CONFIG.customCategories[cc].name === curCat) {
customCipherNames = CALC_CONFIG.customCategories[cc].ciphers;
break;
}
}
}
o += '<table class="cipherCatDetails"><tbody>';
for (i = 0; i < cipherList.length; i++) {
if (cipherList[i].cipherCategory == curCat) {
var inCategory = customCipherNames
? (customCipherNames.indexOf(cipherList[i].cipherName) !== -1)
: (cipherList[i].cipherCategory == curCat);
if (inCategory) {
if (cipherList[i].enabled) {
chk = " checked";
} else {
@@ -346,33 +424,49 @@ function displayCipherCatDetailed(curCat) {
// =========================== About Menu ===========================
function createAboutMenu() {
// create menu with all cipher catergories
var o = document.getElementById("calcOptionsPanel").innerHTML;
var c = (typeof CALC_CONFIG !== 'undefined') ? CALC_CONFIG : {};
o += '<div class="dropdown">';
o += '<button class="dropbtn">About</button>';
o += '<div class="dropdown-content dropdown-about">';
// o += '<center><div class="gematroLogo">'+gematroSvgLogo()+'</div>'
// o += '</center>'
// o += '<div style="margin: 1em;"></div>'
// o += '<input class="intBtn" type="button" value="Join Discord Server" onclick="gotoDiscordServer()">'
// o += '<div style="margin: 0.5em;"></div>'
o +=
'<input class="intBtn" type="button" value="GitHub Repository" onclick="gotoGitHubRepo()">';
// About links from config
if (c.aboutLinks && c.aboutLinks.length > 0) {
for (var i = 0; i < c.aboutLinks.length; i++) {
var link = c.aboutLinks[i];
o += '<input class="intBtn" type="button" value="' + link.text + '" onclick="window.open(\'' + link.url + '\', \'_blank\')">';
o += '<div style="margin: 0.5em;"></div>';
o +=
'<input class="intBtn" type="button" value="Quickstart Guide" onclick="displayQuickstartGuide()">';
// o += '<div style="margin: 0.5em;"></div>'
// o += '<input class="intBtn" type="button" value="Contacts" onclick="displayContactInfo()">'
}
} else {
o += '<input class="intBtn" type="button" value="GitHub Repository" onclick="gotoGitHubRepo()">';
o += '<div style="margin: 0.5em;"></div>';
}
o += '<input class="intBtn" type="button" value="Quickstart Guide" onclick="displayQuickstartGuide()">';
// Credits from config
if (c.credits && c.credits.length > 0) {
o += '<div style="margin: 0.8em;"></div>';
o += '<div style="font-size: 80%; color: var(--font-white-2); padding: 0 0.5em;">';
for (var j = 0; j < c.credits.length; j++) {
var cr = c.credits[j];
if (cr.url) {
o += '<div style="margin: 0.3em 0;"><a href="' + cr.url + '" target="_blank" style="color: var(--font-white-1); text-decoration: none;">' + cr.name + '</a> — ' + cr.role + '</div>';
} else {
o += '<div style="margin: 0.3em 0;">' + cr.name + ' — ' + cr.role + '</div>';
}
}
o += '</div>';
}
o += "</div></div>";
document.getElementById("calcOptionsPanel").innerHTML = o;
}
function gotoGitHubRepo() {
window.open("https://github.com/malonehunter/hyperdope-gematria", "_blank");
var url = (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.githubUrl) ? CALC_CONFIG.githubUrl : "https://github.com/malonehunter/hyperdope-gematria";
window.open(url, "_blank");
}
function gotoDiscordServer() {
@@ -1408,6 +1502,13 @@ function initCiphers(updDefCiph = true) {
if (cipherList[i].enabled && updDefCiph)
defaultCipherArray.push(cipherList[i].cipherName); // update default ciphers
}
// Add custom categories from config
if (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.customCategories) {
for (var cc = 0; cc < CALC_CONFIG.customCategories.length; cc++) {
var catName = CALC_CONFIG.customCategories[cc].name;
if (cCat.indexOf(catName) == -1) cCat.push(catName);
}
}
if (defaultCipherArraySaved.length == 0)
defaultCipherArraySaved = [...defaultCipherArray]; // copy of initial default ciphers
initColorArrays();
@@ -1486,15 +1587,27 @@ function disableAllCiphers() {
function toggleCipherCategory(ciph_cat) {
prevCiphIndex = -1; // reset cipher selection
// Check if custom config category
var customNames = null;
if (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.customCategories) {
for (var cc = 0; cc < CALC_CONFIG.customCategories.length; cc++) {
if (CALC_CONFIG.customCategories[cc].name === ciph_cat) {
customNames = CALC_CONFIG.customCategories[cc].ciphers;
break;
}
}
}
function _inCat(ci) {
return customNames ? (customNames.indexOf(ci.cipherName) !== -1) : (ci.cipherCategory == ciph_cat);
}
var on_first = false;
for (i = 0; i < cipherList.length; i++) {
if (cipherList[i].cipherCategory == ciph_cat && !cipherList[i].enabled)
on_first = true; // if one cipher is disabled
if (_inCat(cipherList[i]) && !cipherList[i].enabled)
on_first = true;
}
var cur_chkbox;
for (i = 0; i < cipherList.length; i++) {
//console.log(cipherList[i].cipherCategory)
if (cipherList[i].cipherCategory == ciph_cat) {
if (_inCat(cipherList[i])) {
cur_chkbox = document.getElementById("cipher_chkbox" + i);
if (on_first) {
// if one cipher is disabled, first enable all
@@ -1824,6 +1937,11 @@ function phraseBoxKeypress(e) {
e // keypress event
) {
case 13: // Enter, Go (Android)
if (phr == "") break; // skip empty input
// Auto-query on Enter if database is loaded and automatch is enabled
if ((userDB.length > 0 || userDBlive.length > 0) && autoMatchEnabled) {
queryDatabase(); // run match query BEFORE clearing input
}
if (!optNewPhrasesGoFirst) {
addPhraseToHistory(phr, true);
} // enter as single phrase
@@ -1831,6 +1949,13 @@ function phraseBoxKeypress(e) {
addPhraseToHistoryUnshift(phr, true);
} // insert in the beginning
pBox.value = ""; // clear textbox on Enter
// On mobile, blur input to dismiss keyboard so user can see results
if (navigator.maxTouchPoints > 0) pBox.blur();
break;
case 27: // Escape - close matches modal
if (document.getElementById("queryArea") !== null) {
clearDatabaseQueryTable();
}
break;
case 38: // Up Arrow
if (sHistory.length > 0) {
+82 -10
View File
@@ -12,6 +12,18 @@ function queryDatabase() {
var o = '<div id="queryArea"></div>'
$(o).appendTo('body');
}
// Position modal below the enabled cipher table (the Ordinal/Reduction values box)
var ciphTable = document.getElementById("enabledCiphTable");
if (ciphTable && ciphTable.getBoundingClientRect().height > 0) {
var ciphBottom = ciphTable.getBoundingClientRect().bottom + window.scrollY;
document.getElementById("queryArea").style.top = (ciphBottom + 4) + "px";
} else {
var inputEl = document.getElementById("inputArea");
if (inputEl) {
var inputBottom = inputEl.getBoundingClientRect().bottom + window.scrollY;
document.getElementById("queryArea").style.top = (inputBottom + 4) + "px";
}
}
mArr = [] // array with matching phrases from database
gemArr = [] // gematria of current phrase for enabled ciphers
@@ -71,7 +83,9 @@ function searchDBcrossCipher() { // populate "queryResult" array with matching p
var tmpArr = [] // one phrase with score and gematria
var tmpVal = 0 // current phrase value
var gemArrCiphUsed = [...gemArrCiph]
if (liveDatabaseMode == true) { // 0,1,2...
if (cipherOrder.length > 0 && !liveDatabaseMode) { // pre-computed mode
gemArrCiphUsed = getPrecomputedCipherPositions()
} else if (liveDatabaseMode == true) { // live mode: 0,1,2...
len = gemArrCiph.length
gemArrCiphUsed = []
for (n = 0; n < len; n++) {
@@ -98,8 +112,14 @@ function searchDBcrossCipher() { // populate "queryResult" array with matching p
}
if (tmpArr[0] > 0) queryResult.push(tmpArr) // if total score is more than zero, add phrase to array
}
queryResult.sort(function(a, b) { // sort by score (descending)
return b[0] - a[0]; // sort based on index 0 values ("freq" is array of arrays), (b-a) descending order, (a-b) ascending
// Sort by score descending, but pin exact phrase match to top
var searchPhrase = sVal().toLowerCase()
queryResult.sort(function(a, b) {
// Exact phrase match always first
var aExact = a[1].toLowerCase() === searchPhrase ? 1 : 0
var bExact = b[1].toLowerCase() === searchPhrase ? 1 : 0
if (aExact !== bExact) return bExact - aExact
return b[0] - a[0]; // then by score descending
});
}
@@ -109,7 +129,9 @@ function searchDBsameCipher() { // populate "queryResult" array with matching ph
var tmpArr = [] // one phrase with score and gematria
var tmpVal = 0 // current phrase value
var gemArrCiphUsed = [...gemArrCiph]
if (liveDatabaseMode == true) { // 0,1,2...
if (cipherOrder.length > 0 && !liveDatabaseMode) { // pre-computed mode
gemArrCiphUsed = getPrecomputedCipherPositions()
} else if (liveDatabaseMode == true) { // live mode: 0,1,2...
len = gemArrCiph.length
gemArrCiphUsed = []
for (n = 0; n < len; n++) {
@@ -129,8 +151,13 @@ function searchDBsameCipher() { // populate "queryResult" array with matching ph
}
if (tmpArr[0] > 0) queryResult.push(tmpArr) // if total score is more than zero, add phrase to array
}
queryResult.sort(function(a, b) { // sort by score (descending)
return b[0] - a[0]; // sort based on index 0 values ("freq" is array of arrays), (b-a) descending order, (a-b) ascending
// Sort by score descending, but pin exact phrase match to top
var searchPhrase = sVal().toLowerCase()
queryResult.sort(function(a, b) {
var aExact = a[1].toLowerCase() === searchPhrase ? 1 : 0
var bExact = b[1].toLowerCase() === searchPhrase ? 1 : 0
if (aExact !== bExact) return bExact - aExact
return b[0] - a[0];
});
}
@@ -183,8 +210,10 @@ function updateDatabaseQueryTable(stPos = 0, dItems, scrollBarEvent = false) { /
sliderMax = Math.floor(queryResult.length/dbPageItems)
if (queryResult.length % dbPageItems == 0) sliderMax -= 1 // if total is divisible, no pagination for last element
curSliderPos = Math.round(curPos/dbPageItems)
ms = '<span class="minimizeLabel">Click to minimize</span>'
ms += '<div id="queryMinBtn">_</div>' // minimize button
ms = '<div id="queryHeaderBar" style="cursor:pointer;">'
ms += '<div id="queryCloseBtn" onclick="event.stopPropagation();clearDatabaseQueryTable()" title="Close">&times;</div>'
ms += '<div id="queryMinBtn">_</div>'
ms += '</div>'
ms += '<input type="range" min="0" max="'+sliderMax+'" value="'+curSliderPos+'" class="qSlider" id="queryScrollbar">' // slider/scrollbar
ms += '<input id="querySearchInput" type="text" spellcheck="false" autocomplete="off" value="'+searchBarValue+'" placeholder="Find...">' // search bar
ms += '<table id="QueryTable" class="HistoryTable" data-startpos='+stPos+' data-dispitems='+dItems+'>'
@@ -237,7 +266,8 @@ function updateDatabaseQueryTable(stPos = 0, dItems, scrollBarEvent = false) { /
} else {
dispPhrase = (encodingMenuOpened) ? queryResult[x] : queryResult[x][1]
}
ms += '<tr><td class="hPQ" data-ind="'+x+'">' + dispPhrase + '</td>' // phrase at index 1
var fullPhrase = (encodingMenuOpened) ? queryResult[x] : queryResult[x][1]
ms += '<tr><td class="hPQ" data-ind="'+x+'" title="'+fullPhrase.replace(/"/g, '&quot;')+'">' + dispPhrase + '</td>' // phrase at index 1
valPos = 2 // reset position for new phrase
for (y = 0; y < gemArrCiph.length; y++) { // gemArrCiph contains indices of ciphers used for query
@@ -276,7 +306,8 @@ function updateDatabaseQueryTable(stPos = 0, dItems, scrollBarEvent = false) { /
document.getElementById("queryArea").innerHTML = ms
}
if (navigator.maxTouchPoints <= 1 && !scrollBarEvent) { // ignore scrollbar event
if (document.getElementById("queryPosInput") !== null) document.getElementById("queryPosInput").focus() // restore focus on desktop devices
// Return focus to main phrase box so user can immediately type next query
document.getElementById("phraseBox").focus()
}
}
@@ -381,6 +412,47 @@ function unloadDatabase() {
return
}
// ============================ Pre-computed Database ============================
var cipherOrder = [] // cipher names in order of db.json columns
function loadPrecomputedDB(data) {
cipherOrder = data.cipher_order
userDB = data.data // already [phrase, v1, v2, ..., v69]
precalcDBLoaded = true
liveDatabaseMode = false
// DO NOT lock ciphers — all 69 values present in every row
$("#queryDBbtn").removeClass("hideValue")
$("#clearDBqueryBtn").removeClass("hideValue")
$("#unloadDBBtn").removeClass("hideValue")
$("#btn-export-db-query").removeClass("hideValue")
$("#liveDBOption").addClass("hideValue")
closeAllOpenedMenus()
console.log("Pre-computed Database loaded! (" + userDB.length + " entries, " + cipherOrder.length + " ciphers)")
var loadedMsg = (typeof CALC_CONFIG !== 'undefined' && CALC_CONFIG.loadedMessage)
? CALC_CONFIG.loadedMessage.replace("{count}", userDB.length.toLocaleString('en')).replace("{ciphers}", cipherOrder.length)
: userDB.length.toLocaleString('en') + " entries × " + cipherOrder.length + " cyphers ready";
displayCalcNotification(loadedMsg, 2500)
}
function getPrecomputedCipherPositions() {
// Map enabled cipher names to their column indices in db.json
// Returns 0-based indices into cipher_order (NOT +1 adjusted)
// because searchDBcrossCipher/sameCipher already add +1 when accessing userDB
var positions = []
for (var i = 0; i < cipherList.length; i++) {
if (cipherList[i].enabled) {
var pos = cipherOrder.indexOf(cipherList[i].cipherName)
if (pos > -1) positions.push(pos) // 0-based; search functions add +1
}
}
return positions
}
// ============================ Live Database ============================
function calcLiveDatabase(arr) {
var i, n
var tmpArr = []
+1 -1
View File
@@ -52,7 +52,7 @@ function importFileAction(file, hasLocalFile) {
uCiph = userHist[0].split(";") // table header to array (user ciphers from CSV), semicolon separator
// detect database export mode
if (uCiph[0] == "CREATE_GEMATRO_DB") {
if (uCiph[0] == "CREATE_GEMATRO_DB" || uCiph[0] == "HYPER_CYPHERS") {
userHist.splice(0,1) // remove the first line
if (liveDatabaseMode == false) { // precompiled database mode
expCiphers = exportCiphersDB() // export enabled ciphers
+37 -5
View File
@@ -93,7 +93,7 @@ $(document).ready(function(){
updateDatabaseQueryTable(st, n, true) // update only the table at new position
});
$("body").on("change", "#queryScrollbar", function () {
document.getElementById("queryPosInput").focus() // restore focus after using scrollbar
if (navigator.maxTouchPoints <= 1) document.getElementById("queryPosInput").focus() // restore focus after using scrollbar (desktop only)
});
// Search bar
@@ -107,9 +107,30 @@ $(document).ready(function(){
}
});
// Click on minimize button
$("body").on("click", "#queryMinBtn", function () {
$("#queryArea").toggleClass("minimizeQuery")
function toggleQueryMinimize() {
var qa = $("#queryArea");
qa.toggleClass("minimizeQuery");
var btn = document.getElementById("queryMinBtn");
if (btn) btn.textContent = qa.hasClass("minimizeQuery") ? "+" : "_";
}
// Click/tap on header bar to toggle minimize
$("body").on("click", "#queryHeaderBar", function (e) {
e.stopPropagation();
toggleQueryMinimize();
});
// Click/tap on table cells to minimize (not on interactive elements)
$("body").on("click", "#QueryTable td, #QueryTable th", function (e) {
if ($(e.target).is("input, button, a, select")) return;
if (!$("#queryArea").hasClass("minimizeQuery")) {
toggleQueryMinimize();
}
});
// Tap anywhere on the MINIMIZED modal to restore it
$("body").on("click", "#queryArea.minimizeQuery", function (e) {
toggleQueryMinimize();
});
});
@@ -443,7 +464,18 @@ $(document).ready(function(){
updateHistoryTableAutoHlt();
return; // don't update history
}
if (optFiltCrossCipherMatch) { autoHistoryTableLayout(); updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
if (document.getElementById("highlightBox").value === "") {
// Backspaced to empty — clear highlights
if (userOpenCiphers.length > 0) {
removeActiveFilter(); // filter was applied via Enter, do full restore
} else {
// Just typed numbers without Enter — simply update table without highlights
$("#clearFilterButton").html("");
freq = [];
autoHistoryTableLayout();
updateHistoryTable();
}
} else if (optFiltCrossCipherMatch) { autoHistoryTableLayout(); updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
});
$("body").on("click", "td.hC", function () { // Cipher Name in history table (normal mode)
+65 -20
View File
@@ -284,14 +284,11 @@ body {
fill: var(--font-white-2) !important;
}
.splitInterface {
text-align: center; /* maintain centering when modal is open */
}
@media (min-width: 911px) {
/* desktop */
/* desktop — modal overlays instead of pushing content */
.splitInterface {
width: 70%;
position: absolute;
top: 0;
right: 0;
overflow: auto;
height: 100%;
}
@@ -714,9 +711,9 @@ body {
#phraseBox {
width: 300px;
}
#highlightBox {
width: none;
max-width: 100px;
#highlightBox,
#clearFilterButton {
display: none !important; /* hide filter input on mobile — gains space */
}
}
@media (min-width: 911px) {
@@ -728,8 +725,11 @@ body {
width: 500px;
}
#highlightBox {
width: 200px;
max-width: 200px;
width: 120px;
max-width: 120px;
}
#highlightBox::placeholder {
font-size: 75%;
}
}
#phraseBox:focus,
@@ -835,6 +835,15 @@ body {
text-align: right;
padding: 0em 0.5em 0em 0.5em;
font-size: 110%;
max-width: 150px; /* desktop: keep modal narrow */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@media (max-width: 911px) {
.hPQ {
max-width: 300px; /* mobile: full-width overlay has room */
}
}
.mP,
.mPQ {
@@ -995,7 +1004,8 @@ body {
margin: 0em 0.3em;
width: 75px;
}
#enterPhraseBtn {
#enterPhraseBtn,
#autoMatchBtn {
background-color: var(--input-bg-accent);
padding: 0em;
margin: 0em 0em 0em 0.3em;
@@ -1003,6 +1013,9 @@ body {
max-width: 30px;
color: var(--border-accent);
}
#autoMatchBtn.matchOff {
opacity: 0.35;
}
#calcNotification {
position: absolute;
left: 50%;
@@ -1024,6 +1037,7 @@ body {
.intBtnResetDate:hover,
#queryDBbtn:hover,
#enterPhraseBtn:hover,
#autoMatchBtn:hover,
.queryPageBtn:hover {
background-color: var(--btn-hover-accent);
}
@@ -1034,6 +1048,7 @@ body {
.intBtnResetDate:active,
#queryDBbtn:active,
#enterPhraseBtn:active,
#autoMatchBtn:active,
.queryPageBtn:active {
background-color: var(--btn-active-accent);
}
@@ -1550,18 +1565,25 @@ body {
width: 30%;
position: absolute;
/* border-right: 1px solid var(--border-accent); */
top: 45px;
left: 100px;
top: 80px; /* fallback, overridden dynamically by queryDatabase() */
left: 5px;
overflow: auto;
max-height: 92%;
border: 1px solid var(--border-accent);
/* background-color: var(--query-bg-accent); */
background-color: var(--menu-bg-accent);
resize: horizontal;
z-index: 100;
}
@media (max-width: 911px) {
/* mobile */
/* mobile — center the modal */
#queryArea {
left: 40px !important;
left: 2.5% !important;
width: 95% !important;
max-width: 480px;
}
#queryArea.minimizeQuery {
transform: translate(calc(-100% + 30px), 0) !important;
min-height: 60px;
}
}
.queryPageBtn {
@@ -1588,6 +1610,28 @@ body {
#queryMinBtn:hover {
background-color: var(--btn-bg-accent);
}
#queryCloseBtn {
position: absolute;
width: 24px;
left: 0;
height: 24px;
text-align: center;
box-sizing: border-box;
color: var(--border-accent);
background: var(--hist-header-gradient);
border: 1px solid var(--border-accent);
border-bottom: 2px solid var(--border-accent);
cursor: pointer;
user-select: none;
font-size: 120%;
line-height: 20px;
}
#queryCloseBtn:hover {
background-color: var(--btn-bg-accent);
}
#queryCloseBtn:active {
background-color: var(--btn-hover-accent);
}
#queryMinBtn:active {
background-color: var(--btn-hover-accent);
}
@@ -1597,11 +1641,11 @@ body {
}
.qSlider {
-webkit-appearance: none;
width: calc(100% - 24px);
width: calc(100% - 48px); /* 24px close btn left + 24px minimize btn right */
height: 24px;
background: var(--hist-header-gradient);
outline: none;
margin: 0;
margin: 0 0 0 24px; /* push right of close button */
border: 1px solid var(--border-accent);
border-bottom: 2px solid var(--border-accent);
display: block;
@@ -1658,12 +1702,13 @@ body {
.minimizeQuery {
resize: none !important;
transition: 0.2s;
transform: translate(calc(-87% - 100px), 0);
transform: translate(calc(-100% + 30px), 0); /* slide left, leave 30px visible */
}
@media (max-width: 911px) {
/* mobile */
.minimizeQuery {
transform: translate(calc(-87% - 40px), 0) !important;
transform: translate(calc(-100% + 30px), 0) !important; /* same: leave 30px tab visible */
min-height: 60px; /* larger tap target when minimized */
}
}
.minimizeLabel {
+59
View File
@@ -0,0 +1,59 @@
// =====================================================================
// Cypher Calculator Configuration (Default / Opensource)
// Copy this file to config.js and customize for your site.
// =====================================================================
var CALC_CONFIG = {
// --- Branding ---
siteName: "Cypher Calculator", // logo text
siteTitle: "Cypher Calculator — Gematria", // browser tab title
logoColor: "hsl(148, 60%, 45%)", // green (match code rain)
logoGlow: "0 0 8px rgba(0,255,65,0.3), 0 0 16px rgba(0,255,65,0.15)",
logoHoverMatrix: true, // flip letters to matrix font on hover
faviconUrl: "res/favicon.png",
// --- Messages ---
welcomeMessage: "loading cypher database...",
loadedMessage: "{count} entries × {ciphers} cyphers ready",
// --- Links ---
siteUrl: "",
githubUrl: "https://github.com/malonehunter/hyperdope-gematria",
aboutLinks: [
// Add your own links here:
// { text: "My Site", url: "https://example.com" },
{ text: "GitHub", url: "https://github.com/malonehunter/hyperdope-gematria" },
],
// --- Credits ---
credits: [
{ name: "Saun-Virroco", role: "Original Gematro creator" },
{ name: "NetVoid", url: "https://cyphers.news/", role: "Preserved codebase & database" },
{ name: "Alektryon", url: "https://github.com/Alektryon", role: "Cipher contributions" },
{ name: "Hyperdope", url: "https://hyperdope.com", role: "Database overhaul & v2 architecture" },
],
// --- Database ---
databaseMode: "auto", // "auto" tries db.json then db.txt | "json" | "txt"
databaseJsonUrl: "db.json",
databaseTxtUrl: "db.txt",
// --- Defaults ---
autoMatchDesktop: true,
autoMatchMobile: false,
resultsPerPage: 12,
newPhrasesOnTop: true,
// --- Custom Cipher Categories ---
// Group ciphers into custom menu sections. Ciphers are referenced by
// their exact name from ciphers.js. They still appear in their original
// category too — custom categories are convenience shortcuts.
customCategories: [
// Example: CCRU section for Anglossic Qabbala research
// {
// name: "CCRU",
// ciphers: ["Alphanumeric Qabbala", "Synx", "Keypad"]
// },
],
};
+8443 -16427
View File
File diff suppressed because it is too large. Load diff
+96 -31
View File
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<head>
<title>Cypher Calc</title>
<title>Cypher Calculator</title> <!-- updated by config.js -->
<meta charset="utf-8" />
<meta
name="viewport"
@@ -11,15 +11,16 @@
<!-- Android Web App - Add to Home Screen -->
<link rel="manifest" href="manifest.json" />
<script src="lib/jquery.min.js"></script>
<script src="config.js?v=2"></script>
<script src="lib/jquery.min.js?v=2"></script>
<!-- html2canvas v1.0.0-alpha.12 -->
<script src="calc/gematria.js"></script>
<script src="calc/calc.js"></script>
<script src="calc/init-variables.js"></script>
<script src="calc/ciphers.js"></script>
<script src="calc/gematria.js?v=2"></script>
<script src="calc/calc.js?v=2"></script>
<script src="calc/init-variables.js?v=2"></script>
<script src="calc/ciphers.js?v=2"></script>
<link rel="stylesheet" type="text/css" href="calc/styles.css" />
<link rel="stylesheet" type="text/css" href="calc/styles.css?v=2" />
<script>
window.onpaint = function () {
@@ -44,12 +45,28 @@
<div id="calcMain">
<center>
<div id="calcLogo">
<!-- Text Logo -->
<div>Hyperdope Cypher Calculator</div>
<!-- Image Logo -->
<!-- <img src="res/hypercalc_transparent.png" height="50" /> -->
<div id="logoText"></div>
<style>
.logoLetter { transition: font-family 0.1s; display: inline-block; }
.logoLetter:hover { font-family: matrix-font, monospace; color: #00ffcc; }
</style>
</div>
<script>
(function() {
var c = (typeof CALC_CONFIG !== 'undefined') ? CALC_CONFIG : {};
var name = c.siteName || "Cypher Calculator";
var color = c.logoColor || "#00ff41";
var glow = c.logoGlow || "";
var el = document.getElementById("logoText");
el.style.cssText = "color:"+color+";text-shadow:"+glow+";font-family:'Courier New',monospace;font-weight:bold;font-size:250%;letter-spacing:3px;cursor:default;";
if (c.logoHoverMatrix !== false) {
el.innerHTML = name.split("").map(function(ch){ return '<span class="logoLetter">'+ch+'</span>'; }).join("");
} else {
el.textContent = name;
}
document.title = c.siteTitle || name;
})();
</script>
</center>
<center>
@@ -60,6 +77,12 @@
<div id="dateCalcMenuArea"></div>
<div id="inputArea">
<span id="dbLoadIndicator" style="display:none;margin-right:6px;">
<svg width="22" height="22" viewBox="0 0 22 22" style="vertical-align:middle;animation:dbspin 1s linear infinite;">
<circle cx="11" cy="11" r="9" stroke="var(--font-color,#0ff)" stroke-width="2" fill="none" stroke-dasharray="40 20" stroke-linecap="round"/>
</svg>
</span>
<style>@keyframes dbspin{to{transform:rotate(360deg)}}</style>
<input
id="queryDBbtn"
class="hideValue"
@@ -74,21 +97,30 @@
spellcheck="false"
autocomplete="off"
oninput="updateEnabledCipherTable(); updateWordBreakdown(breakCipher,false,false);"
onkeydown="phraseBoxKeypress(event.keyCode)"
onkeydown="if(event.key==='Enter'){phraseBoxKeypress(13)}else{phraseBoxKeypress(event.keyCode)}"
ondrop="dropHandler(event)"
ondragover="dragOverHandler(event)"
/>
<input
id="enterPhraseBtn"
type="button"
onclick="phraseBoxKeypress(13);document.getElementById('phraseBox').focus()"
value="&#x270E;"
title="Add phrase to list"
onclick="addPhraseOnly()"
value="&#x21B5;"
/><input
id="autoMatchBtn"
class="hideValue"
type="button"
title="Auto-match ON — click to disable"
value="⚡"
onclick="toggleAutoMatch()"
/>
<input
id="highlightBox"
type="text"
spellcheck="false"
autocomplete="off"
placeholder="highlight #s"
/><span id="clearFilterButton"></span>
</div>
@@ -107,23 +139,23 @@
<span id="loadPanel"></span>
<script src="calc/breakdown.js"></script>
<script src="calc/breakdown.js?v=2"></script>
<script src="calc/highlighter.js"></script>
<script src="calc/export.js"></script>
<script src="calc/export-csv.js"></script>
<script src="calc/num-prop.js"></script>
<script src="calc/edit-ciphers.js"></script>
<script src="calc/date-calc.js"></script>
<script src="calc/database.js"></script>
<script src="calc/quick-guide.js"></script>
<script src="calc/highlighter.js?v=2"></script>
<script src="calc/export.js?v=2"></script>
<script src="calc/export-csv.js?v=2"></script>
<script src="calc/num-prop.js?v=2"></script>
<script src="calc/edit-ciphers.js?v=2"></script>
<script src="calc/date-calc.js?v=2"></script>
<script src="calc/database.js?v=2"></script>
<script src="calc/quick-guide.js?v=2"></script>
<script src="calc/localstorage.js"></script>
<script src="calc/encoding.js"></script>
<script src="calc/encoding-ciphers.js"></script>
<script src="calc/localstorage.js?v=2"></script>
<script src="calc/encoding.js?v=2"></script>
<script src="calc/encoding-ciphers.js?v=2"></script>
<script src="calc/coderain.js"></script>
<script src="lib/html2canvas.min.js"></script>
<script src="calc/coderain.js?v=2"></script>
<script src="lib/html2canvas.min.js?v=2"></script>
<!-- Initialzie the calculator. This needs to run before loading a database or theme. -->
<script>
@@ -131,11 +163,44 @@
</script>
<!-- AUTO LOAD DATABASE (DB) -->
<!-- To change the word matching database reference a different file in the script below or append lines to db.txt -->
<!-- Tries pre-computed db.json first (instant matching), falls back to db.txt (live mode) -->
<script>
var database = loadFile("db.txt");
// Show loading indicator
document.getElementById("dbLoadIndicator").style.display = "inline";
// Load pre-computed db.json (instant matching, ~16MB gzipped via mod_deflate)
// Falls back to db.txt (2.3MB, live mode with recalculation)
var _c = (typeof CALC_CONFIG !== 'undefined') ? CALC_CONFIG : {};
var _jsonUrl = _c.databaseJsonUrl || "db.json";
var _txtUrl = _c.databaseTxtUrl || "db.txt";
var _mode = _c.databaseMode || "auto";
function _dbLoaded() {
document.getElementById("dbLoadIndicator").style.display = "none";
var amb = document.getElementById("autoMatchBtn");
amb.classList.remove("hideValue");
if (!autoMatchEnabled) amb.classList.add("matchOff");
}
if (_mode === "txt") {
var database = loadFile(_txtUrl);
importFileAction(database, true);
_dbLoaded();
} else {
fetch(_jsonUrl)
.then(function(r) {
if (!r.ok) throw new Error("db.json not found (" + r.status + ")");
return r.json();
})
.then(function(data) { loadPrecomputedDB(data); _dbLoaded(); })
.catch(function(err) {
console.log("Pre-computed DB not available, using live mode:", err.message);
var database = loadFile(_txtUrl);
importFileAction(database, true);
_dbLoaded();
});
}
</script>
<!-- AUTO LOAD THEME -->
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB