mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Make hiding highlight button smooth
This commit is contained in:
@@ -75,26 +75,28 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.autoHiding {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.autoHiding:not(.hidden) {
|
||||
transform: translateX(0%) scale(1);
|
||||
/* opacity is from YouTube page */
|
||||
transition: transform 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||
transition: transform 0.25s, width 0.25s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||
}
|
||||
|
||||
.autoHiding.hidden {
|
||||
transform: translateX(100%) scale(0);
|
||||
/* opacity is from YouTube page */
|
||||
transition: transform 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||
transition: transform 0.25s, width 0.25s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||
|
||||
width: 0px !important;
|
||||
}
|
||||
|
||||
.autoHiding.hidden.autoHideLeft {
|
||||
transform: translateX(-100%) scale(0);
|
||||
}
|
||||
|
||||
.autoHiding.hidden.animationDone {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.playerButton.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -199,13 +199,6 @@ export default class Utils {
|
||||
container.addEventListener("mouseleave", () => {
|
||||
if (element.classList.contains("autoHiding")) {
|
||||
element.classList.add("hidden");
|
||||
|
||||
const animationEndListener = () => {
|
||||
if (element.classList.contains("hidden")) element.classList.add("animationDone");
|
||||
element.removeEventListener("transitionend", animationEndListener);
|
||||
};
|
||||
|
||||
element.addEventListener("transitionend", animationEndListener);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user