diff --git a/app.py b/app.py index e280712..17d8162 100644 --- a/app.py +++ b/app.py @@ -1258,8 +1258,15 @@ def analyze(draft: Draft): usage[color] += 1 chosen.append(color) sound = re.sub(r"^[a-z0-9]+:", "", g["key"]).replace("|", " ").lower() + k = g["key"] + strength = (1.0 if k.startswith("p:") # perfect rime + else 0.82 if k.startswith("m:") # multisyllabic run + else 0.7 if k.startswith("m2:") # consonant-backed + else 0.6 if k.startswith("v:") # vowel slant + else 0.55 if k.startswith("c:") # consonance + else 0.5) # weak ending groups_out.append({"id": gid, "color": color, "slant": g["slant"], - "sound": sound}) + "sound": sound, "strength": round(strength, 2)}) # stanza rhyme schemes from line-ending groups: the token covering # the most of the line's tail owns the slot — Em rhymes "-cock it", diff --git a/static/index.html b/static/index.html index a1a0342..2b8a0b2 100644 --- a/static/index.html +++ b/static/index.html @@ -636,7 +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); - if(t.slant) alpha = Math.round(alpha * 0.62); // slant sits back + const str = (groupInfo[t.g] && groupInfo[t.g].strength) || 1; + alpha = Math.round(alpha * (0.45 + 0.55 * str)); // brightness = 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 @@ -645,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 = w.slant ? 28 : 42; + const u = Math.round(42 * ((groupInfo[w.g] && groupInfo[w.g].strength) || 1)); shadows.push(`inset 0 -1.5px 0 0 color-mix(in srgb, ${colorOf(w)} ${u}%, transparent)`); } }else if(op){