|
165 | 165 | percent = 1; |
166 | 166 | } |
167 | 167 | const timeOffset = meta.totalTime * percent; |
168 | | - finished = false |
| 168 | + finished = false; |
169 | 169 | goto(timeOffset); |
170 | 170 | }; |
171 | 171 |
|
|
188 | 188 | export const triggerUpdateMeta = () => { |
189 | 189 | Promise.resolve().then(() => { |
190 | 190 | meta = replayer.getMetaData(); |
191 | | - }) |
192 | | - } |
| 191 | + }); |
| 192 | + }; |
193 | 193 |
|
194 | 194 | onMount(() => { |
195 | 195 | playerState = replayer.service.state.value as typeof playerState; |
|
237 | 237 | }); |
238 | 238 | </script> |
239 | 239 |
|
240 | | -<style> |
241 | | - .rr-controller { |
242 | | - width: 100%; |
243 | | - height: 80px; |
244 | | - background: #fff; |
245 | | - display: flex; |
246 | | - flex-direction: column; |
247 | | - justify-content: space-around; |
248 | | - align-items: center; |
249 | | - border-radius: 0 0 5px 5px; |
250 | | - } |
251 | | -
|
252 | | - .rr-timeline { |
253 | | - width: 80%; |
254 | | - display: flex; |
255 | | - align-items: center; |
256 | | - } |
257 | | -
|
258 | | - .rr-timeline__time { |
259 | | - display: inline-block; |
260 | | - width: 100px; |
261 | | - text-align: center; |
262 | | - color: #11103e; |
263 | | - } |
264 | | -
|
265 | | - .rr-progress { |
266 | | - flex: 1; |
267 | | - height: 12px; |
268 | | - background: #eee; |
269 | | - position: relative; |
270 | | - border-radius: 3px; |
271 | | - cursor: pointer; |
272 | | - box-sizing: border-box; |
273 | | - border-top: solid 4px #fff; |
274 | | - border-bottom: solid 4px #fff; |
275 | | - } |
276 | | -
|
277 | | - .rr-progress.disabled { |
278 | | - cursor: not-allowed; |
279 | | - } |
280 | | -
|
281 | | - .rr-progress__step { |
282 | | - height: 100%; |
283 | | - position: absolute; |
284 | | - left: 0; |
285 | | - top: 0; |
286 | | - background: #e0e1fe; |
287 | | - } |
288 | | -
|
289 | | - .rr-progress__handler { |
290 | | - width: 20px; |
291 | | - height: 20px; |
292 | | - border-radius: 10px; |
293 | | - position: absolute; |
294 | | - top: 2px; |
295 | | - transform: translate(-50%, -50%); |
296 | | - background: rgb(73, 80, 246); |
297 | | - } |
298 | | -
|
299 | | - .rr-controller__btns { |
300 | | - display: flex; |
301 | | - align-items: center; |
302 | | - justify-content: center; |
303 | | - font-size: 13px; |
304 | | - } |
305 | | -
|
306 | | - .rr-controller__btns button { |
307 | | - width: 32px; |
308 | | - height: 32px; |
309 | | - display: flex; |
310 | | - padding: 0; |
311 | | - align-items: center; |
312 | | - justify-content: center; |
313 | | - background: none; |
314 | | - border: none; |
315 | | - border-radius: 50%; |
316 | | - cursor: pointer; |
317 | | - } |
318 | | -
|
319 | | - .rr-controller__btns button:active { |
320 | | - background: #e0e1fe; |
321 | | - } |
322 | | -
|
323 | | - .rr-controller__btns button.active { |
324 | | - color: #fff; |
325 | | - background: rgb(73, 80, 246); |
326 | | - } |
327 | | -
|
328 | | - .rr-controller__btns button:disabled { |
329 | | - cursor: not-allowed; |
330 | | - } |
331 | | -</style> |
332 | | - |
333 | 240 | {#if showController} |
334 | 241 | <div class="rr-controller"> |
335 | 242 | <div class="rr-timeline"> |
|
338 | 245 | class="rr-progress" |
339 | 246 | class:disabled={speedState === 'skipping'} |
340 | 247 | bind:this={progress} |
341 | | - on:click={(event) => handleProgressClick(event)}> |
| 248 | + on:click={(event) => handleProgressClick(event)} |
| 249 | + > |
342 | 250 | <div |
343 | 251 | class="rr-progress__step" |
344 | 252 | bind:this={step} |
345 | | - style="width: {percentage}" /> |
| 253 | + style="width: {percentage}" |
| 254 | + /> |
346 | 255 | {#each customEvents as event} |
347 | 256 | <div |
348 | 257 | title={event.name} |
349 | 258 | style="width: 10px;height: 5px;position: absolute;top: |
350 | 259 | 2px;transform: translate(-50%, -50%);background: {event.background};left: |
351 | | - {event.position};" /> |
| 260 | + {event.position};" |
| 261 | + /> |
352 | 262 | {/each} |
353 | 263 |
|
354 | 264 | <div class="rr-progress__handler" style="left: {percentage}" /> |
|
365 | 275 | xmlns="http://www.w3.org/2000/svg" |
366 | 276 | xmlns:xlink="http://www.w3.org/1999/xlink" |
367 | 277 | width="16" |
368 | | - height="16"> |
| 278 | + height="16" |
| 279 | + > |
369 | 280 | <path |
370 | 281 | d="M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0 |
371 | 282 | 512q0 53.00224-37.49888 90.50112t-90.50112 |
|
380 | 291 | 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984 |
381 | 292 | 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 |
382 | 293 | 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928 |
383 | | - 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z" /> |
| 294 | + 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z" |
| 295 | + /> |
384 | 296 | </svg> |
385 | 297 | {:else} |
386 | 298 | <svg |
|
390 | 302 | xmlns="http://www.w3.org/2000/svg" |
391 | 303 | xmlns:xlink="http://www.w3.org/1999/xlink" |
392 | 304 | width="16" |
393 | | - height="16"> |
| 305 | + height="16" |
| 306 | + > |
394 | 307 | <path |
395 | 308 | d="M170.65984 896l0-768 640 384zM644.66944 |
396 | | - 512l-388.66944-233.32864 0 466.65728z" /> |
| 309 | + 512l-388.66944-233.32864 0 466.65728z" |
| 310 | + /> |
397 | 311 | </svg> |
398 | 312 | {/if} |
399 | 313 | </button> |
400 | 314 | {#each speedOption as s} |
401 | 315 | <button |
402 | 316 | class:active={s === speed && speedState !== 'skipping'} |
403 | 317 | on:click={() => setSpeed(s)} |
404 | | - disabled={speedState === 'skipping'}> |
| 318 | + disabled={speedState === 'skipping'} |
| 319 | + > |
405 | 320 | {s}x |
406 | 321 | </button> |
407 | 322 | {/each} |
408 | 323 | <Switch |
409 | 324 | id="skip" |
410 | 325 | bind:checked={skipInactive} |
411 | 326 | disabled={speedState === 'skipping'} |
412 | | - label="skip inactive" /> |
| 327 | + label="skip inactive" |
| 328 | + /> |
413 | 329 | <button on:click={() => dispatch('fullscreen')}> |
414 | 330 | <svg |
415 | 331 | class="icon" |
|
418 | 334 | xmlns="http://www.w3.org/2000/svg" |
419 | 335 | xmlns:xlink="http://www.w3.org/1999/xlink" |
420 | 336 | width="16" |
421 | | - height="16"> |
| 337 | + height="16" |
| 338 | + > |
422 | 339 | <defs> |
423 | 340 | <style type="text/css"> |
424 | | -
|
425 | 341 | </style> |
426 | 342 | </defs> |
427 | 343 | <path |
|
432 | 348 | 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48 |
433 | 349 | 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4 |
434 | 350 | 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" |
435 | | - p-id="1286" /> |
| 351 | + p-id="1286" |
| 352 | + /> |
436 | 353 | </svg> |
437 | 354 | </button> |
438 | 355 | </div> |
439 | 356 | </div> |
440 | 357 | {/if} |
| 358 | + |
| 359 | +<style> |
| 360 | + .rr-controller { |
| 361 | + width: 100%; |
| 362 | + height: 80px; |
| 363 | + background: #fff; |
| 364 | + display: flex; |
| 365 | + flex-direction: column; |
| 366 | + justify-content: space-around; |
| 367 | + align-items: center; |
| 368 | + border-radius: 0 0 5px 5px; |
| 369 | + } |
| 370 | +
|
| 371 | + .rr-timeline { |
| 372 | + width: 80%; |
| 373 | + display: flex; |
| 374 | + align-items: center; |
| 375 | + } |
| 376 | +
|
| 377 | + .rr-timeline__time { |
| 378 | + display: inline-block; |
| 379 | + width: 100px; |
| 380 | + text-align: center; |
| 381 | + color: #11103e; |
| 382 | + } |
| 383 | +
|
| 384 | + .rr-progress { |
| 385 | + flex: 1; |
| 386 | + height: 12px; |
| 387 | + background: #eee; |
| 388 | + position: relative; |
| 389 | + border-radius: 3px; |
| 390 | + cursor: pointer; |
| 391 | + box-sizing: border-box; |
| 392 | + border-top: solid 4px #fff; |
| 393 | + border-bottom: solid 4px #fff; |
| 394 | + } |
| 395 | +
|
| 396 | + .rr-progress.disabled { |
| 397 | + cursor: not-allowed; |
| 398 | + } |
| 399 | +
|
| 400 | + .rr-progress__step { |
| 401 | + height: 100%; |
| 402 | + position: absolute; |
| 403 | + left: 0; |
| 404 | + top: 0; |
| 405 | + background: #e0e1fe; |
| 406 | + } |
| 407 | +
|
| 408 | + .rr-progress__handler { |
| 409 | + width: 20px; |
| 410 | + height: 20px; |
| 411 | + border-radius: 10px; |
| 412 | + position: absolute; |
| 413 | + top: 2px; |
| 414 | + transform: translate(-50%, -50%); |
| 415 | + background: rgb(73, 80, 246); |
| 416 | + } |
| 417 | +
|
| 418 | + .rr-controller__btns { |
| 419 | + display: flex; |
| 420 | + align-items: center; |
| 421 | + justify-content: center; |
| 422 | + font-size: 13px; |
| 423 | + } |
| 424 | +
|
| 425 | + .rr-controller__btns button { |
| 426 | + width: 32px; |
| 427 | + height: 32px; |
| 428 | + display: flex; |
| 429 | + padding: 0; |
| 430 | + align-items: center; |
| 431 | + justify-content: center; |
| 432 | + background: none; |
| 433 | + border: none; |
| 434 | + border-radius: 50%; |
| 435 | + cursor: pointer; |
| 436 | + } |
| 437 | +
|
| 438 | + .rr-controller__btns button:active { |
| 439 | + background: #e0e1fe; |
| 440 | + } |
| 441 | +
|
| 442 | + .rr-controller__btns button.active { |
| 443 | + color: #fff; |
| 444 | + background: rgb(73, 80, 246); |
| 445 | + } |
| 446 | +
|
| 447 | + .rr-controller__btns button:disabled { |
| 448 | + cursor: not-allowed; |
| 449 | + } |
| 450 | +</style> |
0 commit comments