diff --git a/Extensions/combined/content-style.css b/Extensions/combined/content-style.css index e2e5fa2..d8da7db 100644 --- a/Extensions/combined/content-style.css +++ b/Extensions/combined/content-style.css @@ -41,6 +41,6 @@ height: 2px; position: absolute; padding-top: 6px; - padding-bottom: 28px; + padding-bottom: 12px; top: -6px; } diff --git a/Extensions/combined/src/bar.js b/Extensions/combined/src/bar.js index c56ab57..386ff59 100644 --- a/Extensions/combined/src/bar.js +++ b/Extensions/combined/src/bar.js @@ -1,5 +1,5 @@ import { getButtons } from "./buttons"; -import { extConfig, isMobile, isLikesDisabled } from "./state"; +import { extConfig, isMobile, isLikesDisabled, isNewDesign } from "./state"; import { cLog, getColorFromTheme } from "./utils"; function createRateBar(likes, dislikes) { @@ -23,12 +23,12 @@ function createRateBar(likes, dislikes) { } ( - document.getElementById("menu-container") || + document.getElementById(isNewDesign() ? "actions-inner" : "menu-container") || document.querySelector("ytm-slim-video-action-bar-renderer") ).insertAdjacentHTML( "beforeend", ` -
+
` ); + + // Add border between info and comments + if (isNewDesign()) { + let descriptionAndActionsElement = document.getElementById("description-and-actions"); + descriptionAndActionsElement.style.borderBottom = "1px solid var(--yt-spec-10-percent-layer)"; + descriptionAndActionsElement.style.paddingBottom = "10px"; + } } else { document.getElementById("ryd-bar-container").style.width = widthPx + "px"; document.getElementById("ryd-bar").style.width = widthPercent + "%"; @@ -62,7 +69,7 @@ function createRateBar(likes, dislikes) { } else { cLog("removing bar"); let ratebar = document.getElementById("ryd-bar-container"); - if(ratebar) { + if (ratebar) { ratebar.parentNode.removeChild(ratebar); } } diff --git a/Extensions/combined/src/state.js b/Extensions/combined/src/state.js index df9d561..822d9b2 100644 --- a/Extensions/combined/src/state.js +++ b/Extensions/combined/src/state.js @@ -39,6 +39,10 @@ function isShorts() { return location.pathname.startsWith("/shorts"); } +function isNewDesign() { + return document.getElementById("comment-teaser") !== null; +} + let mutationObserver = new Object(); if (isShorts() && mutationObserver.exists !== true) { @@ -330,6 +334,7 @@ export { isShorts, isVideoDisliked, isVideoLiked, + isNewDesign, getState, setState, setInitialState,