mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-27 08:37:49 +01:00
Add ratio bar to new design
This commit is contained in:
1 parent
fd49f02b38
commit
08bdfe1632
3 files changed
+16
-4
No files matched your search
@@ -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",
|
||||
`
|
||||
<div class="ryd-tooltip" style="width: ${widthPx}px">
|
||||
<div class="ryd-tooltip" style="width: ${widthPx}px${isNewDesign() ? "; margin-bottom: -2px" : ""}">
|
||||
<div class="ryd-tooltip-bar-container">
|
||||
<div
|
||||
id="ryd-bar-container"
|
||||
@@ -46,6 +46,13 @@ function createRateBar(likes, dislikes) {
|
||||
</div>
|
||||
`
|
||||
);
|
||||
|
||||
// Add border between info and comments
|
||||
if (isNewDesign()) {
|
||||
let descriptionAndActionsElement = document.getElementById("top-row");
|
||||
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 + "%";
|
||||
|
||||
Reference in new issue
Block a user