Grow preview bar when the bar is hovered

Only for non chapter videos
This commit is contained in:
Ajay Ramachandran
2021-06-11 13:58:40 -04:00
parent ac037c6f08
commit 8d9b6e8c1e
2 changed files with 13 additions and 0 deletions

View File

@@ -9,6 +9,12 @@
height: 100%;
transform: scaleY(0.6) translateY(-30%) translateY(1.5px);
z-index: 40;
transition: transform .1s cubic-bezier(0,0,0.2,1);
}
#previewbar.hovered {
transform: scaleY(1)
}
.previewbar {

View File

@@ -142,8 +142,15 @@ class PreviewBar {
parent.style.opacity = "1";
this.container.style.transform = "none";
} else if (!this.onInvidious) {
// Hover listener
this.parent.addEventListener("mouseenter", () => this.container.classList.add("hovered"));
this.parent.addEventListener("mouseleave", () => this.container.classList.remove("hovered"));
}
// On the seek bar
this.parent.prepend(this.container);
}