fix: pause icon drawn in css instead of a glyph, no more gap
letter-spacing on the ❚❚ glyph could tighten the character cells but not the visible gap between them on a monospace font — each character keeps its own cell regardless. now two bars drawn via ::before/::after on .is-playing, with exact pixel control over the gap; the ▶ span just hides instead of getting replaced.
This commit is contained in:
+6
-2
@@ -37,12 +37,16 @@
|
||||
}
|
||||
function tick() { sync(); raf = requestAnimationFrame(tick); }
|
||||
|
||||
// the pause icon is drawn in CSS (two bars via ::before/::after on
|
||||
// .is-playing), not a "❚❚" glyph — a monospace font's letter-spacing
|
||||
// between two heavy-bar characters left a gap no amount of
|
||||
// letter-spacing closed cleanly. the ▶ span just hides/shows.
|
||||
v.addEventListener("play", function () {
|
||||
root.classList.add("is-playing"); if (play) play.textContent = "❚❚";
|
||||
root.classList.add("is-playing");
|
||||
if (!raf) raf = requestAnimationFrame(tick);
|
||||
});
|
||||
v.addEventListener("pause", function () {
|
||||
root.classList.remove("is-playing"); if (play) play.textContent = "▶";
|
||||
root.classList.remove("is-playing");
|
||||
if (raf) { cancelAnimationFrame(raf); raf = null; }
|
||||
sync(); // one last sync so the bar lands exactly on the paused frame
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user