From a973f35e209edbb7f564b6b225cd74009f725991 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 8 Jun 2026 03:26:43 -0400 Subject: [PATCH] Per-word brightness: anchors glow, slant attachments whisper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Strength is now per token, not per family — a word that only slant- matches its family (placement riding creation/elation's -ation core) caps at 0.6 while the perfect anchors stay at 1.0. The gradient now lives within a single color, showing each word's own grip on the rhyme. Co-Authored-By: Claude Opus 4.8 (1M context) --- app.py | 7 ++++++- static/index.html | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 17d8162..e73c565 100644 --- a/app.py +++ b/app.py @@ -1325,9 +1325,14 @@ def analyze(draft: Draft): for t in [*tokens, *phrases]: if t["gid"] is None: continue + gstr = groups_out[t["gid"]]["strength"] + # a member that only slant-matches its family glows less than the + # anchors that define it + tstr = min(gstr, 0.6) if t["slant"] else gstr d = {"l": t["line"], "s": t["start"], "e": t["end"], "g": t["gid"], "end": t["is_end"], "ph": "vowels" in t, - "slant": t["slant"] or groups_out[t["gid"]]["slant"]} + "slant": t["slant"] or groups_out[t["gid"]]["slant"], + "str": round(tstr, 2)} if "vowels" not in t: # single word: where its rhyming tail starts d["rs"] = t["start"] + rhyme_char_start(t["word"]) toks_out.append(d) diff --git a/static/index.html b/static/index.html index 2b8a0b2..9594913 100644 --- a/static/index.html +++ b/static/index.html @@ -636,8 +636,8 @@ function render(){ : (p && (focusGid === null || p.g === focusGid)) ? p : (w || p); let alpha = !t.ph ? (t.end ? 34 : 19) : (t.end ? 24 : 14); - const str = (groupInfo[t.g] && groupInfo[t.g].strength) || 1; - alpha = Math.round(alpha * (0.45 + 0.55 * str)); // brightness = rhyme strength + const str = t.str != null ? t.str : ((groupInfo[t.g] && groupInfo[t.g].strength) || 1); + alpha = Math.round(alpha * (0.4 + 0.6 * str)); // brightness = this word's rhyme strength if(focusGid !== null && t.g === focusGid){ alpha = Math.min(85, Math.round(alpha * 2.8)); style += 'color:#1a120c;font-weight:600;'; // dark ink on the lit chip @@ -646,7 +646,7 @@ function render(){ // faint underline on the rhyming tail (rs..e) of a word — a // whisper of precision under the full-word fill if(w && w.rs != null && a >= w.rs){ - const u = Math.round(42 * ((groupInfo[w.g] && groupInfo[w.g].strength) || 1)); + const u = Math.round(42 * (w.str != null ? w.str : 1)); shadows.push(`inset 0 -1.5px 0 0 color-mix(in srgb, ${colorOf(w)} ${u}%, transparent)`); } }else if(op){