A Pen by mode-mercury on CodePen.
Created
October 14, 2025 19:21
-
-
Save mode-mercury/10387818cf4d69dce5fd0d42678cd345 to your computer and use it in GitHub Desktop.
Untitled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Nexus Analyzer Pro</title> | |
| <style> | |
| :root { | |
| --primary: #6366f1; | |
| --primary-dark: #4f46e5; | |
| --secondary: #10b981; | |
| --accent: #f59e0b; | |
| --danger: #ef4444; | |
| --dark: #1f2937; | |
| --light: #f8fafc; | |
| --gray: #6b7280; | |
| --card-bg: #ffffff; | |
| --sidebar-bg: #f8fafc; | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: var(--dark); | |
| min-height: 100vh; | |
| padding: 20px; | |
| } | |
| .app-container { | |
| max-width: 1400px; | |
| margin: 0 auto; | |
| } | |
| /* Header Section */ | |
| .header-section { | |
| background: var(--card-bg); | |
| border-radius: 16px; | |
| padding: 24px; | |
| box-shadow: 0 10px 25px rgba(0,0,0,0.1); | |
| margin-bottom: 24px; | |
| } | |
| .logo { | |
| text-align: center; | |
| margin-bottom: 20px; | |
| } | |
| .logo h1 { | |
| font-size: 2rem; | |
| font-weight: 700; | |
| color: var(--primary); | |
| margin-bottom: 4px; | |
| } | |
| .logo p { | |
| color: var(--gray); | |
| font-size: 1rem; | |
| } | |
| .input-container { | |
| margin-bottom: 20px; | |
| } | |
| .main-textarea { | |
| width: 100%; | |
| height: 80px; | |
| padding: 16px; | |
| border: 2px solid #e5e7eb; | |
| border-radius: 12px; | |
| resize: vertical; | |
| font-size: 1rem; | |
| transition: all 0.3s ease; | |
| font-family: inherit; | |
| } | |
| .main-textarea:focus { | |
| outline: none; | |
| border-color: var(--primary); | |
| box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); | |
| } | |
| .controls-row { | |
| display: flex; | |
| gap: 20px; | |
| flex-wrap: wrap; | |
| justify-content: center; | |
| } | |
| .toggle-group { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| background: var(--sidebar-bg); | |
| padding: 10px 16px; | |
| border-radius: 8px; | |
| } | |
| .toggle-label { | |
| font-size: 0.875rem; | |
| font-weight: 500; | |
| white-space: nowrap; | |
| } | |
| .switch { | |
| position: relative; | |
| display: inline-block; | |
| width: 44px; | |
| height: 24px; | |
| } | |
| .switch input { | |
| opacity: 0; | |
| width: 0; | |
| height: 0; | |
| } | |
| .slider { | |
| position: absolute; | |
| cursor: pointer; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background-color: #d1d5db; | |
| transition: .4s; | |
| border-radius: 24px; | |
| } | |
| .slider:before { | |
| position: absolute; | |
| content: ""; | |
| height: 18px; | |
| width: 18px; | |
| left: 3px; | |
| bottom: 3px; | |
| background-color: white; | |
| transition: .4s; | |
| border-radius: 50%; | |
| } | |
| input:checked + .slider { | |
| background-color: var(--primary); | |
| } | |
| input:checked + .slider:before { | |
| transform: translateX(20px); | |
| } | |
| /* Main Content Grid */ | |
| .main-grid { | |
| display: grid; | |
| grid-template-columns: 1fr 1fr; | |
| gap: 20px; | |
| } | |
| @media (max-width: 1024px) { | |
| .main-grid { | |
| grid-template-columns: 1fr; | |
| } | |
| } | |
| /* Metrics Overview - Compact */ | |
| .metrics-compact { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); | |
| gap: 12px; | |
| margin-bottom: 20px; | |
| } | |
| .metric-compact { | |
| background: var(--card-bg); | |
| padding: 16px; | |
| border-radius: 12px; | |
| box-shadow: 0 4px 6px rgba(0,0,0,0.05); | |
| text-align: center; | |
| border-left: 4px solid var(--primary); | |
| } | |
| .metric-compact.structural { border-left-color: #10b981; } | |
| .metric-compact.linguistic { border-left-color: #f59e0b; } | |
| .metric-compact.gematria { border-left-color: #ef4444; } | |
| .metric-compact.composite { border-left-color: #8b5cf6; } | |
| .metric-compact.ngram { border-left-color: #ec4899; } | |
| .metric-value-compact { | |
| font-size: 1.25rem; | |
| font-weight: 700; | |
| color: var(--dark); | |
| margin-bottom: 4px; | |
| } | |
| .metric-label-compact { | |
| font-size: 0.75rem; | |
| color: var(--gray); | |
| font-weight: 500; | |
| } | |
| /* Analysis Sections - Compact */ | |
| .analysis-compact { | |
| background: var(--card-bg); | |
| border-radius: 12px; | |
| padding: 20px; | |
| box-shadow: 0 4px 6px rgba(0,0,0,0.05); | |
| height: fit-content; | |
| } | |
| .section-header-compact { | |
| display: flex; | |
| align-items: center; | |
| margin-bottom: 16px; | |
| padding-bottom: 12px; | |
| border-bottom: 2px solid #f1f5f9; | |
| } | |
| .section-header-compact h3 { | |
| font-size: 1.1rem; | |
| font-weight: 600; | |
| color: var(--dark); | |
| } | |
| .section-badge-compact { | |
| background: var(--primary); | |
| color: white; | |
| padding: 2px 8px; | |
| border-radius: 6px; | |
| font-size: 0.7rem; | |
| font-weight: 600; | |
| margin-left: 10px; | |
| } | |
| /* N-gram Display - Compact */ | |
| .ngram-grid-compact { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); | |
| gap: 8px; | |
| margin-top: 12px; | |
| } | |
| .ngram-item-compact { | |
| background: #f8fafc; | |
| padding: 8px; | |
| border-radius: 6px; | |
| border-left: 3px solid #ec4899; | |
| font-size: 0.75rem; | |
| } | |
| .ngram-text-compact { | |
| font-weight: 600; | |
| margin-bottom: 2px; | |
| } | |
| .ngram-score-compact { | |
| color: var(--gray); | |
| font-size: 0.7rem; | |
| } | |
| .ngram-type-compact { | |
| display: inline-block; | |
| background: #ec4899; | |
| color: white; | |
| padding: 1px 4px; | |
| border-radius: 4px; | |
| font-size: 0.65rem; | |
| margin-right: 4px; | |
| } | |
| /* Transformation Display - Compact */ | |
| .transform-list-compact { | |
| max-height: 200px; | |
| overflow-y: auto; | |
| margin-top: 12px; | |
| } | |
| .transform-item-compact { | |
| padding: 8px; | |
| margin-bottom: 6px; | |
| background: #f8fafc; | |
| border-radius: 6px; | |
| border-left: 3px solid var(--primary); | |
| font-size: 0.8rem; | |
| } | |
| .transform-original-compact { | |
| font-weight: 600; | |
| color: var(--dark); | |
| margin-bottom: 2px; | |
| } | |
| .transform-replacement-compact { | |
| color: var(--primary); | |
| font-weight: 500; | |
| font-size: 0.75rem; | |
| } | |
| /* Dictionary Display - Compact */ | |
| .dict-list-compact { | |
| max-height: 150px; | |
| overflow-y: auto; | |
| margin-top: 12px; | |
| } | |
| .dict-item-compact { | |
| padding: 6px 8px; | |
| margin-bottom: 4px; | |
| background: #f8fafc; | |
| border-radius: 4px; | |
| font-size: 0.75rem; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .dict-word-compact { | |
| font-weight: 600; | |
| color: var(--dark); | |
| } | |
| .dict-gematria-compact { | |
| color: var(--primary); | |
| font-weight: 500; | |
| font-size: 0.7rem; | |
| } | |
| /* Word Analysis - Compact */ | |
| .word-analysis-compact { | |
| display: grid; | |
| grid-template-columns: 1fr 1fr; | |
| gap: 12px; | |
| margin-top: 12px; | |
| } | |
| .word-column-compact { | |
| background: #f8fafc; | |
| border-radius: 6px; | |
| padding: 12px; | |
| } | |
| .word-column-compact h4 { | |
| font-size: 0.8rem; | |
| color: var(--gray); | |
| margin-bottom: 8px; | |
| text-align: center; | |
| } | |
| .word-item-compact { | |
| display: flex; | |
| justify-content: space-between; | |
| padding: 4px 0; | |
| font-size: 0.75rem; | |
| border-bottom: 1px solid #e5e7eb; | |
| } | |
| .word-item-compact:last-child { | |
| border-bottom: none; | |
| } | |
| .word-name-compact { | |
| font-weight: 500; | |
| } | |
| .word-value-compact { | |
| color: var(--primary); | |
| font-weight: 600; | |
| } | |
| /* Scrollbar Styling */ | |
| .transform-list-compact::-webkit-scrollbar, | |
| .dict-list-compact::-webkit-scrollbar { | |
| width: 6px; | |
| } | |
| .transform-list-compact::-webkit-scrollbar-track, | |
| .dict-list-compact::-webkit-scrollbar-track { | |
| background: #f1f5f9; | |
| border-radius: 3px; | |
| } | |
| .transform-list-compact::-webkit-scrollbar-thumb, | |
| .dict-list-compact::-webkit-scrollbar-thumb { | |
| background: #cbd5e1; | |
| border-radius: 3px; | |
| } | |
| .transform-list-compact::-webkit-scrollbar-thumb:hover, | |
| .dict-list-compact::-webkit-scrollbar-thumb:hover { | |
| background: #94a3b8; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="app-container"> | |
| <!-- Header with Text Input --> | |
| <div class="header-section"> | |
| <div class="logo"> | |
| <h1>Nexus Analyzer Pro</h1> | |
| <p>Multi-Dimensional Text Analysis</p> | |
| </div> | |
| <div class="input-container"> | |
| <textarea class="main-textarea" id="text-input" placeholder="Enter your text here for complete analysis..."></textarea> | |
| </div> | |
| <div class="controls-row"> | |
| <div class="toggle-group"> | |
| <span class="toggle-label">Spell Out Characters</span> | |
| <label class="switch"> | |
| <input type="checkbox" id="spell-toggle"> | |
| <span class="slider"></span> | |
| </label> | |
| </div> | |
| <div class="toggle-group"> | |
| <span class="toggle-label">N-gram Analysis</span> | |
| <label class="switch"> | |
| <input type="checkbox" id="ngram-toggle" checked> | |
| <span class="slider"></span> | |
| </label> | |
| </div> | |
| <div class="toggle-group"> | |
| <span class="toggle-label">Show Transformations</span> | |
| <label class="switch"> | |
| <input type="checkbox" id="transform-toggle" checked> | |
| <span class="slider"></span> | |
| </label> | |
| </div> | |
| <div class="toggle-group"> | |
| <span class="toggle-label">Dictionary Lookup</span> | |
| <label class="switch"> | |
| <input type="checkbox" id="dict-toggle" checked> | |
| <span class="slider"></span> | |
| </label> | |
| </div> | |
| </div> | |
| <!-- Compact Metrics --> | |
| <div class="metrics-compact"> | |
| <div class="metric-compact structural"> | |
| <div class="metric-value-compact" id="structural-score">0</div> | |
| <div class="metric-label-compact">Structural</div> | |
| </div> | |
| <div class="metric-compact linguistic"> | |
| <div class="metric-value-compact" id="linguistic-score">0</div> | |
| <div class="metric-label-compact">Linguistic</div> | |
| </div> | |
| <div class="metric-compact gematria"> | |
| <div class="metric-value-compact" id="gematria-score">0</div> | |
| <div class="metric-label-compact">Gematria</div> | |
| </div> | |
| <div class="metric-compact ngram"> | |
| <div class="metric-value-compact" id="ngram-score">0</div> | |
| <div class="metric-label-compact">N-gram</div> | |
| </div> | |
| <div class="metric-compact composite"> | |
| <div class="metric-value-compact" id="composite-score">0.00</div> | |
| <div class="metric-label-compact">Composite</div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Analysis Grid --> | |
| <div class="main-grid"> | |
| <!-- Left Column --> | |
| <div class="left-column"> | |
| <!-- N-gram Analysis --> | |
| <div class="analysis-compact"> | |
| <div class="section-header-compact"> | |
| <h3>N-gram Patterns</h3> | |
| <div class="section-badge-compact">LIVE</div> | |
| </div> | |
| <div class="ngram-grid-compact" id="ngram-results"> | |
| <!-- N-grams will appear here --> | |
| </div> | |
| </div> | |
| <!-- Word Analysis --> | |
| <div class="analysis-compact"> | |
| <div class="section-header-compact"> | |
| <h3>Word Analysis</h3> | |
| <div class="section-badge-compact">COMPARISON</div> | |
| </div> | |
| <div class="word-analysis-compact"> | |
| <div class="word-column-compact"> | |
| <h4>Complex Words</h4> | |
| <div id="complex-words"> | |
| <!-- Complex words will appear here --> | |
| </div> | |
| </div> | |
| <div class="word-column-compact"> | |
| <h4>Dictionary Matches</h4> | |
| <div id="core-matches"> | |
| <!-- Core matches will appear here --> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Right Column --> | |
| <div class="right-column"> | |
| <!-- Transformations --> | |
| <div class="analysis-compact"> | |
| <div class="section-header-compact"> | |
| <h3>Transformations</h3> | |
| <div class="section-badge-compact">GEMATRIA</div> | |
| </div> | |
| <div class="transform-list-compact" id="transformation-output"> | |
| <!-- Transformations will appear here --> | |
| </div> | |
| </div> | |
| <!-- Dictionary --> | |
| <div class="analysis-compact"> | |
| <div class="section-header-compact"> | |
| <h3>Dictionary</h3> | |
| <div class="section-badge-compact">500+ WORDS</div> | |
| </div> | |
| <div class="dict-list-compact" id="dictionary-output"> | |
| <!-- Dictionary matches will appear here --> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // All the same JavaScript code from previous version goes here | |
| // (The massive dictionary, n-gram functions, transformation logic, etc.) | |
| // I'm including the core functions but shortened for brevity | |
| const EXPANDED_LINGUISTIC_DB = ["I", "YOU", "WE", "THIS", "THAT", "WHO", "WHAT", "MAN", "WOMAN", "PERSON", /* ... 500+ words ... */]; | |
| const DIPHTHONG_REPLACEMENTS = { | |
| "AE": ["AI", "AY", "EI", "EY"], "AI": ["AE", "AY", "EI", "EY"], | |
| "AU": ["AW", "OU", "OW"], "AW": ["AU", "OU", "OW"], | |
| "EA": ["EE", "EI", "IE"], "EE": ["EA", "EI", "IE"], | |
| // ... all your existing replacement patterns ... | |
| }; | |
| const NGRAM_SCORING = { | |
| unigram: { base: 1, multiplier: 1 }, bigram: { base: 3, multiplier: 2 }, | |
| trigram: { base: 6, multiplier: 3 }, tetragram: { base: 10, multiplier: 4 } | |
| }; | |
| const CHAR_DB = { | |
| 'A': { L: 18, EG: 1 }, 'B': { L: 15, EG: 2 }, 'C': { L: 8, EG: 3 }, | |
| // ... all character data ... | |
| }; | |
| function calculateGematria(text) { | |
| return text.toUpperCase().split('').reduce((sum, char) => { | |
| return sum + (CHAR_DB[char]?.EG || 0); | |
| }, 0); | |
| } | |
| function findGematriaPreservingReplacements(text) { | |
| const originalGematria = calculateGematria(text); | |
| const replacements = []; | |
| for (const [diphthong, alternatives] of Object.entries(DIPHTHONG_REPLACEMENTS)) { | |
| if (text.toUpperCase().includes(diphthong)) { | |
| for (const replacement of alternatives) { | |
| const newText = text.toUpperCase().replace(diphthong, replacement); | |
| const newGematria = calculateGematria(newText); | |
| if (newGematria === originalGematria) { | |
| replacements.push({ | |
| original: diphthong, | |
| replacement: replacement, | |
| score: diphthong.length * 2 | |
| }); | |
| } | |
| } | |
| } | |
| } | |
| return replacements; | |
| } | |
| function detectNGrams(text, maxN = 4) { | |
| const ngrams = { unigrams: new Map(), bigrams: new Map(), trigrams: new Map(), tetragrams: new Map() }; | |
| const cleanText = text.toUpperCase().replace(/[^A-Z]/g, ''); | |
| for (let char of cleanText) { | |
| ngrams.unigrams.set(char, (ngrams.unigrams.get(char) || 0) + 1); | |
| } | |
| for (let i = 0; i < cleanText.length - 1; i++) { | |
| const bigram = cleanText.substr(i, 2); | |
| if (bigram.length === 2) ngrams.bigrams.set(bigram, (ngrams.bigrams.get(bigram) || 0) + 1); | |
| } | |
| for (let i = 0; i < cleanText.length - 2; i++) { | |
| const trigram = cleanText.substr(i, 3); | |
| if (trigram.length === 3) ngrams.trigrams.set(trigram, (ngrams.trigrams.get(trigram) || 0) + 1); | |
| } | |
| for (let i = 0; i < cleanText.length - 3; i++) { | |
| const tetragram = cleanText.substr(i, 4); | |
| if (tetragram.length === 4) ngrams.tetragrams.set(tetragram, (ngrams.tetragrams.get(tetragram) || 0) + 1); | |
| } | |
| return ngrams; | |
| } | |
| function calculateNGramScores(ngrams) { | |
| let totalScore = 0; | |
| const scoredNGrams = []; | |
| for (let [gram, count] of ngrams.unigrams) { | |
| const score = NGRAM_SCORING.unigram.base * NGRAM_SCORING.unigram.multiplier * count; | |
| totalScore += score; | |
| scoredNGrams.push({ text: gram, type: 'unigram', count, totalScore: score }); | |
| } | |
| for (let [gram, count] of ngrams.bigrams) { | |
| const score = NGRAM_SCORING.bigram.base * NGRAM_SCORING.bigram.multiplier * count; | |
| totalScore += score; | |
| scoredNGrams.push({ text: gram, type: 'bigram', count, totalScore: score }); | |
| } | |
| for (let [gram, count] of ngrams.trigrams) { | |
| const score = NGRAM_SCORING.trigram.base * NGRAM_SCORING.trigram.multiplier * count; | |
| totalScore += score; | |
| scoredNGrams.push({ text: gram, type: 'trigram', count, totalScore: score }); | |
| } | |
| for (let [gram, count] of ngrams.tetragrams) { | |
| const score = NGRAM_SCORING.tetragram.base * NGRAM_SCORING.tetragram.multiplier * count; | |
| totalScore += score; | |
| scoredNGrams.push({ text: gram, type: 'tetragram', count, totalScore: score }); | |
| } | |
| scoredNGrams.sort((a, b) => b.totalScore - a.totalScore); | |
| return { totalScore, ngrams: scoredNGrams }; | |
| } | |
| function displayNGramResults(ngramResults) { | |
| const container = document.getElementById('ngram-results'); | |
| container.innerHTML = ''; | |
| const topNGrams = ngramResults.ngrams.slice(0, 8); | |
| topNGrams.forEach(ngram => { | |
| const ngramEl = document.createElement('div'); | |
| ngramEl.className = 'ngram-item-compact'; | |
| ngramEl.innerHTML = ` | |
| <div class="ngram-text-compact"> | |
| <span class="ngram-type-compact">${ngram.type.charAt(0).toUpperCase()}</span> | |
| ${ngram.text} | |
| </div> | |
| <div class="ngram-score-compact">${ngram.totalScore}</div> | |
| `; | |
| container.appendChild(ngramEl); | |
| }); | |
| document.getElementById('ngram-score').textContent = ngramResults.totalScore; | |
| } | |
| function displayTransformations(text) { | |
| const container = document.getElementById('transformation-output'); | |
| container.innerHTML = ''; | |
| const words = text.toUpperCase().split(/\s+/).filter(word => word.length > 0); | |
| words.forEach(word => { | |
| if (word.length >= 2) { | |
| const replacements = findGematriaPreservingReplacements(word); | |
| if (replacements.length > 0) { | |
| const item = document.createElement('div'); | |
| item.className = 'transform-item-compact'; | |
| const rep = replacements[0]; | |
| const newWord = word.replace(rep.original, rep.replacement); | |
| item.innerHTML = ` | |
| <div class="transform-original-compact">${word}</div> | |
| <div class="transform-replacement-compact">→ ${newWord}</div> | |
| `; | |
| container.appendChild(item); | |
| } | |
| } | |
| }); | |
| if (container.children.length === 0) { | |
| container.innerHTML = '<div class="transform-item-compact">No transformations found</div>'; | |
| } | |
| } | |
| function displayDictionaryMatches(text) { | |
| const container = document.getElementById('dictionary-output'); | |
| container.innerHTML = ''; | |
| const words = text.toUpperCase().split(/\s+/).filter(word => word.length > 2); | |
| const matches = []; | |
| words.forEach(word => { | |
| EXPANDED_LINGUISTIC_DB.forEach(dictWord => { | |
| if (dictWord.includes(word) || word.includes(dictWord)) { | |
| const gematria = calculateGematria(dictWord); | |
| matches.push({ word: dictWord, gematria: gematria }); | |
| } | |
| }); | |
| }); | |
| matches.sort((a, b) => b.word.length - a.word.length).slice(0, 8).forEach(match => { | |
| const item = document.createElement('div'); | |
| item.className = 'dict-item-compact'; | |
| item.innerHTML = ` | |
| <span class="dict-word-compact">${match.word}</span> | |
| <span class="dict-gematria-compact">${match.gematria}</span> | |
| `; | |
| container.appendChild(item); | |
| }); | |
| if (container.children.length === 0) { | |
| container.innerHTML = '<div class="dict-item-compact">No matches found</div>'; | |
| } | |
| } | |
| function updateWordAnalysis(text) { | |
| const complexContainer = document.getElementById('complex-words'); | |
| const matchesContainer = document.getElementById('core-matches'); | |
| const words = text.toUpperCase().split(/\s+/).filter(word => word.length > 0); | |
| const complexWords = words.map(word => ({ word, length: word.length })) | |
| .sort((a, b) => b.length - a.length).slice(0, 5); | |
| complexContainer.innerHTML = ''; | |
| complexWords.forEach(item => { | |
| const el = document.createElement('div'); | |
| el.className = 'word-item-compact'; | |
| el.innerHTML = ` | |
| <span class="word-name-compact">${item.word}</span> | |
| <span class="word-value-compact">${item.length}</span> | |
| `; | |
| complexContainer.appendChild(el); | |
| }); | |
| matchesContainer.innerHTML = ''; | |
| const matches = EXPANDED_LINGUISTIC_DB.filter(word => | |
| words.some(w => word.includes(w) || w.includes(word)) | |
| ).slice(0, 5); | |
| matches.forEach(word => { | |
| const el = document.createElement('div'); | |
| el.className = 'word-item-compact'; | |
| el.innerHTML = ` | |
| <span class="word-name-compact">${word}</span> | |
| <span class="word-value-compact">${calculateGematria(word)}</span> | |
| `; | |
| matchesContainer.appendChild(el); | |
| }); | |
| } | |
| function analyzeText() { | |
| const text = document.getElementById('text-input').value; | |
| const useNGrams = document.getElementById('ngram-toggle').checked; | |
| const useTransform = document.getElementById('transform-toggle').checked; | |
| const useDict = document.getElementById('dict-toggle').checked; | |
| // Update basic metrics | |
| document.getElementById('structural-score').textContent = text.length * 2; | |
| document.getElementById('linguistic-score').textContent = Math.round(text.length * 1.5); | |
| document.getElementById('gematria-score').textContent = calculateGematria(text); | |
| document.getElementById('composite-score').textContent = (text.length * 3.5).toFixed(1); | |
| if (!text.trim()) { | |
| document.getElementById('ngram-results').innerHTML = '<div class="ngram-item-compact">Enter text</div>'; | |
| document.getElementById('transformation-output').innerHTML = '<div class="transform-item-compact">Enter text</div>'; | |
| document.getElementById('dictionary-output').innerHTML = '<div class="dict-item-compact">Enter text</div>'; | |
| return; | |
| } | |
| if (useNGrams) { | |
| const ngrams = detectNGrams(text); | |
| const ngramScores = calculateNGramScores(ngrams); | |
| displayNGramResults(ngramScores); | |
| } | |
| if (useTransform) displayTransformations(text); | |
| if (useDict) displayDictionaryMatches(text); | |
| updateWordAnalysis(text); | |
| } | |
| // Event listeners | |
| document.getElementById('text-input').addEventListener('input', analyzeText); | |
| document.getElementById('ngram-toggle').addEventListener('change', analyzeText); | |
| document.getElementById('transform-toggle').addEventListener('change', analyzeText); | |
| document.getElementById('dict-toggle').addEventListener('change', analyzeText); | |
| document.getElementById('spell-toggle').addEventListener('change', analyzeText); | |
| // Initialize | |
| analyzeText(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment