Skip to content

Commit

Permalink
半透明视频结尾的推荐视频和推荐创作者
Browse files Browse the repository at this point in the history
  • Loading branch information
xlch88 committed Feb 18, 2025
1 parent 5975ed7 commit 3871a1c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# YoutubePlus
<img src="imgs/img.webp" width="500">
<img src="imgs/img.webp" alt="" width="500">

优化Youtube的使用体验,目前实现了以下5个功能
优化Youtube的使用体验,目前实现了以下功能
- 优化音量条,将音量条拖到最大时音量真正为100%(关闭了Youtube的“音量均衡”)
- 增加一键倍速按钮,不用再点好几次才能调到2倍速
- 在开通Premium时,自动切换为Premium会员画质
- 删除迷你播放器、剧场模式按钮
- 自动将评论区的 `用户名(@username)` 转为 `昵称+用户名 (nickname @username)`
- 半透明视频结尾的推荐视频和推荐创作者

以上功能均可单独开启或关闭。

Expand Down Expand Up @@ -43,7 +44,15 @@ Youtube播放器的音量条拖到最大的实际音量值为优化后的结果

这两个废物按钮反正笔者除了误点以外一次都没点过。

## 半透明视频结尾的推荐视频和推荐创作者
<img src="imgs/hideCeElement.webp" alt="半透明视频结尾的推荐视频和推荐创作者" width="500">

避免遮挡视频内容,在鼠标移动上去时会恢复透明度。

# 更新日志
2025-02-18:
- 增加半透明视频结尾的推荐视频和推荐创作者功能

2025-01-24:
- 修复会员画质兼容性问题
- 修复删除迷你播放器、剧场模式按钮功能失效问题
Expand Down
Binary file added imgs/hideCeElement.webp
Binary file not shown.
Binary file modified imgs/img.webp
Binary file not shown.
28 changes: 23 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// ==UserScript==
// @name YoutubePlus - 100%音量增强/一键倍速按钮/自动切换Premium画质/删除迷你播放器按钮
// @name YoutubePlus - 显评论昵称/100%音量增强/一键倍速按钮/自动切换Premium画质/删除迷你播放器按钮
// @namespace https://github.com/xlch88/YoutubePlus
// @author Dark495 (https://dark495.me/)
// @version 2025-01-24
// @version 2025-02-18
// @license WTFPL
// @description 增强Youtube使用体验
// @author Dark495
Expand Down Expand Up @@ -48,6 +48,10 @@
name: "显示评论者昵称",
enable: true,
},
hideCeElement: {
name: "半透明结尾的推荐视频/作者",
enable: true,
},
};
let menuIds = [];
for (const key of Object.keys(functions)) {
Expand All @@ -67,7 +71,7 @@
insert: true,
setParent: true,
});
}),
})
);

for (const [key, info] of Object.entries(functions)) {
Expand Down Expand Up @@ -126,6 +130,15 @@
commentWatcher.disconnect();
commentWatcher = null;
}
break;

case "hideCeElement":
if (functions.hideCeElement.enable) {
document.body.classList.add("ytp-hide-ce-element");
} else {
document.body.classList.remove("ytp-hide-ce-element");
}
break;
}

registerMenu();
Expand Down Expand Up @@ -197,8 +210,10 @@
body.ytp-hide-pip-button .ytp-miniplayer-button{ display:none!important; }
body.ytp-hide-pip-button .ytp-size-button{ display:none!important; }
body.ytp-show-speed3button .ytp-speed-button-3x{ display:flex; }
`;
body.ytp-hide-ce-element .ytp-ce-element{ opacity: 0.3!important; }
body.ytp-hide-ce-element .ytp-ce-element.ytp-ce-element-hover{ opacity: 1!important; }
`;
document.head.appendChild(style);
}

Expand Down Expand Up @@ -339,7 +354,7 @@
JSON.stringify({
data: speed.toString(),
creation: new Date().getTime(),
}),
})
);
}
speedButtons.forEach((v) => {
Expand Down Expand Up @@ -378,6 +393,9 @@
if (functions.speed3Button.enable) {
document.body.classList.add("ytp-show-speed3button");
}
if (functions.hideCeElement.enable) {
document.body.classList.add("ytp-hide-ce-element");
}
}

let comment = document.querySelector("ytd-comments #contents");
Expand Down

0 comments on commit 3871a1c

Please sign in to comment.