Spaces:
Running
Running
File size: 1,374 Bytes
29e537c | 1 2 3 4 5 6 7 8 9 10 11 | <!doctype html><meta charset="utf-8"><body style="margin:0;background:#000"><canvas id="c"></canvas>
<script src="../data/matches.js"></script><script src="../js/voice-data.js"></script><script src="../js/pix.js"></script><script src="../js/story.js"></script><script src="../js/stage.js"></script><script src="../js/fonts.js"></script>
<script>
window.ready = loadPixelFont('../');
const C = () => document.getElementById('c');
window.snap = async (t, mode) => { await ready; const L = STAGE.LAYOUTS[mode]; const c = C(); c.width = L.W; c.height = L.H; STAGE.render(c.getContext('2d'), t, mode, {}); return c.toDataURL('image/jpeg', .85); };
window.cover = async (mode) => { await ready; const L = STAGE.LAYOUTS[mode]; const c = C(); c.width = L.W; c.height = L.H; STAGE.cover(c.getContext('2d'), mode); return c.toDataURL('image/png'); };
window.bench = async (n, mode) => { await ready; const L = STAGE.LAYOUTS[mode]; const c = C(); c.width = L.W; c.height = L.H; const x = c.getContext('2d'); const t0 = performance.now(); for (let i = 0; i < n; i++) STAGE.render(x, i * STORY.total / n, mode, {}); return (performance.now() - t0) / n; };
window.info = () => ({ total: STORY.total, lines: STORY.lines.map(l => [+l.start.toFixed(2), +l.end.toFixed(2)]), scenes: STORY.scenes.map(s => [s.id, +s.start.toFixed(2)]), cross: STORY.cross.map(v => +v.toFixed(2)) });
</script>
|