Skip to content
Source
Sign inSign up
fuko/rive-preview-player
Open History to see the last commit

index.html

105 lines4.8 KB

1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>Rive Preview</title>
7 <link rel="stylesheet" href="/style.css">
8</head>
9<body>
10 <div id="main">
11 <main id="stage">
12 <canvas id="canvas"></canvas>
13 <div id="badge"><span id="badge-dot"></span><span id="badge-name">rive-video-preview</span><span id="badge-status">connecting…</span></div>
14 <pre id="error" hidden></pre>
15 <div id="toast" hidden></div>
16 <div id="help" hidden>
17 <div class="help-card">
18 <h2>Keyboard</h2>
19 <dl>
20 <dt>Space / K</dt><dd>Play / pause</dd>
21 <dt>← / →</dt><dd>Step one frame</dd>
22 <dt>Shift + ← / →</dt><dd>Jump one second</dd>
23 <dt>Home / End</dt><dd>Start / end (of the in–out range if set)</dd>
24 <dt>I / O</dt><dd>Set in / out point at the playhead</dd>
25 <dt>X</dt><dd>Clear the in–out range</dd>
26 <dt>C</dt><dd>Copy the playhead timecode</dd>
27 <dt>Shift + C</dt><dd>Copy the in–out range</dd>
28 <dt>G</dt><dd>Go to a time (12.5 · 1:02.25 · f741)</dd>
29 <dt>L</dt><dd>Toggle loop</dd>
30 <dt>M</dt><dd>Mute</dd>
31 <dt>F</dt><dd>Fullscreen</dd>
32 <dt>S</dt><dd>Screenshot this frame (opens its note)</dd>
33 <dt>N</dt><dd>Show / hide screenshots &amp; notes</dd>
34 <dt>Scroll on timeline</dt><dd>Zoom · Shift/horizontal scroll pans · double-click ruler resets</dd>
35 </dl>
36 <p class="hint">Press ? or Esc to close</p>
37 </div>
38 </div>
39 </main>
40​
41 <aside id="notes" hidden>
42 <header class="notes-head">
43 <h2>Screenshots &amp; notes</h2>
44 <button id="btn-notes-close" class="icon small" title="Hide (N)" aria-label="Hide notes">
45 <svg viewBox="0 0 16 16"><path d="M4.2 3.1 8 6.9l3.8-3.8 1.1 1.1L9.1 8l3.8 3.8-1.1 1.1L8 9.1l-3.8 3.8-1.1-1.1L6.9 8 3.1 4.2z"/></svg>
46 </button>
47 </header>
48 <div id="shot-list"></div>
49 <p id="shot-empty">Press <kbd>S</kbd> or the camera button to screenshot the current frame, then write what should change.</p>
50 <footer class="notes-foot">
51 <textarea id="share-message" rows="2" placeholder="Overall note for the agent (optional)" spellcheck="true"></textarea>
52 <button id="btn-share" class="primary" disabled>Send to agent</button>
53 <div id="share-status"></div>
54 </footer>
55 </aside>
56 </div>
57​
58 <section id="dock">
59 <div id="timeline">
60 <canvas id="timeline-canvas"></canvas>
61 </div>
62 <div id="controls">
63 <button id="btn-play" class="icon" title="Play / pause (Space)" aria-label="Play"></button>
64 <button id="btn-prev" class="icon small" title="Previous frame (←)" aria-label="Previous frame">
65 <svg viewBox="0 0 16 16"><path d="M4 3h1.6v10H4zM13 3v10L6.5 8z"/></svg>
66 </button>
67 <button id="btn-next" class="icon small" title="Next frame (→)" aria-label="Next frame">
68 <svg viewBox="0 0 16 16"><path d="M10.4 3H12v10h-1.6zM3 3v10l6.5-5z"/></svg>
69 </button>
70​
71 <button id="timecode" title="Click to copy (C) · double-click to type a time (G)">
72 <span id="tc-time">00:00.000</span>
73 <span id="tc-frame">f 0</span>
74 </button>
75 <input id="goto" type="text" spellcheck="false" autocomplete="off" placeholder="12.5 · 1:02.25 · f741" hidden>
76 <span id="tc-dur">/ 00:00.000</span>
77​
78 <button id="range" class="chip" title="In–out range · click to copy (Shift+C) · X clears" hidden></button>
79​
80 <span class="spacer"></span>
81​
82 <select id="sel-artboard" title="Artboard" hidden></select>
83 <select id="sel-animation" title="Animation" hidden></select>
84​
85 <button id="btn-loop" class="chip toggle" title="Loop (L)">Loop</button>
86 <select id="sel-rate" title="Playback speed">
87 <option value="0.25">0.25×</option>
88 <option value="0.5">0.5×</option>
89 <option value="1" selected>1×</option>
90 <option value="1.5">1.5×</option>
91 <option value="2">2×</option>
92 </select>
93 <button id="btn-mute" class="icon small" title="Mute (M)" aria-label="Mute"></button>
94 <input id="volume" type="range" min="0" max="1" step="0.01" value="1" title="Volume">
95 <button id="btn-shot" class="icon small" title="Screenshot this frame (S)" aria-label="Screenshot">
96 <svg viewBox="0 0 16 16"><path d="M5.6 2.5h4.8l1 1.6H14a1 1 0 0 1 1 1v7.4a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V5.1a1 1 0 0 1 1-1h2.6zM8 5.6a2.9 2.9 0 1 0 0 5.8 2.9 2.9 0 0 0 0-5.8zm0 1.4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z"/></svg>
97 </button>
98 <button id="btn-notes" class="chip toggle" title="Screenshots &amp; notes (N)">Notes<span id="notes-count"></span></button>
99 <button id="btn-help" class="icon small" title="Keyboard shortcuts (?)" aria-label="Help">?</button>
100 </div>
101 </section>
102​
103 <script type="module" src="/app.js"></script>
104</body>
105</html>