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%; height: 100%;
transform: scaleY(0.6) translateY(-30%) translateY(1.5px); 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); transition: transform .1s cubic-bezier(0,0,0.2,1);
} }

View File

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

View File

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