diff --git a/materialious/src/lib/components/player/Player.svelte b/materialious/src/lib/components/player/Player.svelte index afe7d5b3..68afe180 100644 --- a/materialious/src/lib/components/player/Player.svelte +++ b/materialious/src/lib/components/player/Player.svelte @@ -1,8 +1,8 @@ + +
+ {#snippet timelineTooltip(key: 'thumb' | 'timeline', timeInSeconds: number)} + {#if playerTimelineThumbnails.length > 0} + + {/if} + {#if playerCloestSponsor} +

+ {sponsorSegments[playerCloestSponsor.category]} +

+ {:else if playerCloestTimestamp} +

+ {truncate(playerCloestTimestamp.title, 20)} +

+ {/if} + {videoLength(timeInSeconds)} + {/snippet} +
+ {#if !userManualSeeking && playerShowTimelineThumbnail} +
+ {@render timelineTooltip('timeline', playerTimelineTimeHover)} +
+ {/if} +
+
+ {#if playerSliderInteracted} +
+ {@render timelineTooltip('thumb', currentTime)} +
+ {/if} +
+
+
+ {#each content.timestamps as chapter, index (chapter)} +
+ {/each} + {#if !$sponsorBlockTimelineStore} + {#each segments as segment (segment)} +
+ {/each} + {/if} +
+ + diff --git a/materialious/src/lib/css/global.css b/materialious/src/lib/css/global.css index b6ffae70..045e2bab 100644 --- a/materialious/src/lib/css/global.css +++ b/materialious/src/lib/css/global.css @@ -139,6 +139,49 @@ menu.player-settings { height: 200px !important; } +.player-slider { + height: var(--player-timeline-height); + margin: 0 auto; + border-radius: 0.25rem; +} + +.player-slider.full-width { + width: 100%; +} + +.player-slider.volume { + width: 200px; +} + +.player-slider .track { + background: var(--secondary-container); + height: 100%; + position: relative; + border-radius: 0.25rem; +} + +.player-slider .range { + position: absolute; + background: var(--inverse-primary); + inset: 0; + right: var(--percentage-inv); + border-radius: 0.25rem; + opacity: 0.5; +} + +.player-slider [data-melt-slider-thumb] { + position: absolute; + border-radius: 1rem; + background: var(--primary); + left: var(--percentage); + top: 50%; + width: 5px; + height: 35px; + z-index: 3; + cursor: grab; + transform: translate(-50%, -50%); +} + @media screen and (max-width: 1000px) { menu.mobile { position: fixed !important;