Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new like UI that better suits the rounded design #861

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Extensions/combined/content-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
--yt-spec-brand-background-secondary: #000 !important;
} */

.yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-button.yt-spec-button-shape-next--segmented-end
.yt-spec-button-shape-next__icon {
margin-right: 6px;
}

#ryd-bar-container {
background: var(--yt-spec-icon-disabled);
border-radius: 2px;
Expand All @@ -31,7 +36,7 @@

.ryd-tooltip {
display: block;
height: 2px;
height: 1px;
}

.ryd-tooltip-old-design {
Expand All @@ -41,13 +46,14 @@

.ryd-tooltip-new-design {
position: absolute;
bottom: -10px;
left: -4px;
bottom: -0.5px;
margin-left: 23px;
margin-right: 23px;
}

.ryd-tooltip-bar-container {
width: 100%;
height: 2px;
height: 1px;
position: absolute;
padding-top: 6px;
padding-bottom: 12px;
Expand Down
21 changes: 14 additions & 7 deletions Extensions/combined/src/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function createRateBar(likes, dislikes) {
const widthPx =
getLikeButton().clientWidth +
getDislikeButton().clientWidth +
(isRoundedDesign() ? 0 : 8);
(isRoundedDesign() ? -46 : 8);

const widthPercent =
likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;
Expand Down Expand Up @@ -48,7 +48,7 @@ function createRateBar(likes, dislikes) {
}

if (!isShorts()) {
if (!rateBar && !isMobile()) {
if ((!rateBar || isNewDesign()) && !isMobile()) {
let colorLikeStyle = "";
let colorDislikeStyle = "";
if (extConfig.coloredBar) {
Expand All @@ -57,17 +57,24 @@ function createRateBar(likes, dislikes) {
}

(
document.getElementById(
isNewDesign() ? "top-level-buttons-computed" : "menu-container"
) || document.querySelector("ytm-slim-video-action-bar-renderer")
(isRoundedDesign()
? document.querySelector(
"#actions-inner #top-level-buttons-computed"
)
: document.getElementById("menu-container")) ||
document.querySelector("ytm-slim-video-action-bar-renderer")
).insertAdjacentHTML(
"beforeend",
`
<div class="ryd-tooltip ryd-tooltip-${isNewDesign() ? "new" : "old"}-design" style="width: ${widthPx}px">
<div class="ryd-tooltip ryd-tooltip-${
isRoundedDesign() ? "new" : "old"
}-design" style="width: ${widthPx}px">
<div class="ryd-tooltip-bar-container">
<div
id="ryd-bar-container"
style="width: 100%; height: 2px;${colorDislikeStyle}"
style="width: 100%; height: ${
isNewDesign() ? 1 : 2
}px; ${colorDislikeStyle}"
>
<div
id="ryd-bar"
Expand Down