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

index.html

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