Skip to content

Commit

Permalink
Improve play bar icons hover effects
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxuan010 committed Nov 15, 2024
1 parent c4534ff commit f97bd43
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 16 additions & 7 deletions public/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
.playerButtonImage {
height: 22px;
vertical-align: top;
opacity: 0.9;
}

.playerButtonImage:hover {
opacity: 1;
}

.playerButton {
Expand Down Expand Up @@ -89,17 +94,21 @@
}

.autoHiding:not(.sbhidden) {
transform: translateX(0%) scale(1);
/* opacity is from YouTube page */
transition: transform 0.2s, width 0.2s, opacity 0.1s cubic-bezier(0.4, 0, 1, 1) !important;
transform: translateX(0%);
transition: transform 0.2s cubic-bezier(0.215, 0.61, 0.355, 1), width 0.2s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

.autoHiding.sbhidden {
transform: translateX(100%) scale(0);
/* opacity is from YouTube page */
transition: transform 0.2s, width 0.2s, opacity 0.1s cubic-bezier(0.4, 0, 1, 1) !important;
transform: translateX(100%);
transition: transform 0.2s cubic-bezier(0.215, 0.61, 0.355, 1), width 0.2s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
/* width: 0px !important; */
opacity: 0;
}

width: 0px !important;
@media (max-width: 1260px){
.autoHiding.sbhidden{
width: 0px !important;
}
}

.autoHiding.sbhidden.autoHideLeft {
Expand Down
4 changes: 2 additions & 2 deletions src/render/PlayerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class PlayerButton {
this.creatingButtons = true;
this.container = document.createElement("div");
this.container.id = containerId;
this.container.style.display = "contents";
this.container.style.display = "flex";
this.root = createRoot(this.container);
this.root.render(
<PlayerButtonGroupComponent
Expand All @@ -93,7 +93,7 @@ export class PlayerButton {
},
};
if (Config.config.autoHideInfoButton) {
AnimationUtils.setupAutoHideAnimation(this.playerButtons.info.button, controlsContainer);
AnimationUtils.setupAutoHideAnimation(this.playerButtons.info.button, this.container);
}
this.creatingButtons = false;
}
Expand Down

0 comments on commit f97bd43

Please sign in to comment.