Skip to content

Commit

Permalink
header hover #1629 #1624
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Mar 21, 2023
1 parent 8d5ed41 commit 861fe99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/*--------------------------------------------------------------
>>> DETAILS
----------------------------------------------------------------
#
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
Expand Down Expand Up @@ -197,11 +194,6 @@ html[it-hide-more-button='true'] #menu yt-button-shape#button-shape {
# DESCRIPTION
--------------------------------------------------------------*/

/* html[it-details-old-style=true] */

html[it-description='normal'] { }
html[it-description='expanded'] { }

html[it-description='classic'] .ytd-watch-flexy #info-contents,
html[it-description='classic'] .ytd-watch-flexy #meta-contents { display: block !important; }
html[it-description='classic'] #below.ytd-watch-flexy { top:-20px; }
Expand Down Expand Up @@ -235,7 +227,6 @@ html[it-description='classic_expanded'] div.style-scope.ytd-watch-flexy + ytd-wa
color: var(--yt-spec-text-secondary) !important;
}


/*--------------------------------------------------------------
# SHOW CHANNEL VIDEOS COUNT
--------------------------------------------------------------*/
Expand All @@ -255,4 +246,4 @@ html[it-description='classic_expanded'] div.style-scope.ytd-watch-flexy + ytd-wa

html[it-red-dislike-button='true'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer *[aria-pressed='true'] yt-icon {
color: #f02200 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
/*--------------------------------------------------------------
# POSITION
--------------------------------------------------------------*/
html[it-header-position=hidden_on_video_page][data-page-type=video] #masthead-container,
html[it-header-position=hidden]:not([it-search-focus=true]) #masthead-container {
transform: translateY(-100%);

html[it-header-position=hidden] #masthead-container:not([it-search-focus=true]),
html[it-header-position=hidden_on_video_page][data-page-type=video] #masthead-container:not([it-search-focus=true])
{transform: translateY(-100%);
}
html[it-header-position=hidden] tp-yt-app-drawer#guide #guide-spacer,
html[it-header-position=hidden] tp-yt-app-drawer:not([opened]) #header ytd-topbar-logo-renderer,
Expand All @@ -26,7 +27,7 @@ html[it-header-position=static] tp-yt-app-drawer:not([opened]) #header ytd-topba
html[it-header-position=static] tp-yt-app-drawer:not([opened]) #header .it-button,
html[it-header-position=hidden_on_video_page][data-page-type=video] tp-yt-app-drawer#guide #guide-spacer,
html[it-header-position=hover_on_video_page][data-page-type=video] tp-yt-app-drawer#guide #guide-spacer {
display: none;
display:none;
}

html[it-header-position=hover] #masthead-container,
Expand All @@ -37,7 +38,7 @@ html[it-header-position=hover_on_video_page][data-page-type='video'] tp-yt-app-d
html[it-header-position=hover_on_video_page][data-page-type='video'] ytd-mini-guide-renderer,
html[it-header-position=static] tp-yt-app-drawer,
html[it-header-position=static] ytd-mini-guide-renderer {
z-index: 2147483647 !important;
z-index: 2200 !important;
}

html[it-header-position=hidden] ytd-page-manager#page-manager,
Expand All @@ -54,10 +55,10 @@ html[it-header-position=static] ytd-page-manager#page-manager {

html[it-header-position=hover]:not([it-improvedtube-search=true]) #masthead-container,
html[it-header-position=hover_on_video_page][data-page-type='video']:not([it-improvedtube-search=true]) #masthead-container {
transition: all 250ms ease-in-out;
transform: translateY(-75%);
height: 20%;
opacity: 0;
transition: all 320ms ease-in-out;
transform: translateY(-38%);
height: 68px;
opacity: 0
}

html[it-header-position=hover] #masthead-container:hover,
Expand All @@ -73,6 +74,7 @@ html[it-header-position=static] .ytd-app:not([masthead-hidden_]) #masthead-conta
z-index: 999999999999 !important;
}

html[it-header-position=hover_on_video_page]:not([data-page-type=video]) tp-yt-app-drawer:not([opened]) #header,
html[it-header-position=hover]:not([data-page-type=video]) tp-yt-app-drawer:not([opened]) #header,
html[it-header-position=hidden]:not([data-page-type=video]) tp-yt-app-drawer:not([opened]) #header,
html[it-header-position=static]:not([data-page-type=video]) tp-yt-app-drawer:not([opened]) #header {
Expand Down
7 changes: 4 additions & 3 deletions content-scripts/website-context/youtube-features/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@ ImprovedTube.myColors = function () {
{document.querySelector('ytd-masthead').style.backgroundColor = ''+primary_color+''; }

} else if (this.elements.my_colors) {
this.elements.my_colors.remove();}
this.elements.my_colors.remove(); document.querySelector('ytd-masthead').style.backgroundColor ='rgba(255, 255, 255, 0.2)' ;}

};

ImprovedTube.setTheme = function () {
if (this.storage.theme === 'default'){
if (document.documentElement.hasAttribute('it-themes') !== null && document.documentElement.hasAttribute('it-themes') === true){
document.documentElement.removeAttribute('it-themes');
document.documentElement.setAttribute('it-themes', 'false');
document.documentElement.setAttribute('it-themes', 'false');
document.querySelector('ytd-masthead').style.backgroundColor ='rgba(255, 255, 255, 0.5)';
}
document.querySelector('ytd-masthead').style.backgroundColor ='rgba(0, 0, 0, 0)' ;

}
else if (this.storage.theme === 'dark'){
if (document.documentElement.hasAttribute('dark') !== null && document.documentElement.hasAttribute('dark') ){
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "'Improve YouTube!'🎧(for YouTube & Videos)",
"short_name": "ImprovedTube",
"description": "__MSG_description_ext__",
"version": "4.3.1",
"version": "4.4",
"default_locale": "en",
"icons": {

Expand Down

0 comments on commit 861fe99

Please sign in to comment.