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

index.html

153 lines8.4 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="region" hidden>
17 <div id="region-shade"></div>
18 <div id="region-box" hidden><span id="region-size"></span></div>
19 <form id="region-form" autocomplete="off">
20 <span id="region-hint">Drag a box over the artboard to highlight it, or type it:</span>
21 <input id="region-input" type="text" spellcheck="false" placeholder="x, y, width, height" aria-label="Region in artboard units (x, y, width, height)" title="In artboard units from the artboard's top-left · Enter takes the screenshot">
22 <span class="region-esc"><kbd>Esc</kbd> cancels</span>
23 </form>
24 </div>
25 <div id="badge"><span id="badge-dot"></span><span id="badge-name">rive-video-preview</span><span id="badge-status">connecting…</span></div>
26 <pre id="error" hidden></pre>
27 <div id="toast" hidden></div>
28 <div id="help" hidden>
29 <div class="help-card">
30 <h2>Keyboard</h2>
31 <dl>
32 <dt>Space / K</dt><dd>Play / pause</dd>
33 <dt>← / →</dt><dd>Step one frame</dd>
34 <dt>Shift + ← / →</dt><dd>Jump one second</dd>
35 <dt>Home / End</dt><dd>Start / end (of the in–out range if set)</dd>
36 <dt>I / O</dt><dd>Set in / out point at the playhead</dd>
37 <dt>X</dt><dd>Clear the in–out range</dd>
38 <dt>C</dt><dd>Copy the playhead timecode</dd>
39 <dt>Shift + C</dt><dd>Copy the in–out range</dd>
40 <dt>G</dt><dd>Go to a time (12.5 · 1:02.25 · f741)</dd>
41 <dt>L</dt><dd>Toggle loop</dd>
42 <dt>M</dt><dd>Mute</dd>
43 <dt>F</dt><dd>Fullscreen</dd>
44 <dt>S</dt><dd>Screenshot this frame (opens its note)</dd>
45 <dt>Shift + S</dt><dd>Region screenshot: drag a box to highlight, or type x, y, width, height and press Enter (also Shift-click the camera) · Esc cancels</dd>
46 <dt>N</dt><dd>Show / hide screenshots &amp; notes</dd>
47 <dt>Click a sound effect</dt><dd>Select it and set its volume below the timeline</dd>
48 <dt>Drag a sound effect</dt><dd>Move it to another audio track</dd>
49 <dt>↑ / ↓</dt><dd>Move the selected sound effect up / down a track</dd>
50 <dt>A</dt><dd>Hide / show the audio tracks</dd>
51 <dt>Scroll on timeline</dt><dd>Zoom · Shift/horizontal scroll pans · double-click ruler resets</dd>
52 </dl>
53 <p class="hint">Press ? or Esc to close</p>
54 </div>
55 </div>
56 </main>
57​
58 <aside id="notes" hidden>
59 <header class="notes-head">
60 <h2>Screenshots &amp; notes</h2>
61 <button id="btn-notes-close" class="icon small" title="Hide (N)" aria-label="Hide notes">
62 <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>
63 </button>
64 </header>
65 <div id="shot-list"></div>
66 <p id="shot-empty">Press <kbd>S</kbd> or the camera button to screenshot the current frame, then write what should change. <kbd>Shift</kbd>+<kbd>S</kbd> lets you drag a box to highlight one area.</p>
67 <footer class="notes-foot">
68 <textarea id="share-message" rows="2" placeholder="Overall note for the agent (optional)" spellcheck="true"></textarea>
69 <button id="btn-share" class="primary" disabled>Send to agent</button>
70 <div id="share-status"></div>
71 </footer>
72 </aside>
73 </div>
74​
75 <section id="dock">
76 <div id="timeline-wrap">
77 <div id="track-heads">
78 <div class="heads-top">
79 <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>
80 <button id="btn-add-track" class="chip" title="Add an audio track (up to 3)">+ Track</button>
81 </div>
82 <div id="track-list"></div>
83 </div>
84 <div id="timeline">
85 <canvas id="timeline-canvas"></canvas>
86 <div id="clips"></div>
87 </div>
88 </div>
89 <div id="clip-inspector" hidden>
90 <span id="ci-dot"></span>
91 <span id="ci-name"></span>
92 <button id="ci-time" class="chip" title="Jump to this sound effect"></button>
93 <span id="ci-asset"></span>
94 <span class="ci-sep"></span>
95 <label class="ci-label" for="ci-gain">Volume</label>
96 <div class="ci-steps">
97 <input id="ci-gain" type="range" min="0" max="100" step="10" value="100" list="ci-ticks" aria-label="Sound effect volume">
98 <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>
99 <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>
100 </div>
101 <span id="ci-pct"></span>
102 <span id="ci-db"></span>
103 <button id="ci-all" class="chip" title="Give every occurrence of this sound effect the same track and volume"></button>
104 <button id="ci-reset" class="chip" title="Back to track 1 at 100%">Reset</button>
105 <span class="spacer"></span>
106 <button id="ci-close" class="icon small" title="Deselect (Esc)" aria-label="Deselect sound effect">
107 <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>
108 </button>
109 </div>
110 <div id="controls">
111 <button id="btn-play" class="icon" title="Play / pause (Space)" aria-label="Play"></button>
112 <button id="btn-prev" class="icon small" title="Previous frame (←)" aria-label="Previous frame">
113 <svg viewBox="0 0 16 16"><path d="M4 3h1.6v10H4zM13 3v10L6.5 8z"/></svg>
114 </button>
115 <button id="btn-next" class="icon small" title="Next frame (→)" aria-label="Next frame">
116 <svg viewBox="0 0 16 16"><path d="M10.4 3H12v10h-1.6zM3 3v10l6.5-5z"/></svg>
117 </button>
118​
119 <button id="timecode" title="Click to copy (C) · double-click to type a time (G)">
120 <span id="tc-time">00:00.000</span>
121 <span id="tc-frame">f 0</span>
122 </button>
123 <input id="goto" type="text" spellcheck="false" autocomplete="off" placeholder="12.5 · 1:02.25 · f741" hidden>
124 <span id="tc-dur">/ 00:00.000</span>
125​
126 <button id="range" class="chip" title="In–out range · click to copy (Shift+C) · X clears" hidden></button>
127​
128 <span class="spacer"></span>
129​
130 <select id="sel-artboard" title="Artboard" hidden></select>
131 <select id="sel-animation" title="Animation" hidden></select>
132​
133 <button id="btn-loop" class="chip toggle" title="Loop (L)">Loop</button>
134 <select id="sel-rate" title="Playback speed">
135 <option value="0.25">0.25×</option>
136 <option value="0.5">0.5×</option>
137 <option value="1" selected>1×</option>
138 <option value="1.5">1.5×</option>
139 <option value="2">2×</option>
140 </select>
141 <button id="btn-mute" class="icon small" title="Mute (M)" aria-label="Mute"></button>
142 <input id="volume" type="range" min="0" max="1" step="0.01" value="1" title="Master volume" aria-label="Master volume">
143 <button id="btn-shot" class="icon small" title="Screenshot this frame (S) · Shift-click: highlight a region (Shift+S)" aria-label="Screenshot">
144 <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>
145 </button>
146 <button id="btn-notes" class="chip toggle" title="Screenshots &amp; notes (N)">Notes<span id="notes-count"></span></button>
147 <button id="btn-help" class="icon small" title="Keyboard shortcuts (?)" aria-label="Help">?</button>
148 </div>
149 </section>
150​
151 <script type="module" src="/app.js"></script>
152</body>
153</html>