Improve ratio display on new design

This commit is contained in:
Aaron Kerckhoff committed 2022-05-21 01:16:41 +02:00
1 parent 1be31bbb07
commit ea5617950f
2 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -41,6 +41,6 @@
height: 2px; height: 2px;
position: absolute; position: absolute;
padding-top: 6px; padding-top: 6px;
padding-bottom: 28px; padding-bottom: 12px;
top: -6px; top: -6px;
} }
+8 -1
View File
@@ -28,7 +28,7 @@ function createRateBar(likes, dislikes) {
).insertAdjacentHTML( ).insertAdjacentHTML(
"beforeend", "beforeend",
` `
<div class="ryd-tooltip" style="width: ${widthPx}px${isNewDesign() ? "; margin-top: -10px; margin-bottom: 15px" : ""}"> <div class="ryd-tooltip" style="width: ${widthPx}px${isNewDesign() ? "; margin-bottom: -2px" : ""}">
<div class="ryd-tooltip-bar-container"> <div class="ryd-tooltip-bar-container">
<div <div
id="ryd-bar-container" id="ryd-bar-container"
@@ -46,6 +46,13 @@ function createRateBar(likes, dislikes) {
</div> </div>
` `
); );
// 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 { } else {
document.getElementById("ryd-bar-container").style.width = widthPx + "px"; document.getElementById("ryd-bar-container").style.width = widthPx + "px";
document.getElementById("ryd-bar").style.width = widthPercent + "%"; document.getElementById("ryd-bar").style.width = widthPercent + "%";