Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Nov 27, 2023
1 parent 5d7fe53 commit dd16983
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ min-width: min(calc(100vw - 1000px), 1260px) !important; max-width: 1260px !impo
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy[theater] #columns,
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy[fullscreen] #columns {height: auto}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #secondary{border-left: 1px solid var(--yt-spec-10-percent-layer)}
}

@media screen and (min-width: 1952px) {
/* or unset */
/* or unset */
html[data-page-type=video][it-comments-sidebar='true'] #columns {max-width: 2400px !important; }
}

Expand Down
22 changes: 17 additions & 5 deletions js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,17 @@ ImprovedTube.commentsSidebarSimple = function() { if(ImprovedTube.storage.commen
/*------------------------------------------------------------------------------
Comments Sidebar
------------------------------------------------------------------------------*/
ImprovedTube.commentsSidebar = function() {
ImprovedTube.commentsSidebar = function() { if(ImprovedTube.storage.comments_sidebar === true){
const video = document.querySelector("#player .ytp-chrome-bottom") || document.querySelector("#container .ytp-chrome-bottom");
let hasApplied = 0;
if(ImprovedTube.storage.comments_sidebar === true){
if(/watch\?/.test(location.href)) {
sidebar();
styleScrollbars();
setGrid();
applyObserver();
window.addEventListener("resize", sidebar)
}
}

function sidebar(){
resizePlayer();
if(window.matchMedia("(min-width: 1952px)").matches) {
Expand Down Expand Up @@ -232,6 +231,7 @@ ImprovedTube.commentsSidebar = function() {
if(isDarkMode) [color,colorHover] = ["#616161", "#909090"];
else [color,colorHover] = ["#aaaaaa", "#717171"];
const style = document.createElement("style");
if(ImprovedTube.storage.comments_sidebar_scrollbars === true){
const cssRule = `
#primary, #secondary {
overflow: overlay !important;
Expand All @@ -253,7 +253,19 @@ ImprovedTube.commentsSidebar = function() {
::-webkit-scrollbar-thumb:hover{
background-color: ${colorHover};
}`;
style.appendChild(document.createTextNode(cssRule));
style.appendChild(document.createTextNode(cssRule));
}
else { const cssRule = `
#primary, #secondary {
overflow: overlay !important;
}
::-webkit-scrollbar
{
width: 0px;
height: 0px;
}`;
style.appendChild(document.createTextNode(cssRule));
}
document.head.appendChild(style);
}
}
Expand All @@ -271,7 +283,7 @@ ImprovedTube.commentsSidebar = function() {
}, delay);
};
}

}
}
/*------------------------------------------------------------------------------
SIDEBAR
Expand Down
10 changes: 5 additions & 5 deletions menu/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,6 @@ extension.skeleton.main.layers.section.appearance.on.click.player = {
component: "switch",
text: "hideScrollForDetails",
tags: "remove,hide"
},
hide_video_title_fullScreen: {
component: "switch",
text: "hideVideoTitleFullScreen",
}
}
}
Expand Down Expand Up @@ -702,9 +698,13 @@ extension.skeleton.main.layers.section.appearance.on.click.comments = {
component: "switch",
text: "sidebar"
},
comments_sidebar_scrollbars: {
component: "switch",
text: "with scrollbars?"
},
comments_sidebar_simple: {
component: "switch",
text: "Sidebar simple"
text: "Sidebar (simple alternative)",
},
squared_user_images: {
component: 'switch',
Expand Down
27 changes: 12 additions & 15 deletions menu/styles/appearance.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
/*--------------------------------------------------------------
>>> APPEARANCE:
----------------------------------------------------------------
# Buttons
# Custom player size
# Hide Detail Button
--------------------------------------------------------------*/
/*-----------------
NESTED (CONDITIONAL) SWITCHES
-----------------*/
/*-transcript compact spacing-*/
#transcript:not([data-value='true']) + .satus-switch,
/*-DURATION WITH SPEED-*/
#show-remaining-duration:not([data-value='true']) + .satus-switch,
/*-comment sidebar scrollbars-*/
#comments-sidebar:not([data-value='true']) + .satus-switch
{display:none;}
/*--------------------------------------------------------------
# BUTTONS
--------------------------------------------------------------*/
Expand Down Expand Up @@ -145,14 +152,4 @@

content: 'x';
}
/*--------------------------------------------------------------
transcript compact spacing
--------------------------------------------------------------*/
#transcript:not([data-value='true']) + .satus-switch
{display:none}
/*--------------------------------------------------------------
DURATION WITH SPEED
--------------------------------------------------------------*/
#show-remaining-duration:not([data-value='true']) + .satus-switch {
display: none;
}

0 comments on commit dd16983

Please sign in to comment.