MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / seek

Function seek

static/mobile/app.js:816–824  ·  view source on GitHub ↗
(cx)

Source from the content-addressed store, hash-verified

814 const rect = bars.getBoundingClientRect();
815 const head = bars.querySelector(".playhead");
816 const seek = (cx) => {
817 const frac = Math.max(0, Math.min(1, (cx - rect.left) / rect.width));
818 if (head) head.style.left = frac * 100 + "%";
819 const cur = app.querySelector(".wave-times .cur");
820 if (cur) cur.textContent = fmt(frac * curDuration());
821 state.progress = frac;
822 paintWaveProgress();
823 seekToFraction(frac);
824 };
825 seek(e.clientX);
826 bars.setPointerCapture(e.pointerId);
827 const mv = (ev) => seek(ev.clientX);

Callers 2

wireFadersFunction · 0.70
mvFunction · 0.70

Calls 4

fmtFunction · 0.85
curDurationFunction · 0.85
paintWaveProgressFunction · 0.85
seekToFractionFunction · 0.85

Tested by

no test coverage detected