diff --git a/README.md b/README.md index 4c0e829..27ef070 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ # YoutubePlus - +图 -优化Youtube的使用体验,目前实现了以下5个功能: +优化Youtube的使用体验,目前实现了以下功能: - 优化音量条,将音量条拖到最大时音量真正为100%(关闭了Youtube的“音量均衡”) - 增加一键倍速按钮,不用再点好几次才能调到2倍速 - 在开通Premium时,自动切换为Premium会员画质 - 删除迷你播放器、剧场模式按钮 - 自动将评论区的 `用户名(@username)` 转为 `昵称+用户名 (nickname @username)` +- 半透明视频结尾的推荐视频和推荐创作者 以上功能均可单独开启或关闭。 @@ -43,7 +44,15 @@ Youtube播放器的音量条拖到最大的实际音量值为优化后的结果 这两个废物按钮反正笔者除了误点以外一次都没点过。 +## 半透明视频结尾的推荐视频和推荐创作者 +半透明视频结尾的推荐视频和推荐创作者 + +避免遮挡视频内容,在鼠标移动上去时会恢复透明度。 + # 更新日志 +2025-02-18: +- 增加半透明视频结尾的推荐视频和推荐创作者功能 + 2025-01-24: - 修复会员画质兼容性问题 - 修复删除迷你播放器、剧场模式按钮功能失效问题 diff --git a/imgs/hideCeElement.webp b/imgs/hideCeElement.webp new file mode 100644 index 0000000..1e45927 Binary files /dev/null and b/imgs/hideCeElement.webp differ diff --git a/imgs/img.webp b/imgs/img.webp index 9329601..f97ebf2 100644 Binary files a/imgs/img.webp and b/imgs/img.webp differ diff --git a/script.js b/script.js index 7278a1e..12a8213 100644 --- a/script.js +++ b/script.js @@ -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 @@ -48,6 +48,10 @@ name: "显示评论者昵称", enable: true, }, + hideCeElement: { + name: "半透明结尾的推荐视频/作者", + enable: true, + }, }; let menuIds = []; for (const key of Object.keys(functions)) { @@ -67,7 +71,7 @@ insert: true, setParent: true, }); - }), + }) ); for (const [key, info] of Object.entries(functions)) { @@ -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(); @@ -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); } @@ -339,7 +354,7 @@ JSON.stringify({ data: speed.toString(), creation: new Date().getTime(), - }), + }) ); } speedButtons.forEach((v) => { @@ -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");