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

index.html

143 lines7.5 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>Click a sound effect</dt><dd>Select it and set its volume below the timeline</dd>
38 <dt>Drag a sound effect</dt><dd>Move it to another audio track</dd>
39 <dt>↑ / ↓</dt><dd>Move the selected sound effect up / down a track</dd>
40 <dt>A</dt><dd>Hide / show the audio tracks</dd>
41 <dt>Scroll on timeline</dt><dd>Zoom · Shift/horizontal scroll pans · double-click ruler resets</dd>
42 </dl>
43 <p class="hint">Press ? or Esc to close</p>
44 </div>
45 </div>
46 </main>
47​
48 <aside id="notes" hidden>
49 <header class="notes-head">
50 <h2>Screenshots &amp; notes</h2>
51 <button id="btn-notes-close" class="icon small" title="Hide (N)" aria-label="Hide notes">
52 <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>
53 </button>
54 </header>
55 <div id="shot-list"></div>
56 <p id="shot-empty">Press <kbd>S</kbd> or the camera button to screenshot the current frame, then write what should change.</p>
57 <footer class="notes-foot">
58 <textarea id="share-message" rows="2" placeholder="Overall note for the agent (optional)" spellcheck="true"></textarea>
59 <button id="btn-share" class="primary" disabled>Send to agent</button>
60 <div id="share-status"></div>
61 </footer>
62 </aside>
63 </div>
64​
65 <section id="dock">
66 <div id="timeline-wrap">
67 <div id="track-heads">
68 <div class="heads-top">
69 <button id="btn-collapse-tracks" class="heads-title" aria-expanded="true" aria-label="Hide audio tracks" title="Hide / show the audio tracks (A)"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 5.5 8 10l4.5-4.5 1 1L8 12 2.5 6.5z"/></svg><span>Audio tracks</span><span id="tracks-count"></span></button>
70 <button id="btn-add-track" class="chip" title="Add an audio track (up to 3)">+ Track</button>
71 </div>
72 <div id="track-list"></div>
73 </div>
74 <div id="timeline">
75 <canvas id="timeline-canvas"></canvas>
76 <div id="clips"></div>
77 </div>
78 </div>
79 <div id="clip-inspector" hidden>
80 <span id="ci-dot"></span>
81 <span id="ci-name"></span>
82 <button id="ci-time" class="chip" title="Jump to this sound effect"></button>
83 <span id="ci-asset"></span>
84 <span class="ci-sep"></span>
85 <label class="ci-label" for="ci-gain">Volume</label>
86 <div class="ci-steps">
87 <input id="ci-gain" type="range" min="0" max="100" step="10" value="100" list="ci-ticks" aria-label="Sound effect volume">
88 <datalist id="ci-ticks"><option value="0"></option><option value="10"></option><option value="20"></option><option value="30"></option><option value="40"></option><option value="50"></option><option value="60"></option><option value="70"></option><option value="80"></option><option value="90"></option><option value="100"></option></datalist>
89 <div class="ci-ticks" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>
90 </div>
91 <span id="ci-pct"></span>
92 <span id="ci-db"></span>
93 <button id="ci-all" class="chip" title="Give every occurrence of this sound effect the same track and volume"></button>
94 <button id="ci-reset" class="chip" title="Back to track 1 at 100%">Reset</button>
95 <span class="spacer"></span>
96 <button id="ci-close" class="icon small" title="Deselect (Esc)" aria-label="Deselect sound effect">
97 <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>
98 </button>
99 </div>
100 <div id="controls">
101 <button id="btn-play" class="icon" title="Play / pause (Space)" aria-label="Play"></button>
102 <button id="btn-prev" class="icon small" title="Previous frame (←)" aria-label="Previous frame">
103 <svg viewBox="0 0 16 16"><path d="M4 3h1.6v10H4zM13 3v10L6.5 8z"/></svg>
104 </button>
105 <button id="btn-next" class="icon small" title="Next frame (→)" aria-label="Next frame">
106 <svg viewBox="0 0 16 16"><path d="M10.4 3H12v10h-1.6zM3 3v10l6.5-5z"/></svg>
107 </button>
108​
109 <button id="timecode" title="Click to copy (C) · double-click to type a time (G)">
110 <span id="tc-time">00:00.000</span>
111 <span id="tc-frame">f 0</span>
112 </button>
113 <input id="goto" type="text" spellcheck="false" autocomplete="off" placeholder="12.5 · 1:02.25 · f741" hidden>
114 <span id="tc-dur">/ 00:00.000</span>
115​
116 <button id="range" class="chip" title="In–out range · click to copy (Shift+C) · X clears" hidden></button>
117​
118 <span class="spacer"></span>
119​
120 <select id="sel-artboard" title="Artboard" hidden></select>
121 <select id="sel-animation" title="Animation" hidden></select>
122​
123 <button id="btn-loop" class="chip toggle" title="Loop (L)">Loop</button>
124 <select id="sel-rate" title="Playback speed">
125 <option value="0.25">0.25×</option>
126 <option value="0.5">0.5×</option>
127 <option value="1" selected>1×</option>
128 <option value="1.5">1.5×</option>
129 <option value="2">2×</option>
130 </select>
131 <button id="btn-mute" class="icon small" title="Mute (M)" aria-label="Mute"></button>
132 <input id="volume" type="range" min="0" max="1" step="0.01" value="1" title="Master volume" aria-label="Master volume">
133 <button id="btn-shot" class="icon small" title="Screenshot this frame (S)" aria-label="Screenshot">
134 <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>
135 </button>
136 <button id="btn-notes" class="chip toggle" title="Screenshots &amp; notes (N)">Notes<span id="notes-count"></span></button>
137 <button id="btn-help" class="icon small" title="Keyboard shortcuts (?)" aria-label="Help">?</button>
138 </div>
139 </section>
140​
141 <script type="module" src="/app.js"></script>
142</body>
143</html>