Render preview bar behind scrubber

This commit is contained in:
Ajay Ramachandran 2021-10-30 21:48:52 -04:00
parent c7acb902a4
commit b4a2f31520
3 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,7 @@
height: 100%;
transform: scaleY(0.6) translateY(-30%) translateY(1.5px);
z-index: 40;
z-index: 42;
transition: transform .1s cubic-bezier(0,0,0.2,1);
}

View file

@ -366,7 +366,7 @@ function createPreviewBar(): void {
// For mobile YouTube
".progress-bar-background",
// For YouTube
".ytp-progress-bar-container",
".ytp-progress-bar",
".no-model.cue-range-markers",
// For Invidious/VideoJS
".vjs-progress-holder"

View file

@ -158,8 +158,6 @@ class PreviewBar {
this.parent.addEventListener("mouseleave", () => this.container.classList.remove("hovered"));
}
// On the seek bar
this.parent.prepend(this.container);
}
@ -323,7 +321,11 @@ class PreviewBar {
}
originalSectionClone.remove();
progressBar.prepend(newChapterBar);
if (this.container?.parentElement === progressBar) {
progressBar.insertBefore(newChapterBar, this.container.nextSibling);
} else {
progressBar.prepend(newChapterBar);
}
// Hide old bar
chapterBar.style.display = "none";