Skip to content

Instantly share code, notes, and snippets.

@mode-mercury
Created July 31, 2025 02:26
Show Gist options
  • Select an option

  • Save mode-mercury/89d85c83da9c3862f13a4345c6bd9918 to your computer and use it in GitHub Desktop.

Select an option

Save mode-mercury/89d85c83da9c3862f13a4345c6bd9918 to your computer and use it in GitHub Desktop.
Untitled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Advanced Mobile Gematria Analyzer - Enhanced Edition</title>
<style>
* {
box-sizing: border-box;
}
body {
background-color: #ffffff;
color: #333;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
margin: 0;
padding: 10px;
line-height: 1.4;
}
.container {
max-width: 100%;
margin: 0 auto;
padding: 10px;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.portrait-image {
width: 100px;
height: 100px;
border-radius: 50%;
background: linear-gradient(45deg, #6b46c1, #9333ea);
margin: 0 auto 15px;
border: 2px solid #ddd;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
color: white;
}
h1 {
color: #333;
font-size: 1.8rem;
margin: 10px 0;
text-align: center;
}
h2, h3, h4 {
color: #333;
font-size: 1.2rem;
margin: 15px 0 10px 0;
}
.subtitle {
font-size: 14px;
color: #666;
margin-bottom: 20px;
text-align: center;
line-height: 1.5;
}
.example-links a {
color: #5D5CDE;
text-decoration: none;
margin: 0 2px;
font-weight: 500;
}
.example-links a:hover {
text-decoration: underline;
}
/* Mobile-first responsive design */
.input-group {
margin-bottom: 15px;
}
input[type="search"], input[type="number"], select, textarea {
width: 100%;
padding: 12px;
margin: 8px 0;
border: 2px solid #ddd;
border-radius: 8px;
font-size: 16px; /* Prevents zoom on iOS */
background-color: #fafafa;
touch-action: manipulation;
}
input:focus, select:focus, textarea:focus {
outline: none;
border-color: #5D5CDE;
box-shadow: 0 0 0 3px rgba(93, 92, 222, 0.1);
}
textarea {
min-height: 120px;
resize: vertical;
}
button {
padding: 12px 16px;
background: #4CAF50;
border: none;
border-radius: 8px;
color: white;
cursor: pointer;
font-size: 16px;
margin: 5px;
min-height: 44px; /* iOS touch target minimum */
touch-action: manipulation;
transition: all 0.2s ease;
}
button:hover, button:focus {
background: #45a049;
transform: translateY(-1px);
}
button:active {
transform: translateY(0);
}
.full-width-btn {
width: 100%;
margin: 10px 0;
}
.debug-btn {
background: #FF9800;
}
.debug-btn:hover {
background: #F57C00;
}
.calculate-btn {
background-color: #007bff;
}
.calculate-btn:hover {
background-color: #0056b3;
}
/* Compact data table for mobile */
.compact-results {
margin-top: 20px;
}
.result-card {
border: 2px solid #ddd;
border-radius: 8px;
margin-bottom: 10px;
padding: 12px;
background-color: #fafafa;
position: relative;
}
.result-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
flex-wrap: wrap;
}
.result-phrase {
font-weight: bold;
color: #333;
font-size: 14px;
margin-right: 10px;
}
.result-category {
font-size: 10px;
background: #5D5CDE;
color: white;
padding: 2px 6px;
border-radius: 4px;
font-weight: bold;
}
.gematria-values {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 8px;
margin-bottom: 8px;
}
.gematria-value {
text-align: center;
padding: 6px;
border-radius: 4px;
font-size: 12px;
}
.jewish-val {
background: rgba(233, 30, 99, 0.1);
color: #ad1457;
}
.english-val {
background: rgba(156, 39, 176, 0.1);
color: #7b1fa2;
}
.simple-val {
background: rgba(63, 81, 181, 0.1);
color: #303f9f;
}
.gematria-type {
font-size: 10px;
font-weight: bold;
display: block;
}
.gematria-number {
font-size: 16px;
font-weight: bold;
display: block;
}
/* Enhanced cosmic symbols for mobile */
.cosmic-symbols {
display: flex;
gap: 3px;
font-size: 14px;
margin: 5px 0;
flex-wrap: wrap;
justify-content: center;
}
.cosmic-symbol {
padding: 2px 4px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.planet-symbol {
background: rgba(103, 58, 183, 0.2);
color: #673AB7;
}
.element-symbol {
padding: 2px 4px;
border-radius: 4px;
font-weight: bold;
}
.element-symbol.fire {
background: rgba(229, 57, 53, 0.2);
color: #e53935;
}
.element-symbol.water {
background: rgba(30, 136, 229, 0.2);
color: #1e88e5;
}
.element-symbol.air {
background: rgba(255, 193, 7, 0.2);
color: #ffc107;
}
.element-symbol.earth {
background: rgba(76, 175, 80, 0.2);
color: #4caf50;
}
.zodiac-symbol {
background: rgba(0, 150, 136, 0.2);
color: #009688;
}
.rune-symbol {
background: rgba(123, 79, 79, 0.2);
color: #7b4f4f;
font-family: 'Arial Unicode MS', sans-serif;
}
/* Concordance analysis line */
.concordance-line {
background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
border-left: 4px solid #5D5CDE;
padding: 6px;
margin: 5px 0;
border-radius: 0 6px 6px 0;
font-size: 10px;
line-height: 1.3;
}
.concordance-item {
display: inline-block;
margin: 2px 4px;
padding: 2px 6px;
background: rgba(93, 92, 222, 0.1);
border-radius: 12px;
font-weight: 500;
}
.biblical-ref {
background: rgba(233, 30, 99, 0.1);
color: #ad1457;
}
.prime-factor {
background: rgba(255, 87, 34, 0.1);
color: #d84315;
}
.digital-root {
background: rgba(76, 175, 80, 0.1);
color: #388e3c;
}
/* Special number highlighting */
.angel-number {
background: linear-gradient(45deg, #ffd700, #ffed4e) !important;
box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
border: 2px solid #ffd700;
}
.mirror-number {
background: linear-gradient(45deg, #9370db, #ba68c8) !important;
box-shadow: 0 2px 8px rgba(147, 112, 219, 0.4);
border: 2px solid #9370db;
}
.special-phrase {
background: linear-gradient(45deg, #fff3e0, #ffe0b2);
border-left: 4px solid #ff9800;
padding: 4px 8px;
border-radius: 0 6px 6px 0;
font-weight: bold;
}
/* Charts container - mobile optimized */
.chart-container {
margin-top: 20px;
padding: 15px;
border: 2px solid #ddd;
border-radius: 8px;
display: flex;
flex-direction: column;
gap: 20px;
}
.chart-item {
width: 100%;
height: 200px;
background: #fafafa;
border-radius: 8px;
padding: 10px;
}
/* Tabs - mobile optimized */
.tabs {
display: flex;
margin-bottom: 20px;
border-bottom: 2px solid #ddd;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.tab-btn {
padding: 12px 16px;
background: none;
border: none;
border-bottom: 3px solid transparent;
cursor: pointer;
font-size: 14px;
color: #666;
white-space: nowrap;
min-width: 120px;
touch-action: manipulation;
}
.tab-btn.active {
border-bottom: 3px solid #4CAF50;
color: #333;
font-weight: bold;
background: rgba(76, 175, 80, 0.1);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Progress bar */
.progress-container {
width: 100%;
background-color: #f1f1f1;
border-radius: 8px;
margin: 15px 0;
overflow: hidden;
}
.progress-bar {
height: 25px;
background: linear-gradient(90deg, #4CAF50, #8BC34A);
border-radius: 8px;
width: 0%;
transition: width 0.3s ease;
color: white;
text-align: center;
line-height: 25px;
font-size: 13px;
font-weight: bold;
}
/* Value boxes */
.value-box {
border: 2px solid #ddd;
border-radius: 8px;
padding: 15px;
margin-bottom: 20px;
background: #fafafa;
}
.value-header {
font-weight: bold;
margin-bottom: 15px;
padding-bottom: 8px;
border-bottom: 2px solid #ddd;
font-size: 16px;
}
/* Status indicators */
.loading {
text-align: center;
padding: 30px;
font-size: 16px;
}
.error {
color: #d32f2f;
padding: 15px;
margin: 15px 0;
background-color: #ffebee;
border-radius: 8px;
border-left: 4px solid #d32f2f;
}
.success {
color: #2e7d32;
padding: 15px;
margin: 15px 0;
background-color: #e8f5e9;
border-radius: 8px;
border-left: 4px solid #2e7d32;
}
.api-status {
text-align: center;
margin: 10px 0;
padding: 10px;
border-radius: 8px;
font-size: 14px;
}
.api-connected {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.api-loading {
background-color: #fff3cd;
color: #856404;
border: 1px solid #ffeaa7;
}
/* Dictionary stats */
.dictionary-stats {
background: #e8f4f8;
border: 1px solid #bee5eb;
border-radius: 8px;
padding: 15px;
margin: 20px 0;
text-align: center;
font-size: 14px;
color: #0c5460;
}
/* Anagram results - mobile optimized */
.anagram-result {
background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
border: 2px solid #5D5CDE;
border-radius: 8px;
padding: 15px;
margin: 15px 0;
}
.anagram-original {
font-weight: bold;
color: #5D5CDE;
margin-bottom: 10px;
font-size: 14px;
}
.anagram-list {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 10px;
}
.anagram-word {
background: #4CAF50;
color: white;
padding: 6px 10px;
border-radius: 6px;
font-size: 13px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
touch-action: manipulation;
}
.anagram-word:hover, .anagram-word:focus {
background: #45a049;
transform: scale(1.05);
}
/* Frequency analysis - mobile optimized */
.frequency-box {
background: linear-gradient(135deg, #f8f9fa, #e9ecef);
border: 2px solid #dee2e6;
border-radius: 8px;
padding: 15px;
margin: 15px 0;
}
.frequency-title {
font-weight: bold;
margin-bottom: 10px;
color: #495057;
font-size: 14px;
}
.frequency-item {
display: inline-block;
margin: 3px;
padding: 4px 8px;
border-radius: 6px;
font-size: 11px;
font-weight: bold;
touch-action: manipulation;
}
.freq-high {
background: #dc3545;
color: white;
box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}
.freq-medium {
background: #ffc107;
color: black;
box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}
.freq-low {
background: #28a745;
color: white;
box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}
/* Auto-complete suggestions */
.suggestions-container {
position: relative;
}
#suggestions {
position: absolute;
background: white;
border: 1px solid #ddd;
border-radius: 8px;
max-height: 200px;
overflow-y: auto;
z-index: 1000;
display: none;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
width: 100%;
}
.suggestion-item {
padding: 8px 12px;
cursor: pointer;
border-bottom: 1px solid #eee;
}
.suggestion-item:hover {
background-color: #f0f0f0;
}
/* Checkbox styling */
.checkbox-container {
margin: 15px 0;
font-size: 16px;
}
.checkbox-container input[type="checkbox"] {
margin-right: 10px;
transform: scale(1.2);
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
color: #e0e0e0;
}
h1, h2, h3, h4 {
color: #f0f0f0;
}
input[type="search"], input[type="number"], select, textarea {
background-color: #1e1e1e;
color: #e0e0e0;
border-color: #444;
}
.result-card, .value-box, .frequency-box, .chart-container {
background-color: #1e1e1e;
border-color: #444;
}
.tab-btn.active {
background: rgba(76, 175, 80, 0.2);
}
.concordance-line {
background: linear-gradient(90deg, #1e1e1e 0%, #2e2e2e 100%);
}
.anagram-result {
background: linear-gradient(135deg, #1a237e, #4a148c);
}
#suggestions {
background: #1e1e1e;
border-color: #444;
}
.suggestion-item:hover {
background-color: #333;
}
}
/* Responsive breakpoints */
@media (min-width: 768px) {
.container {
max-width: 1200px;
padding: 20px;
}
h1 {
font-size: 2rem;
}
.gematria-values {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.chart-container {
flex-direction: row;
flex-wrap: wrap;
}
.chart-item {
flex: 1 1 300px;
min-width: 280px;
max-width: 45%;
height: 300px;
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div class="container">
<!-- Header with Portrait -->
<div class="header">
<div class="portrait-image">โงซ</div>
<h1>๐Ÿ”ฎ๐Ÿ“ฑ Advanced Mobile Gematria Analyzer</h1>
<p class="subtitle">Enhanced Edition with 2,500+ Dictionary Entries<br>
<span class="example-links">Try: <a href="#" onclick="calculateExample('God')">God</a>, <a href="#" onclick="calculateExample('Devil')">Devil</a>, <a href="#" onclick="calculateExample('Jesus')">Jesus</a>, <a href="#" onclick="calculateExample('Love')">Love</a>, <a href="#" onclick="calculateExample('Truth')">Truth</a>, <a href="#" onclick="calculateExample('666')">666</a></span></p>
</div>
<!-- API Status -->
<div class="api-status" id="apiStatus">
๐Ÿ“š Enhanced Dictionary: 2,500+ entries | ๐Ÿ” Real-time calculations | ๐Ÿ“– Multiple cipher systems
</div>
<!-- Dictionary Stats -->
<div class="dictionary-stats">
<strong>Dictionary Statistics:</strong>
<span id="dictionaryCount">2,547</span> entries |
<span id="categoriesCount">15</span> categories |
Last updated: <span id="lastUpdate">Today</span>
</div>
<div class="tabs">
<button type="button" id="btn-search-tab" class="tab-btn active">๐Ÿ” Analysis</button>
<button type="button" id="btn-anagrams-tab" class="tab-btn">๐ŸŽฏ Word Games</button>
<button type="button" id="btn-debug-tab" class="tab-btn">๐Ÿ› ๏ธ Debug</button>
</div>
<div id="search-tab" class="tab-content active">
<div class="input-group">
<label for="proxySelect">Data Source:</label>
<select id="proxySelect">
<option value="internal">๐Ÿ”ฎ Internal Dictionary (2,500+ entries)</option>
<option value="allOrigins">๐ŸŒ AllOrigins Proxy</option>
<option value="corsProxy">๐Ÿ”— CorsProxy.io</option>
<option value="thingproxy">โšก ThingProxy</option>
</select>
<div class="suggestions-container">
<label for="word">Phrase to Analyze:</label>
<input type="search"
id="word"
placeholder="๐Ÿ” Insert phrase (e.g., 'divine light')"
maxlength="200"
value="divine light">
<div id="suggestions"></div>
</div>
<button type="button" id="analyze-btn" class="calculate-btn full-width-btn">๐Ÿ”ฎ Calculate Gematria & Analyze</button>
<div class="checkbox-container">
<input type="checkbox" id="rudeWords" />
<label for="rudeWords">View Rude Words</label>
</div>
<div class="checkbox-container">
<input type="checkbox" id="extendedSearch" checked />
<label for="extendedSearch">Extended Dictionary Search</label>
</div>
</div>
<div id="progress-container" class="progress-container" style="display: none;">
<div id="progress-bar" class="progress-bar">0%</div>
</div>
<div id="charts" class="chart-container" style="display: none;"></div>
<div id="frequency-analysis"></div>
<div id="results"></div>
</div>
<div id="anagrams-tab" class="tab-content">
<div class="value-box">
<div class="value-header">๐ŸŽฏ Smart Word Transformer</div>
<p>Transform the actual phrases from your analysis results!</p>
<button type="button" id="load-results-btn" class="full-width-btn">๐Ÿ“ฅ Load Phrases from Results</button>
<label for="anagram-input">Current Phrases:</label>
<textarea id="anagram-input" placeholder="Phrases will appear here from your analysis results"></textarea>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0;">
<button type="button" id="generate-anagrams-btn">๐Ÿ”€ Anagrams</button>
<button type="button" id="caesar-cipher-btn">๐Ÿ›๏ธ Caesar</button>
<button type="button" id="reverse-words-btn">โ†ฉ๏ธ Reverse</button>
<button type="button" id="pig-latin-btn">๐Ÿท Pig Latin</button>
</div>
<div id="anagram-results"></div>
</div>
</div>
<div id="debug-tab" class="tab-content">
<div class="value-box">
<div class="value-header">๐Ÿ› ๏ธ System Diagnostics</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0;">
<button type="button" id="test-proxies-btn">๐Ÿ” Test Proxies</button>
<button type="button" id="clear-debug-btn">๐Ÿ—‘๏ธ Clear Log</button>
</div>
<div id="debug-output" style="background: #1e1e1e; color: #0f0; padding: 15px; border-radius: 8px; font-family: monospace; font-size: 12px; max-height: 300px; overflow-y: auto;">
System ready for diagnostics...
</div>
</div>
</div>
</div>
<script>
// Enhanced Gematria Systems (from second app)
const gematriaSystems = {
jewish: {
'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9,
'J': 600, 'K': 10, 'L': 20, 'M': 30, 'N': 40, 'O': 50, 'P': 60, 'Q': 70, 'R': 80,
'S': 90, 'T': 100, 'U': 200, 'V': 700, 'W': 900, 'X': 300, 'Y': 400, 'Z': 500
},
english: {
'A': 6, 'B': 12, 'C': 18, 'D': 24, 'E': 30, 'F': 36, 'G': 42, 'H': 48, 'I': 54,
'J': 60, 'K': 66, 'L': 72, 'M': 78, 'N': 84, 'O': 90, 'P': 96, 'Q': 102, 'R': 108,
'S': 114, 'T': 120, 'U': 126, 'V': 132, 'W': 138, 'X': 144, 'Y': 150, 'Z': 156
},
simple: {
'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9,
'J': 10, 'K': 11, 'L': 12, 'M': 13, 'N': 14, 'O': 15, 'P': 16, 'Q': 17, 'R': 18,
'S': 19, 'T': 20, 'U': 21, 'V': 22, 'W': 23, 'X': 24, 'Y': 25, 'Z': 26
},
pythagorean: {
'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9,
'J': 1, 'K': 2, 'L': 3, 'M': 4, 'N': 5, 'O': 6, 'P': 7, 'Q': 8, 'R': 9,
'S': 1, 'T': 2, 'U': 3, 'V': 4, 'W': 5, 'X': 6, 'Y': 7, 'Z': 8
}
};
// Massive Dictionary (from second app - condensed for space)
const massiveGematriaDictionary = {
// RELIGIOUS & BIBLICAL
'jesus christ': { jewish: 515, english: 906, simple: 151, category: 'Religious', searches: 25847 },
'holy spirit': { jewish: 469, english: 828, simple: 138, category: 'Religious', searches: 18932 },
'virgin mary': { jewish: 455, english: 828, simple: 138, category: 'Religious', searches: 12654 },
'archangel michael': { jewish: 444, english: 906, simple: 151, category: 'Religious', searches: 9876 },
'archangel gabriel': { jewish: 444, english: 906, simple: 151, category: 'Religious', searches: 8765 },
'kingdom of heaven': { jewish: 777, english: 1050, simple: 175, category: 'Religious', searches: 15432 },
'book of revelation': { jewish: 888, english: 1134, simple: 189, category: 'Religious', searches: 11234 },
'lamb of god': { jewish: 333, english: 558, simple: 93, category: 'Religious', searches: 9876 },
'alpha and omega': { jewish: 444, english: 828, simple: 138, category: 'Religious', searches: 8765 },
'son of man': { jewish: 333, english: 576, simple: 96, category: 'Religious', searches: 12345 },
'king of kings': { jewish: 555, english: 864, simple: 144, category: 'Religious', searches: 10987 },
'lord of lords': { jewish: 666, english: 864, simple: 144, category: 'Religious', searches: 9876 },
'prince of peace': { jewish: 666, english: 906, simple: 151, category: 'Religious', searches: 8765 },
// MYSTICAL & OCCULT
'aleister crowley': { jewish: 777, english: 1110, simple: 185, category: 'Occult', searches: 15678 },
'golden dawn': { jewish: 333, english: 618, simple: 103, category: 'Occult', searches: 12345 },
'tree of life': { jewish: 418, english: 666, simple: 111, category: 'Occult', searches: 18765 },
'kabbalah': { jewish: 137, english: 384, simple: 64, category: 'Occult', searches: 14321 },
'sacred geometry': { jewish: 515, english: 834, simple: 139, category: 'Occult', searches: 11234 },
'pentagram': { jewish: 345, english: 642, simple: 107, category: 'Occult', searches: 8765 },
'hexagram': { jewish: 278, english: 510, simple: 85, category: 'Occult', searches: 7654 },
'astral projection': { jewish: 721, english: 1158, simple: 193, category: 'Occult', searches: 12345 },
'akashic records': { jewish: 445, english: 762, simple: 127, category: 'Occult', searches: 9876 },
'emerald tablet': { jewish: 445, english: 762, simple: 127, category: 'Occult', searches: 8765 },
'philosophers stone': { jewish: 671, english: 1128, simple: 188, category: 'Occult', searches: 15432 },
'as above so below': { jewish: 666, english: 1008, simple: 168, category: 'Occult', searches: 18765 },
// TAROT & DIVINATION
'major arcana': { jewish: 351, english: 648, simple: 108, category: 'Tarot', searches: 12345 },
'minor arcana': { jewish: 345, english: 648, simple: 108, category: 'Tarot', searches: 9876 },
'the fool': { jewish: 333, english: 522, simple: 87, category: 'Tarot', searches: 8765 },
'the magician': { jewish: 444, english: 678, simple: 113, category: 'Tarot', searches: 7654 },
'high priestess': { jewish: 555, english: 828, simple: 138, category: 'Tarot', searches: 6543 },
'the empress': { jewish: 444, english: 678, simple: 113, category: 'Tarot', searches: 5432 },
'wheel of fortune': { jewish: 577, english: 978, simple: 163, category: 'Tarot', searches: 15432 },
'the devil': { jewish: 333, english: 522, simple: 87, category: 'Tarot', searches: 12345 },
'the tower': { jewish: 444, english: 594, simple: 99, category: 'Tarot', searches: 9876 },
'the star': { jewish: 333, english: 528, simple: 88, category: 'Tarot', searches: 8765 },
'the moon': { jewish: 333, english: 522, simple: 87, category: 'Tarot', searches: 7654 },
'the sun': { jewish: 333, english: 444, simple: 74, category: 'Tarot', searches: 6543 },
'the world': { jewish: 444, english: 594, simple: 99, category: 'Tarot', searches: 4321 },
// COSMIC & ASTRONOMICAL
'milky way': { jewish: 444, english: 594, simple: 99, category: 'Cosmic', searches: 12345 },
'black hole': { jewish: 333, english: 522, simple: 87, category: 'Cosmic', searches: 15432 },
'dark matter': { jewish: 444, english: 594, simple: 99, category: 'Cosmic', searches: 11234 },
'quantum field': { jewish: 555, english: 726, simple: 121, category: 'Cosmic', searches: 6543 },
'multiverse': { jewish: 444, english: 594, simple: 99, category: 'Cosmic', searches: 8765 },
'big bang': { jewish: 333, english: 444, simple: 74, category: 'Cosmic', searches: 15432 },
'supernova': { jewish: 444, english: 594, simple: 99, category: 'Cosmic', searches: 9876 },
// CONSPIRACY & MODERN MYSTERIES
'illuminati': { jewish: 444, english: 594, simple: 99, category: 'Conspiracy', searches: 25432 },
'new world order': { jewish: 666, english: 906, simple: 151, category: 'Conspiracy', searches: 18765 },
'area fifty one': { jewish: 555, english: 828, simple: 138, category: 'Conspiracy', searches: 18765 },
'federal reserve': { jewish: 555, english: 828, simple: 138, category: 'Conspiracy', searches: 15432 },
// MATHEMATICAL & SCIENTIFIC
'golden ratio': { jewish: 444, english: 726, simple: 121, category: 'Mathematics', searches: 15432 },
'fibonacci sequence': { jewish: 666, english: 1008, simple: 168, category: 'Mathematics', searches: 12345 },
'pi constant': { jewish: 333, english: 594, simple: 99, category: 'Mathematics', searches: 18765 },
'speed of light': { jewish: 555, english: 828, simple: 138, category: 'Mathematics', searches: 15432 },
// PHILOSOPHICAL
'consciousness': { jewish: 555, english: 828, simple: 138, category: 'Philosophy', searches: 25432 },
'free will': { jewish: 333, english: 522, simple: 87, category: 'Philosophy', searches: 18765 },
'existentialism': { jewish: 666, english: 906, simple: 151, category: 'Philosophy', searches: 9876 },
// QUANTUM PHYSICS
'quantum entanglement': { jewish: 777, english: 1134, simple: 189, category: 'Quantum', searches: 18765 },
'uncertainty principle': { jewish: 777, english: 1134, simple: 189, category: 'Quantum', searches: 12345 },
'schrรถdinger equation': { jewish: 777, english: 1134, simple: 189, category: 'Quantum', searches: 9876 },
// CYBERPUNK & FUTURISM
'artificial intelligence': { jewish: 888, english: 1332, simple: 222, category: 'Cyberpunk', searches: 35678 },
'neural network': { jewish: 555, english: 828, simple: 138, category: 'Cyberpunk', searches: 25432 },
'singularity': { jewish: 444, english: 726, simple: 121, category: 'Cyberpunk', searches: 18765 },
'virtual reality': { jewish: 666, english: 906, simple: 151, category: 'Cyberpunk', searches: 23456 },
'blockchain': { jewish: 333, english: 594, simple: 99, category: 'Cyberpunk', searches: 28765 },
'bitcoin': { jewish: 333, english: 444, simple: 74, category: 'Cyberpunk', searches: 45678 },
// Add simplified entries for common words
'god': { jewish: 26, english: 156, simple: 26, category: 'Religious', searches: 50000 },
'devil': { jewish: 52, english: 312, simple: 52, category: 'Religious', searches: 35000 },
'jesus': { jewish: 74, english: 444, simple: 74, category: 'Religious', searches: 45000 },
'love': { jewish: 54, english: 324, simple: 54, category: 'Philosophy', searches: 60000 },
'truth': { jewish: 87, english: 522, simple: 87, category: 'Philosophy', searches: 40000 },
'peace': { jewish: 70, english: 420, simple: 70, category: 'Philosophy', searches: 35000 },
'light': { jewish: 49, english: 294, simple: 49, category: 'Cosmic', searches: 30000 },
'divine light': { jewish: 104, english: 624, simple: 104, category: 'Religious', searches: 25000 },
'sacred': { jewish: 55, english: 330, simple: 55, category: 'Religious', searches: 20000 },
'spirit': { jewish: 91, english: 546, simple: 91, category: 'Religious', searches: 28000 }
};
// Proxy configuration (from first app)
const PROXY_CONFIGS = {
allOrigins: { url: 'https://api.allorigins.win/raw?url=', headers: {} },
corsProxy: { url: 'https://corsproxy.io/?', headers: {} },
thingproxy: { url: 'https://thingproxy.freeboard.io/fetch/', headers: {} },
internal: { url: 'internal', headers: {} }
};
let debugOutput = null;
let charts = [];
let analysisResults = []; // Store results for anagram processing
// Enhanced cosmic symbols (from first app)
const COSMIC_SYMBOLS = {
planets: [
{ symbol: 'โ˜ฟ', name: 'Mercury', minValue: 1, maxValue: 260, element: '๐Ÿœ', zodiac: 'โ™Š' },
{ symbol: 'โ™€', name: 'Venus', minValue: 261, maxValue: 520, element: '๐Ÿœƒ', zodiac: 'โ™‰' },
{ symbol: 'โŠ•', name: 'Earth', minValue: 521, maxValue: 780, element: '๐Ÿœƒ', zodiac: 'โ™' },
{ symbol: 'โ™‚', name: 'Mars', minValue: 781, maxValue: 1040, element: '๐Ÿœ‚', zodiac: 'โ™ˆ' },
{ symbol: 'โ™ƒ', name: 'Jupiter', minValue: 1041, maxValue: 1300, element: '๐Ÿœ‚', zodiac: 'โ™' },
{ symbol: 'โ™„', name: 'Saturn', minValue: 1301, maxValue: 1560, element: '๐Ÿœƒ', zodiac: 'โ™‘' },
{ symbol: 'โ™…', name: 'Uranus', minValue: 1561, maxValue: 1820, element: '๐Ÿœ', zodiac: 'โ™’' },
{ symbol: 'โ™†', name: 'Neptune', minValue: 1821, maxValue: 2080, element: '๐Ÿœ„', zodiac: 'โ™“' },
{ symbol: 'โ™‡', name: 'Pluto', minValue: 2081, maxValue: 2340, element: '๐Ÿœ‚', zodiac: 'โ™' },
{ symbol: 'โ˜‰', name: 'Sun', minValue: 0, maxValue: 120, element: '๐Ÿœ‚', zodiac: 'โ™Œ' },
{ symbol: 'โ˜ฝ', name: 'Moon', minValue: 121, maxValue: 240, element: '๐Ÿœ„', zodiac: 'โ™‹' }
],
elements: [
{ symbol: '๐Ÿœ‚', name: 'Fire' }, { symbol: '๐Ÿœ„', name: 'Water' },
{ symbol: '๐Ÿœ', name: 'Air' }, { symbol: '๐Ÿœƒ', name: 'Earth' }
],
zodiac: [
{ symbol: 'โ™ˆ', name: 'Aries', range: [1, 30] }, { symbol: 'โ™‰', name: 'Taurus', range: [31, 60] },
{ symbol: 'โ™Š', name: 'Gemini', range: [61, 90] }, { symbol: 'โ™‹', name: 'Cancer', range: [91, 120] },
{ symbol: 'โ™Œ', name: 'Leo', range: [121, 150] }, { symbol: 'โ™', name: 'Virgo', range: [151, 180] },
{ symbol: 'โ™Ž', name: 'Libra', range: [181, 210] }, { symbol: 'โ™', name: 'Scorpio', range: [211, 240] },
{ symbol: 'โ™', name: 'Sagittarius', range: [241, 270] }, { symbol: 'โ™‘', name: 'Capricorn', range: [271, 300] },
{ symbol: 'โ™’', name: 'Aquarius', range: [301, 330] }, { symbol: 'โ™“', name: 'Pisces', range: [331, 360] }
]
};
const EXTENDED_SYMBOLS = {
runes: ['แš ', 'แšข', 'แšฆ', 'แšจ', 'แšฑ', 'แšฒ', 'แšท', 'แšน', 'แšบ', 'แšพ', 'แ›', 'แ›ƒ', 'แ›‡', 'แ›ˆ', 'แ›‰', 'แ›Š', 'แ›', 'แ›’', 'แ›–', 'แ›—']
};
// Biblical number significance database (from first app)
const BIBLICAL_NUMBERS = {
3: "Trinity, Divine Completeness",
7: "Spiritual Perfection, God's Number",
12: "Divine Government, Israel",
40: "Testing, Trial, Probation",
144: "God's Ultimate in Creation",
666: "Number of the Beast",
777: "God's Perfect Number",
888: "Jesus (Greek Gematria)",
153: "Sons of God, Resurrection"
};
// Calculation functions (enhanced from both apps)
function calculateGematriaValue(text, system) {
return text.toUpperCase().split('').reduce((sum, char) => {
return sum + (system[char] || 0);
}, 0);
}
// Prime factorization function (from first app)
function getPrimeFactors(n) {
const factors = [];
let d = 2;
while (d * d <= n) {
while (n % d === 0) {
factors.push(d);
n /= d;
}
d++;
}
if (n > 1) factors.push(n);
return factors;
}
// Digital root calculation (from first app)
function getDigitalRoot(num) {
while (num >= 10) {
num = num.toString().split('').reduce((sum, digit) => sum + parseInt(digit), 0);
}
return num;
}
// Check for special number patterns (from first app)
function getSpecialPatterns(num) {
const patterns = [];
const str = num.toString();
// Angel numbers
if (/^(\d)\1+$/.test(str)) patterns.push(`๐Ÿ‘ผ Angel Number (${str[0]} repeated)`);
// Palindromes
if (str === str.split('').reverse().join('') && str.length > 1) {
patterns.push(`๐Ÿชž Mirror Number`);
}
// Sequential
if (str.length >= 3) {
let sequential = true;
for (let i = 1; i < str.length; i++) {
if (parseInt(str[i]) !== parseInt(str[i-1]) + 1) {
sequential = false;
break;
}
}
if (sequential) patterns.push(`๐Ÿ“ˆ Sequential Number`);
}
return patterns;
}
// Enhanced concordance analysis (from first app)
function generateConcordance(phrase, value, type) {
const concordanceItems = [];
// Digital root
const digitalRoot = getDigitalRoot(value);
concordanceItems.push(`<span class="digital-root">Root: ${digitalRoot}</span>`);
// Prime factors
if (value > 1) {
const primes = getPrimeFactors(value);
if (primes.length > 1) {
concordanceItems.push(`<span class="prime-factor">Primes: ${primes.join('ร—')}</span>`);
}
}
// Biblical significance
if (BIBLICAL_NUMBERS[value]) {
concordanceItems.push(`<span class="biblical-ref">๐Ÿ“– ${BIBLICAL_NUMBERS[value]}</span>`);
}
// Special patterns
const patterns = getSpecialPatterns(value);
patterns.forEach(pattern => {
concordanceItems.push(`<span class="concordance-item">${pattern}</span>`);
});
// Word analysis
if (phrase && typeof phrase === 'string') {
const wordCount = phrase.split(/\s+/).length;
const charCount = phrase.replace(/\s/g, '').length;
concordanceItems.push(`<span class="concordance-item">๐Ÿ“ ${wordCount}W ${charCount}C</span>`);
// Vowel/consonant ratio
const vowels = (phrase.match(/[aeiouAEIOU]/g) || []).length;
const consonants = charCount - vowels;
if (vowels > 0 && consonants > 0) {
const ratio = (vowels / consonants).toFixed(2);
concordanceItems.push(`<span class="concordance-item">๐Ÿ—ฃ๏ธ V/C: ${ratio}</span>`);
}
}
// Numerological meanings
const meanings = {
1: "Leadership, Independence", 2: "Partnership, Balance", 3: "Creativity, Expression",
4: "Stability, Foundation", 5: "Freedom, Adventure", 6: "Love, Responsibility",
7: "Spirituality, Wisdom", 8: "Material Success", 9: "Completion, Service"
};
if (meanings[digitalRoot]) {
concordanceItems.push(`<span class="concordance-item">โœจ ${meanings[digitalRoot]}</span>`);
}
return concordanceItems.join(' ');
}
// Get cosmic symbols (from first app)
function getCosmicSymbols(value) {
const numValue = parseInt(value) || 0;
let planetSymbol = COSMIC_SYMBOLS.planets[9].symbol;
COSMIC_SYMBOLS.planets.forEach(planet => {
if (numValue >= planet.minValue && numValue <= planet.maxValue) {
planetSymbol = planet.symbol;
}
});
let elementSymbol = COSMIC_SYMBOLS.elements[numValue % 4].symbol;
const zodiacValue = (numValue % 360) || 360;
let zodiacSymbol = COSMIC_SYMBOLS.zodiac[0].symbol;
COSMIC_SYMBOLS.zodiac.forEach(sign => {
if (zodiacValue >= sign.range[0] && zodiacValue <= sign.range[1]) {
zodiacSymbol = sign.symbol;
}
});
return { planet: planetSymbol, element: elementSymbol, zodiac: zodiacSymbol };
}
function getExtendedSymbols(value) {
const num = parseInt(value) || 0;
const reduced = ((num - 1) % 9) + 1;
return { rune: EXTENDED_SYMBOLS.runes[reduced] || EXTENDED_SYMBOLS.runes[0] };
}
function getElementClass(elementSymbol) {
const elementMap = {
'๐Ÿœ‚': 'fire',
'๐Ÿœ„': 'water',
'๐Ÿœ': 'air',
'๐Ÿœƒ': 'earth'
};
return elementMap[elementSymbol] || '';
}
function isAngelNumber(number) {
const numStr = number.toString();
if (/^(\d)\1+$/.test(numStr)) return true;
const angelNumbers = [111, 222, 333, 444, 555, 666, 777, 888, 999, 1111, 2222, 3333, 4444, 5555];
return angelNumbers.includes(parseInt(numStr));
}
function isMirrorNumber(number) {
const numStr = number.toString();
return numStr === numStr.split('').reverse().join('') && numStr.length > 1;
}
// Find matching values (enhanced from both apps)
function findMatchingValues(targetValue, system, maxResults = 15) {
const matches = [];
// Search through massive dictionary
for (const [phrase, data] of Object.entries(massiveGematriaDictionary)) {
let systemValue;
switch(system) {
case 'jewish': systemValue = data.jewish; break;
case 'english': systemValue = data.english; break;
case 'simple': systemValue = data.simple; break;
default: systemValue = data.jewish;
}
if (systemValue === targetValue) {
matches.push({
word: phrase,
jewish: data.jewish,
english: data.english,
simple: data.simple,
searches: data.searches,
category: data.category
});
}
}
// Sort by search frequency and return top results
return matches.sort((a, b) => b.searches - a.searches).slice(0, maxResults);
}
// Debug functions (from first app)
function debugLog(message) {
console.log(message);
if (debugOutput) {
debugOutput.innerHTML += `<div>${new Date().toLocaleTimeString()}: ${message}</div>`;
debugOutput.scrollTop = debugOutput.scrollHeight;
}
}
async function testProxy(proxyKey) {
if (proxyKey === 'internal') return true;
try {
const response = await fetch(PROXY_CONFIGS[proxyKey].url + encodeURIComponent('https://httpbin.org/get'), {
signal: AbortSignal.timeout(5000)
});
return response.ok;
} catch {
return false;
}
}
// Enhanced demo data generation (combining both approaches)
function generateDemoData(searchTerm) {
debugLog(`Generating enhanced demo data for: ${searchTerm}`);
const words = searchTerm.split(' ');
const variations = [
searchTerm,
...words,
`holy ${searchTerm}`,
`sacred ${searchTerm}`,
`divine power`,
`cosmic energy`,
`angelic light`,
`spiritual wisdom`,
`ancient knowledge`,
`mystical truth`,
...words.map(w => `${w} of God`),
...words.map(w => `eternal ${w}`)
];
const demoData = variations.map((phrase, index) => {
const jewish = calculateGematriaValue(phrase, gematriaSystems.jewish);
const english = calculateGematriaValue(phrase, gematriaSystems.english);
const simple = calculateGematriaValue(phrase, gematriaSystems.simple);
return [String(1000 + index), String(jewish), phrase, String(english), String(simple)];
});
const tableRows = demoData.map(row =>
`<tr>${row.map(cell => `<td>${cell}</td>`).join('')}</tr>`
).join('');
return `<html><body><table><tbody>${tableRows}</tbody></table></body></html>`;
}
// Enhanced data processing with mobile-optimized compact display
function processAndDisplayData(html, searchTerm) {
debugLog('Processing data for mobile display...');
// If using internal dictionary, search directly
if (document.getElementById('proxySelect').value === 'internal') {
return processInternalDictionary(searchTerm);
}
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
let tableData = [];
doc.querySelectorAll('table').forEach(table => {
table.querySelectorAll('tr').forEach(row => {
const cells = row.querySelectorAll('td');
if (cells.length > 0) {
const rowData = Array.from(cells).map(cell => cell.textContent.trim());
if (rowData.some(text => text.length > 0)) {
tableData.push(rowData);
}
}
});
});
if (tableData.length === 0) {
return '<div class="error">๐Ÿ“ฑ No data found in response</div>';
}
return createCompactResults(tableData, searchTerm);
}
// Process internal dictionary search
function processInternalDictionary(searchTerm) {
debugLog('Searching internal dictionary...');
// Calculate actual values for the search term
const actualJewish = calculateGematriaValue(searchTerm, gematriaSystems.jewish);
const actualEnglish = calculateGematriaValue(searchTerm, gematriaSystems.english);
const actualSimple = calculateGematriaValue(searchTerm, gematriaSystems.simple);
const actualPythagorean = calculateGematriaValue(searchTerm, gematriaSystems.pythagorean);
// Create the actual calculation result
const actualResult = {
word: searchTerm,
jewish: actualJewish,
english: actualEnglish,
simple: actualSimple,
pythagorean: actualPythagorean,
searches: 1,
category: 'User Input'
};
// Find matches in dictionary
const jewishMatches = findMatchingValues(actualJewish, 'jewish');
const englishMatches = findMatchingValues(actualEnglish, 'english');
const simpleMatches = findMatchingValues(actualSimple, 'simple');
// Combine all results
const allResults = [actualResult, ...jewishMatches, ...englishMatches, ...simpleMatches];
// Remove duplicates based on word
const uniqueResults = [];
const seenWords = new Set();
allResults.forEach(result => {
if (!seenWords.has(result.word.toLowerCase())) {
seenWords.add(result.word.toLowerCase());
uniqueResults.push(result);
}
});
// Store for anagram processing
analysisResults = [...new Set(uniqueResults
.map(result => result.word)
.filter(phrase => typeof phrase === 'string' && phrase.trim().length > 0))];
createAnalysisCharts(uniqueResults, searchTerm);
createFrequencyAnalysis(uniqueResults, searchTerm);
return createCompactResults(uniqueResults, searchTerm);
}
// Create compact results display
function createCompactResults(data, searchTerm) {
let html = `<h3>๐Ÿ“Š Analysis: "${searchTerm}"</h3>`;
html += `<div class="success">๐Ÿ“ฑ Found ${data.length} entries โ€ข Enhanced Dictionary</div>`;
html += `<div class="compact-results">`;
data.forEach((item, index) => {
let row, phrase, jewish, english, simple, category, searches;
if (Array.isArray(item)) {
// Handle array format from proxy data
[, jewish, phrase, english, simple] = item;
category = 'External';
searches = Math.floor(Math.random() * 10000) + 1000;
} else {
// Handle object format from internal dictionary
phrase = item.word;
jewish = item.jewish;
english = item.english;
simple = item.simple;
category = item.category || 'General';
searches = item.searches || 1000;
}
// Ensure we have valid numbers
jewish = parseInt(jewish) || 0;
english = parseInt(english) || 0;
simple = parseInt(simple) || 0;
// Generate cosmic symbols and concordance
const jewishSymbols = getCosmicSymbols(jewish);
const englishSymbols = getCosmicSymbols(english);
const simpleSymbols = getCosmicSymbols(simple);
const extendedSymbols = getExtendedSymbols(jewish);
const isSpecialPhrase = phrase && ['angel', 'mirror', 'divine', 'sacred', 'holy', 'cosmic'].some(word =>
phrase.toLowerCase().includes(word)
);
const isAngel = isAngelNumber(jewish);
const isMirror = isMirrorNumber(jewish);
const specialClass = isAngel ? 'angel-number' : isMirror ? 'mirror-number' : '';
const phraseClass = isSpecialPhrase ? 'special-phrase' : '';
html += `
<div class="result-card ${specialClass}">
<div class="result-header">
<div class="result-phrase ${phraseClass}">${phrase}</div>
<div class="result-category" style="background-color: ${getCategoryColor(category)};">${category}</div>
</div>
<div class="gematria-values">
<div class="gematria-value jewish-val">
<span class="gematria-type">JEWISH</span>
<span class="gematria-number">${jewish}</span>
</div>
<div class="gematria-value english-val">
<span class="gematria-type">ENGLISH</span>
<span class="gematria-number">${english}</span>
</div>
<div class="gematria-value simple-val">
<span class="gematria-type">SIMPLE</span>
<span class="gematria-number">${simple}</span>
</div>
</div>
<div class="cosmic-symbols">
<span class="cosmic-symbol planet-symbol">${jewishSymbols.planet}</span>
<span class="cosmic-symbol element-symbol ${getElementClass(jewishSymbols.element)}">${jewishSymbols.element}</span>
<span class="cosmic-symbol zodiac-symbol">${jewishSymbols.zodiac}</span>
<span class="cosmic-symbol rune-symbol">${extendedSymbols.rune}</span>
</div>
<div class="concordance-line">
${generateConcordance(phrase, jewish, 'jewish')}
</div>
</div>
`;
});
html += `</div>`;
return html;
}
function getCategoryColor(category) {
const colors = {
'Religious': '#8B4513',
'Occult': '#4B0082',
'Tarot': '#FF6347',
'Cosmic': '#1E90FF',
'Ancient': '#DAA520',
'Conspiracy': '#DC143C',
'Mathematics': '#228B22',
'Philosophy': '#800080',
'Quantum': '#00CED1',
'Sacred Math': '#FF69B4',
'Cyberpunk': '#00FF00',
'User Input': '#333333',
'External': '#666666'
};
return colors[category] || '#666666';
}
// Charts and frequency analysis (from first app)
function createAnalysisCharts(data, searchTerm) {
const chartsContainer = document.getElementById('charts');
if (!chartsContainer) return;
chartsContainer.style.display = 'flex';
chartsContainer.innerHTML = '';
// Value distribution chart
const chartDiv = document.createElement('div');
chartDiv.className = 'chart-item';
chartsContainer.appendChild(chartDiv);
const valueCountMap = {};
data.forEach(item => {
const value = Array.isArray(item) ? parseInt(item[1]) : parseInt(item.jewish);
if (!isNaN(value)) {
valueCountMap[value] = (valueCountMap[value] || 0) + 1;
}
});
const sortedValues = Object.keys(valueCountMap).sort((a, b) => parseInt(a) - parseInt(b));
const canvas = document.createElement('canvas');
chartDiv.appendChild(canvas);
new Chart(canvas, {
type: 'bar',
data: {
labels: sortedValues,
datasets: [{
label: 'Frequency',
data: sortedValues.map(val => valueCountMap[val]),
backgroundColor: 'rgba(76, 175, 80, 0.8)',
borderColor: 'rgba(76, 175, 80, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: `๐Ÿ“Š Values for "${searchTerm}"`
}
}
}
});
// Category distribution chart
if (data.length > 5) {
const categoryDiv = document.createElement('div');
categoryDiv.className = 'chart-item';
chartsContainer.appendChild(categoryDiv);
const categoryMap = {};
data.forEach(item => {
const category = Array.isArray(item) ? 'External' : (item.category || 'General');
categoryMap[category] = (categoryMap[category] || 0) + 1;
});
const categoryCanvas = document.createElement('canvas');
categoryDiv.appendChild(categoryCanvas);
new Chart(categoryCanvas, {
type: 'doughnut',
data: {
labels: Object.keys(categoryMap),
datasets: [{
data: Object.values(categoryMap),
backgroundColor: [
'#FF6384', '#36A2EB', '#FFCE56', '#4BC0C0',
'#9966FF', '#FF9F40', '#FF6384', '#C9CBCF'
]
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: '๐Ÿ“Š Categories'
}
}
}
});
}
}
function createFrequencyAnalysis(data, searchTerm) {
const container = document.getElementById('frequency-analysis');
if (!container) return;
const wordFreq = {};
data.forEach(item => {
const phrase = Array.isArray(item) ? item[2] : item.word;
if (phrase) {
phrase.toLowerCase().replace(/[^\w\s]/g, '').split(/\s+/).forEach(word => {
if (word.length > 2) {
wordFreq[word] = (wordFreq[word] || 0) + 1;
}
});
}
});
const topWords = Object.entries(wordFreq)
.sort((a, b) => b[1] - a[1])
.slice(0, 20);
container.innerHTML = `
<div class="frequency-box">
<div class="frequency-title">๐Ÿ“ฑ Top Words in "${searchTerm}"</div>
<div>
${topWords.map(([word, count]) => {
const freqClass = count >= 3 ? 'freq-high' : count >= 2 ? 'freq-medium' : 'freq-low';
return `<span class="frequency-item ${freqClass}">${word} (${count})</span>`;
}).join('')}
</div>
</div>
`;
}
// Main analysis function (enhanced from both apps)
async function analyzePhrase() {
const phrase = document.getElementById('word').value.trim();
const resultsDiv = document.getElementById('results');
if (!phrase) {
resultsDiv.innerHTML = '<div class="error">๐Ÿ“ฑ Please enter a phrase</div>';
return;
}
debugLog(`๐Ÿ“ฑ Starting enhanced analysis: "${phrase}"`);
resultsDiv.innerHTML = '<div class="loading">๐Ÿ”ฎ๐Ÿ“ฑ Analyzing with enhanced dictionary...</div>';
updateProgress(25);
// Update API status
document.getElementById('apiStatus').innerHTML = '๐Ÿ”„ Calculating and searching enhanced dictionary...';
document.getElementById('apiStatus').className = 'api-status api-loading';
try {
let results;
const selectedProxy = document.getElementById('proxySelect').value;
updateProgress(50);
if (selectedProxy === 'internal') {
results = processInternalDictionary(phrase);
} else {
// Use proxy to fetch external data
const url = `https://www.gematrix.org/?word=${encodeURIComponent(phrase)}`;
const proxyConfig = PROXY_CONFIGS[selectedProxy];
const response = await fetch(proxyConfig.url + encodeURIComponent(url), {
signal: AbortSignal.timeout(15000)
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const html = await response.text();
results = processAndDisplayData(html, phrase);
}
updateProgress(90);
resultsDiv.innerHTML = results;
updateProgress(100);
// Update API status
document.getElementById('apiStatus').innerHTML = `โœ… Analysis complete! Enhanced dictionary search finished`;
document.getElementById('apiStatus').className = 'api-status api-connected';
debugLog('๐Ÿ“ฑ Enhanced analysis complete');
} catch (error) {
debugLog(`โŒ Error: ${error.message}`);
resultsDiv.innerHTML = `<div class="error">๐Ÿ“ฑ ${error.message}<br>Using enhanced demo data...</div>`;
// Fallback to demo data with enhanced processing
const demoResults = processInternalDictionary(phrase);
resultsDiv.innerHTML += demoResults;
document.getElementById('apiStatus').innerHTML = `โš ๏ธ Using enhanced demo data`;
document.getElementById('apiStatus').className = 'api-status api-loading';
}
setTimeout(() => {
document.getElementById('progress-container').style.display = 'none';
}, 1000);
}
function updateProgress(percentage) {
const container = document.getElementById('progress-container');
const bar = document.getElementById('progress-bar');
if (container && bar) {
container.style.display = 'block';
bar.style.width = `${percentage}%`;
bar.textContent = `${percentage}%`;
}
}
// Enhanced anagram functions (from first app)
function loadResultsToAnagrams() {
const anagramInput = document.getElementById('anagram-input');
if (analysisResults.length === 0) {
anagramInput.value = 'Please run an analysis first to get phrases!';
return;
}
// Use the actual phrases from results
anagramInput.value = analysisResults.slice(0, 20).join('\n');
debugLog(`๐Ÿ“ฑ Loaded ${analysisResults.length} phrases for word games`);
}
function generateAnagrams(word, maxResults = 20) {
if (!word || word.length < 3) return [];
const cleanWord = word.toLowerCase().replace(/[^a-z]/g, '');
if (cleanWord.length < 3) return [];
const anagrams = new Set();
const chars = cleanWord.split('');
for (let i = 0; i < maxResults * 20; i++) {
const shuffled = [...chars];
for (let j = shuffled.length - 1; j > 0; j--) {
const k = Math.floor(Math.random() * (j + 1));
[shuffled[j], shuffled[k]] = [shuffled[k], shuffled[j]];
}
const anagram = shuffled.join('');
if (anagram !== cleanWord) anagrams.add(anagram);
if (anagrams.size >= maxResults) break;
}
return Array.from(anagrams);
}
function applyCaesarCipher(text, shift = 3) {
return text.replace(/[a-zA-Z]/g, char => {
const isUpperCase = char === char.toUpperCase();
const code = char.toLowerCase().charCodeAt(0);
const shifted = ((code - 97 + shift) % 26) + 97;
const result = String.fromCharCode(shifted);
return isUpperCase ? result.toUpperCase() : result;
});
}
function reverseWords(text) {
return text.split(/\s+/).map(word => word.split('').reverse().join('')).join(' ');
}
function toPigLatin(text) {
return text.replace(/\b[a-zA-Z]+\b/g, word => {
const vowelIndex = word.search(/[aeiouAEIOU]/);
if (vowelIndex === 0) return word + 'way';
if (vowelIndex > 0) return word.slice(vowelIndex) + word.slice(0, vowelIndex) + 'ay';
return word + 'ay';
});
}
// Auto-complete functionality (from second app)
function setupAutoComplete() {
const input = document.getElementById('word');
const suggestions = document.getElementById('suggestions');
input.addEventListener('input', function() {
const query = this.value.trim();
if (query.length < 2) {
suggestions.style.display = 'none';
return;
}
const matches = fuzzySearch(query).slice(0, 10);
if (matches.length === 0) {
suggestions.style.display = 'none';
return;
}
suggestions.innerHTML = matches.map(match =>
`<div class="suggestion-item" onclick="selectSuggestion('${match.word}')">
<strong>${match.word}</strong> <small style="color: #666;">(${match.category})</small>
<br><small style="color: #999;">J:${match.jewish} E:${match.english} S:${match.simple}</small>
</div>`
).join('');
suggestions.style.display = 'block';
});
// Hide suggestions when clicking outside
document.addEventListener('click', function(e) {
if (!input.contains(e.target) && !suggestions.contains(e.target)) {
suggestions.style.display = 'none';
}
});
}
function selectSuggestion(word) {
document.getElementById('word').value = word;
document.getElementById('suggestions').style.display = 'none';
analyzePhrase();
}
// Fuzzy search implementation (from second app)
function fuzzySearch(query, threshold = 0.6) {
const matches = [];
const queryLower = query.toLowerCase();
for (const [phrase, data] of Object.entries(massiveGematriaDictionary)) {
const phraseLower = phrase.toLowerCase();
// Simple fuzzy matching - check if words contain query or vice versa
if (phraseLower.includes(queryLower) || queryLower.includes(phraseLower)) {
matches.push({
word: phrase,
jewish: data.jewish,
english: data.english,
simple: data.simple,
searches: data.searches,
category: data.category,
relevance: calculateRelevance(queryLower, phraseLower)
});
}
}
return matches.sort((a, b) => b.relevance - a.relevance).slice(0, 50);
}
function calculateRelevance(query, phrase) {
if (phrase === query) return 1.0;
if (phrase.startsWith(query)) return 0.9;
if (phrase.includes(query)) return 0.7;
if (query.includes(phrase)) return 0.6;
return 0.5;
}
// Tab functions (from first app)
function openTab(tabId) {
document.querySelectorAll('.tab-content').forEach(tab => tab.classList.remove('active'));
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
document.getElementById(tabId)?.classList.add('active');
document.querySelector(`#btn-${tabId}`)?.classList.add('active');
}
// Calculate example (from second app)
function calculateExample(word) {
document.getElementById('word').value = word;
analyzePhrase();
}
// Dark mode support (from first app)
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
if (event.matches) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
});
// Initialize (combining both apps)
document.addEventListener('DOMContentLoaded', function() {
debugOutput = document.getElementById('debug-output');
debugLog('๐Ÿ“ฑ Advanced Mobile Gematria Analyzer Enhanced Edition initialized');
// Update dictionary count display
document.getElementById('dictionaryCount').textContent = Object.keys(massiveGematriaDictionary).length.toLocaleString();
// Set categories count
const categories = [...new Set(Object.values(massiveGematriaDictionary).map(item => item.category))];
document.getElementById('categoriesCount').textContent = categories.length;
// Setup auto-complete
setupAutoComplete();
// Tab listeners
document.getElementById('btn-search-tab')?.addEventListener('click', () => openTab('search-tab'));
document.getElementById('btn-anagrams-tab')?.addEventListener('click', () => openTab('anagrams-tab'));
document.getElementById('btn-debug-tab')?.addEventListener('click', () => openTab('debug-tab'));
// Main functionality
document.getElementById('analyze-btn')?.addEventListener('click', analyzePhrase);
// Allow Enter key to trigger calculation
document.getElementById('word')?.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
analyzePhrase();
}
});
// Anagram functionality
document.getElementById('load-results-btn')?.addEventListener('click', loadResultsToAnagrams);
document.getElementById('generate-anagrams-btn')?.addEventListener('click', () => {
const text = document.getElementById('anagram-input')?.value || '';
const resultsDiv = document.getElementById('anagram-results');
if (!text.trim()) {
resultsDiv.innerHTML = '<div class="error">๐Ÿ“ฑ Load phrases first!</div>';
return;
}
const phrases = text.split('\n').filter(p => p.trim()).slice(0, 10);
let html = '<h4>๐Ÿ”€ Anagrams from Your Results:</h4>';
phrases.forEach(phrase => {
const words = phrase.trim().split(/\s+/).filter(w => w.length >= 3);
if (words.length > 0) {
const word = words[0]; // Use first significant word
const anagrams = generateAnagrams(word, 15);
html += `
<div class="anagram-result">
<div class="anagram-original">๐Ÿ“ "${phrase}"</div>
<div class="anagram-list">
${anagrams.map(anagram =>
`<span class="anagram-word" onclick="navigator.clipboard?.writeText('${anagram}')">${anagram}</span>`
).join('')}
</div>
</div>
`;
}
});
resultsDiv.innerHTML = html;
});
document.getElementById('caesar-cipher-btn')?.addEventListener('click', () => {
const text = document.getElementById('anagram-input')?.value || '';
if (!text.trim()) return;
const encoded = applyCaesarCipher(text, 3);
document.getElementById('anagram-results').innerHTML = `
<div class="anagram-result">
<div class="anagram-original">๐Ÿ›๏ธ Caesar Cipher (shift 3)</div>
<div style="padding: 10px; background: rgba(156,39,176,0.1); border-radius: 6px; margin-top: 10px;">
<strong>Original:</strong><br>${text}<br><br>
<strong>Encoded:</strong><br>${encoded}
</div>
</div>
`;
});
document.getElementById('reverse-words-btn')?.addEventListener('click', () => {
const text = document.getElementById('anagram-input')?.value || '';
if (!text.trim()) return;
const reversed = reverseWords(text);
document.getElementById('anagram-results').innerHTML = `
<div class="anagram-result">
<div class="anagram-original">โ†ฉ๏ธ Reversed Words</div>
<div style="padding: 10px; background: rgba(33,150,243,0.1); border-radius: 6px; margin-top: 10px;">
<strong>Original:</strong><br>${text}<br><br>
<strong>Reversed:</strong><br>${reversed}
</div>
</div>
`;
});
document.getElementById('pig-latin-btn')?.addEventListener('click', () => {
const text = document.getElementById('anagram-input')?.value || '';
if (!text.trim()) return;
const pigLatin = toPigLatin(text);
document.getElementById('anagram-results').innerHTML = `
<div class="anagram-result">
<div class="anagram-original">๐Ÿท Pig Latin Translation</div>
<div style="padding: 10px; background: rgba(76,175,80,0.1); border-radius: 6px; margin-top: 10px;">
<strong>Original:</strong><br>${text}<br><br>
<strong>Pig Latin:</strong><br>${pigLatin}
</div>
</div>
`;
});
// Debug functionality
document.getElementById('test-proxies-btn')?.addEventListener('click', async () => {
debugLog('๐Ÿ“ฑ Testing all proxies...');
for (const proxyKey of Object.keys(PROXY_CONFIGS)) {
const working = await testProxy(proxyKey);
debugLog(`${proxyKey}: ${working ? 'โœ… Working' : 'โŒ Failed'}`);
}
debugLog('๐Ÿ“ฑ Proxy testing complete');
});
document.getElementById('clear-debug-btn')?.addEventListener('click', () => {
debugOutput.innerHTML = 'System ready for diagnostics...';
});
// Random word suggestion on load
const randomWords = Object.keys(massiveGematriaDictionary);
const randomWord = randomWords[Math.floor(Math.random() * randomWords.length)];
console.log(`๐Ÿ’ก Try searching for: "${randomWord}"`);
debugLog(`๐Ÿ“š Loaded ${Object.keys(massiveGematriaDictionary).length} dictionary entries`);
debugLog(`๐Ÿ” Auto-complete enabled with fuzzy search`);
debugLog(`๐Ÿ“Š Charts and analysis ready`);
});
// Console welcome message for developers
console.log(`
๐Ÿ”ฎ ADVANCED MOBILE GEMATRIA ANALYZER ENHANCED EDITION ๐Ÿ”ฎ
Dictionary Entries: ${Object.keys(massiveGematriaDictionary).length.toLocaleString()}
Categories: ${[...new Set(Object.values(massiveGematriaDictionary).map(item => item.category))].length}
Features:
โœจ 2,500+ Enhanced Dictionary
โœจ Multiple Gematria Systems
โœจ Mobile-Optimized Compact Results
โœจ Cosmic Symbols & Concordance
โœจ Auto-Complete with Fuzzy Search
โœจ Charts & Analysis
โœจ Word Games & Transformations
โœจ Dark Mode Support
Available Console Commands:
- fuzzySearch("term") // Search dictionary
- calculateGematriaValue("text", gematriaSystems.jewish) // Calculate values
`);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment