mirror of
https://github.com/kennethreitz/rhymepad.org.git
synced 2026-06-11 17:08:33 +00:00
Soften sub-word highlight: full fill, faint tail underline
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-5
@@ -635,17 +635,18 @@ function render(){
|
||||
const t = (w && (focusGid === null || w.g === focusGid)) ? w
|
||||
: (p && (focusGid === null || p.g === focusGid)) ? p
|
||||
: (w || p);
|
||||
let alpha = !t.ph ? (t.end ? 28 : 16) : (t.end ? 20 : 12);
|
||||
let alpha = !t.ph ? (t.end ? 34 : 19) : (t.end ? 24 : 14);
|
||||
if(t.slant) alpha = Math.round(alpha * 0.62); // slant sits back
|
||||
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
|
||||
}
|
||||
style += `background:color-mix(in srgb, ${colorOf(t)} ${alpha}%, transparent);`;
|
||||
// bright underline on the rhyming tail (rs..e) of a word
|
||||
if(w && (w.rs == null || a >= w.rs)){
|
||||
const u = w.slant ? 55 : 80;
|
||||
shadows.push(`inset 0 -2px 0 0 color-mix(in srgb, ${colorOf(w)} ${u}%, transparent)`);
|
||||
// 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;
|
||||
shadows.push(`inset 0 -1.5px 0 0 color-mix(in srgb, ${colorOf(w)} ${u}%, transparent)`);
|
||||
}
|
||||
}else if(op){
|
||||
style += `background:color-mix(in srgb, var(--ink-dim) 13%, transparent);`;
|
||||
|
||||
Reference in New Issue
Block a user