blob: 588996615eed83e2589d215271e52ca87b2f7c3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<script lang="ts">
import tooltip from "$lib/Tooltip/tooltip";
import settings from "$stores/settings";
import type { Title } from "./mediaTitle";
export let time: number | undefined = undefined;
export let count = -1337;
export let title: Title = {
title: "Media List",
hint: "This is a media list.",
};
export let progress: undefined | number = undefined;
export let hideTime = false;
export let hideCount = false;
</script>
<summary>
<span class="list-title-text" title={title.hint || undefined} use:tooltip>{title.title}</span>
{#if !hideCount}
<span class="opaque list-title-count">{count === -1337 ? '...' : count}</span>
{/if}
<!-- {#if !hideCount}{#if count === -1337}...{:else}<NumberTicker
end={count}
duration={Math.min(2500, Math.max(500, Math.abs(count - 0) * 10))}
/>{/if}{/if} -->
{#if !hideTime && $settings.debugShowListTimings}
<small class="opaque">{time ? time.toFixed(3) : '...'}s</small>
{/if}
<slot />
{#if progress !== undefined}
<button class="badge unclickable-button button-badge badge-info">
{progress.toFixed(0)}%
</button>
{/if}
</summary>
<style>
.list-title-text,
.list-title-count {
vertical-align: middle;
}
.list-title-count {
font-weight: normal;
}
</style>
|