|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2026.1.27 |
| 3 | +// @version 2026.1.27.2 |
4 | 4 | // @author Adam Lui, Magma_Craft, Fuim & hoothin |
5 | 5 | // @namespace https://github.com/adamlui |
6 | 6 | // @description Reverts YouTube to its classic design (before all the rounded corners & hidden dislikes) + redirects YouTube Shorts |
|
1030 | 1030 | yt-chip-cloud-chip-renderer:has(path[d^="M5 0a5 5"]) { display: none } |
1031 | 1031 |
|
1032 | 1032 | @media only screen and (min-width: 768px) { /* align sub btn right */ |
1033 | | - div#subscribe-button { position: absolute ; right: 0 } div#actions { padding-right: 125px }} |
| 1033 | + div#subscribe-button { position: absolute ; right: 0 }} |
1034 | 1034 | `)} |
1035 | 1035 | dom.get.loadedElem('head').then(() => document.head.append(app.styles.fixes)) |
1036 | 1036 |
|
|
1072 | 1072 | }) |
1073 | 1073 | dom.get.loadedElem('html').then(() => homeObserver.observe(document.documentElement, obsConfig)) |
1074 | 1074 |
|
| 1075 | + // Set actions div padding + update when needed |
| 1076 | + dom.get.loadedElem('ytd-subscribe-button-renderer button').then(subBtn => { |
| 1077 | + setTimeout(updateActionsDivPadding, 5000) |
| 1078 | + new MutationObserver(updateActionsDivPadding).observe(subBtn, { childList: true, subtree: true }) |
| 1079 | + window.addEventListener('resize', updateActionsDivPadding) |
| 1080 | + }) |
| 1081 | + function updateActionsDivPadding() { |
| 1082 | + if (updateActionsDivPadding.timeout) clearTimeout(updateActionsDivPadding.timeout) |
| 1083 | + updateActionsDivPadding.timeout = setTimeout(async () => { |
| 1084 | + const actionsDiv = await dom.get.loadedElem('div#actions'), |
| 1085 | + bellIcon = await dom.get.loadedElem('[animated-icon-type=NOTIFICATION_BELL] svg'), |
| 1086 | + bellWidth = getComputedStyle(bellIcon).width, |
| 1087 | + idealActionsRpadding = !window.matchMedia('(min-width: 768px)').matches ? '' |
| 1088 | + : `${125 + (bellWidth.endsWith('px') ? parseInt(bellWidth.slice(0, -2)) : 0)}px` |
| 1089 | + if (getComputedStyle(actionsDiv).paddingRight != idealActionsRpadding) |
| 1090 | + actionsDiv.style.paddingRight = idealActionsRpadding |
| 1091 | + }, 50) |
| 1092 | + } |
| 1093 | + |
1075 | 1094 | // Block stuff |
1076 | 1095 | document.head.append(app.styles.config ??= dom.create.style()) |
1077 | 1096 | app.styles.config.textContent = Object.entries(app.selectors.site).map(([key, selectors]) => |
|
0 commit comments