Spaces:
Sleeping
Sleeping
Commit ·
dbd5035
1
Parent(s): 13e8a7a
refined player.
Browse filesFiles changed (2)
- web/score-player.css+13-1
- web/score-player.js+14-3
24 unmodified lines25262728293050 unmodified lines8182838485868724 unmodified lines}.ls-status.ls-busy { color: #2b7; }.ls-status.ls-err { color: #c0392b; }.ls-svg {background: #fff;50 unmodified linesalign-items: center;gap: 10px;padding: 8px 12px;margin-top: 8px;background: #f3f3f5;border: 1px solid #e5e5e5;border-radius: 8px;24 unmodified lines25262728293031323334353637383940414250 unmodified lines9394959697989924 unmodified lines}.ls-status.ls-busy { color: #2b7; }.ls-status.ls-err { color: #c0392b; }/* multi-line parse errors: preserve the caret alignment, wrap overflow. The redcolor needs !important to beat Gradio's `.prose * { color: ... }`, which setscolor directly on every descendant (so `color: inherit` from .ls-err loses). */.ls-status.ls-err .ls-err-pre {margin: 0;font-family: ui-monospace, Consolas, Monaco, monospace;font-size: 11px;line-height: 1.35;white-space: pre-wrap;word-break: break-word;color: #c0392b !important;}.ls-svg {background: #fff;50 unmodified linesalign-items: center;gap: 10px;padding: 8px 12px;margin-bottom: 8px;background: #f3f3f5;border: 1px solid #e5e5e5;border-radius: 8px;
105 unmodified lines106107108109110111112113261 unmodified lines3753763773783793803812 unmodified lines384385386387388389390105 unmodified linesfunction setStatus (text, kind) {if (!els.status) return;els.status.textContent = text || '';els.status.className = 'ls-status' + (kind ? ' ls-' + kind : '');}// Render lyl -> SVG. Returns true on success. Does NOT touch the MIDI player261 unmodified linessvgBox.appendChild(cursor);wrap.appendChild(status); wrap.appendChild(svgBox);// transport barconst player = document.createElement('div'); player.className = 'ls-player'; player.style.display = 'none';player.innerHTML ='<button class="ls-btn ls-play" title="Play">▶</button>' +2 unmodified lines'<span class="ls-time">0:00 / 0:00</span>' +'<div class="ls-progress"><div class="ls-fill"></div></div>';root.appendChild(wrap); root.appendChild(player);els.root = root; els.svg = svgBox; els.preview = wrap; els.status = status; els.player = player; els.cursor = cursor;els.playBtn = player.querySelector('.ls-play');105 unmodified lines106107108109110111112113114115116117118119120121122123124261 unmodified lines3863873883893903913922 unmodified lines395396397398399400401105 unmodified linesfunction setStatus (text, kind) {if (!els.status) return;els.status.className = 'ls-status' + (kind ? ' ls-' + kind : '');// Errors (esp. lilylet parse errors) are multi-line with a `^` caret aligned// under the offending token — wrap them in <pre> so the whitespace/newlines// are preserved (a plain div collapses them). textContent keeps it XSS-safe.if (kind === 'err' && text) {els.status.innerHTML = '';const pre = document.createElement('pre');pre.className = 'ls-err-pre';pre.textContent = text;els.status.appendChild(pre);} else {els.status.textContent = text || '';}}// Render lyl -> SVG. Returns true on success. Does NOT touch the MIDI player261 unmodified linessvgBox.appendChild(cursor);wrap.appendChild(status); wrap.appendChild(svgBox);// transport bar (above the score)const player = document.createElement('div'); player.className = 'ls-player'; player.style.display = 'none';player.innerHTML ='<button class="ls-btn ls-play" title="Play">▶</button>' +2 unmodified lines'<span class="ls-time">0:00 / 0:00</span>' +'<div class="ls-progress"><div class="ls-fill"></div></div>';root.appendChild(player); root.appendChild(wrap);els.root = root; els.svg = svgBox; els.preview = wrap; els.status = status; els.player = player; els.cursor = cursor;els.playBtn = player.querySelector('.ls-play');
web/score-player.css+13-1
web/score-player.js+14-3