diff --git a/static/index.html b/static/index.html index ef4ea48..94f84a8 100644 --- a/static/index.html +++ b/static/index.html @@ -114,11 +114,6 @@ z-index: 1; } #highlight .anno { color: #6a5f52; } - .sylcount { - position: absolute; right: 9px; - font-size: 10px; line-height: 1.6; color: #5d5347; - pointer-events: none; - } #editor::selection { background: rgba(232,129,74,0.22); color: transparent; } #stresslayer { pointer-events: none; @@ -294,7 +289,6 @@ Double-click any word to look it up on the right."> -
@@ -371,9 +365,6 @@ allitToggle.addEventListener('change', render); const rhymeToggle = document.getElementById('rhymeToggle'); rhymeToggle.checked = true; rhymeToggle.addEventListener('change', render); -const countsToggle = document.getElementById('countsToggle'); -countsToggle.checked = false; -countsToggle.addEventListener('change', render); const schemeReadout = document.getElementById('schemeReadout'); const COLORS = 12; @@ -596,7 +587,6 @@ function render(){ html += (line ? `${h}` : '') + '\n'; }); highlight.innerHTML = html; - renderCounts(lines); renderStress(lines); highlight.scrollTop = editor.scrollTop; highlight.scrollLeft = editor.scrollLeft; @@ -623,21 +613,6 @@ function cadenceColors(){ return map; } -function renderCounts(lines){ - highlight.querySelectorAll('.sylcount').forEach(el=>el.remove()); - if(!countsToggle.checked || !analysis || !analysis.meter) return; - analysis.meter.forEach(m=>{ - if(analysis.lines[m.l] !== lines[m.l]) return; // line being edited - const mark = highlight.querySelector(`.lmark[data-l="${m.l}"]`); - if(!mark) return; - const d = document.createElement('div'); - d.className = 'sylcount'; - d.textContent = m.syl; - d.style.top = (mark.offsetTop + 5) + 'px'; - highlight.appendChild(d); - }); -} - function renderStress(lines){ if(!stressToggle.checked){ stresslayer.innerHTML = ''; return; } const byLine = {}; @@ -906,7 +881,7 @@ document.getElementById('exportBtn').addEventListener('click', async ()=>{ const probe = document.createElement('canvas').getContext('2d'); probe.font = font; - const w = Math.ceil(Math.max(220, ...lines.map(l=>probe.measureText(l).width)) + PAD * 2 + (countsToggle.checked ? 28 : 0)); + const w = Math.ceil(Math.max(220, ...lines.map(l=>probe.measureText(l).width)) + PAD * 2); const h = Math.ceil(lines.length * LH + PAD * 2 + 18); const canvas = document.createElement('canvas'); canvas.width = w * S; canvas.height = h * S; @@ -955,17 +930,6 @@ document.getElementById('exportBtn').addEventListener('click', async ()=>{ } x.fillStyle = /^\s*[#([]/.test(line) ? '#6a5f52' : ink; x.fillText(line, PAD, y); - if(countsToggle.checked && fresh && analysis.meter){ - const cm = analysis.meter.find(mm=>mm.l===i); - if(cm){ - x.font = "10px 'Spline Sans Mono', monospace"; - x.textAlign = 'right'; - x.fillStyle = '#5d5347'; - x.fillText(String(cm.syl), w - 10, y); - x.textAlign = 'left'; - x.font = font; - } - } if(rhythm && fresh){ const spans = (analysis.stress.filter(s=>s.l===i)).sort((a,b)=>a.s-b.s); x.font = "8px 'Spline Sans Mono', monospace";