diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e797a0..fdb1258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 3.7.5 + +- 优化:评论区 踩/回复只在hover时显示,增加延迟减少跳变 + ## 3.7.4 - 修复:动态页 隐藏动态右侧饰品 diff --git a/src/components/wordlist.ts b/src/components/wordlist.ts index 07ec669..09d9366 100644 --- a/src/components/wordlist.ts +++ b/src/components/wordlist.ts @@ -36,9 +36,7 @@ export class WordList { GM_setValue(`BILICLEANER_${this.listID}`, this.wordArr) } private getValue() { - debug(`key`, `BILICLEANER_${this.listID}`) this.wordArr = GM_getValue(`BILICLEANER_${this.listID}`, []) - debug(`list ${this.listID} getValue ${this.wordArr.length} lines`) this.wordSet = new Set(this.wordArr) } @@ -60,25 +58,6 @@ export class WordList { } } - // /** 添加多个值到列表 */ - // addValues(values: string[]) { - // try { - // this.getValue() - // values.forEach((value) => { - // value = value.trim() - // if (value && !this.wordSet.has(value)) { - // this.wordArr.push(value) - // this.wordSet.add(value) - // } - // }) - // this.setValue() - // debug(`list ${this.listID} add ${values.length} lines, OK`) - // } catch (err) { - // error(err) - // error(`list ${this.listID} add ${values.length} lines, ERROR`) - // } - // } - /** * 编辑整个列表 * @param values 编辑框内输入的列表 diff --git a/src/rules/bangumi.ts b/src/rules/bangumi.ts index 7aa6f74..9a109dd 100644 --- a/src/rules/bangumi.ts +++ b/src/rules/bangumi.ts @@ -1010,13 +1010,19 @@ if (isPageBangumi()) { itemID: 'video-page-hide-root-reply-dislike-reply-btn', description: '一级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.reply-info:not(:has(i.disliked)) .reply-btn, - .reply-info:not(:has(i.disliked)) .reply-dislike { - visibility: hidden; + itemCSS: ` + .reply-item:not(:has(i.disliked)) :is(.reply-btn, .reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} } - .reply-item:hover .reply-info .reply-btn, - .reply-item:hover .reply-info .reply-dislike { - visibility: visible !important; + .reply-item:hover :is(.reply-btn, .reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 二级评论 踩/回复 只在hover时显示, 默认开启 @@ -1024,13 +1030,19 @@ if (isPageBangumi()) { itemID: 'video-page-hide-sub-reply-dislike-reply-btn', description: '二级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.sub-reply-container .sub-reply-item:not(:has(i.disliked)) .sub-reply-btn, - .sub-reply-container .sub-reply-item:not(:has(i.disliked)) .sub-reply-dislike { - visibility: hidden; + itemCSS: ` + .sub-reply-item:not(:has(i.disliked)) :is(.sub-reply-btn, .sub-reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} } - .sub-reply-container .sub-reply-item:hover .sub-reply-btn, - .sub-reply-container .sub-reply-item:hover .sub-reply-dislike { - visibility: visible !important; + .sub-reply-item:hover :is(.sub-reply-btn, .sub-reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 隐藏 大表情 diff --git a/src/rules/dynamic.ts b/src/rules/dynamic.ts index 1080958..8dbef6c 100644 --- a/src/rules/dynamic.ts +++ b/src/rules/dynamic.ts @@ -624,13 +624,19 @@ if (isPageDynamic()) { itemID: 'video-page-hide-root-reply-dislike-reply-btn', description: '一级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.reply-info:not(:has(i.disliked)) .reply-btn, - .comment-container .reply-info:not(:has(i.disliked)) .reply-dislike { - visibility: hidden; + itemCSS: ` + .reply-item:not(:has(i.disliked)) :is(.reply-btn, .reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} } - .comment-container .reply-item:hover .reply-btn, - .comment-container .reply-item:hover .reply-dislike { - visibility: visible !important; + .reply-item:hover :is(.reply-btn, .reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 二级评论 踩/回复 只在hover时显示, 默认开启 @@ -638,13 +644,19 @@ if (isPageDynamic()) { itemID: 'video-page-hide-sub-reply-dislike-reply-btn', description: '二级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.sub-reply-item:not(:has(i.disliked)) .sub-reply-btn, - .comment-container .sub-reply-item:not(:has(i.disliked)) .sub-reply-dislike { - visibility: hidden; + itemCSS: ` + .sub-reply-item:not(:has(i.disliked)) :is(.sub-reply-btn, .sub-reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} } - .comment-container .sub-reply-item:hover .sub-reply-btn, - .comment-container .sub-reply-item:hover .sub-reply-dislike { - visibility: visible !important; + .sub-reply-item:hover :is(.sub-reply-btn, .sub-reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 隐藏 大表情 diff --git a/src/rules/video.ts b/src/rules/video.ts index 8da4d2b..db5cc6e 100644 --- a/src/rules/video.ts +++ b/src/rules/video.ts @@ -1830,13 +1830,19 @@ if (isPageVideo() || isPagePlaylist()) { itemID: 'video-page-hide-root-reply-dislike-reply-btn', description: '一级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.reply-info:not(:has(i.disliked)) .reply-btn, - .comment-container .reply-info:not(:has(i.disliked)) .reply-dislike { - visibility: hidden; - } - .comment-container .reply-item:hover .reply-btn, - .comment-container .reply-item:hover .reply-dislike { - visibility: visible !important; + itemCSS: ` + .reply-item:not(:has(i.disliked)) :is(.reply-btn, .reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} + } + .reply-item:hover :is(.reply-btn, .reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 二级评论 踩/回复 只在hover时显示, 默认开启 @@ -1844,13 +1850,19 @@ if (isPageVideo() || isPagePlaylist()) { itemID: 'video-page-hide-sub-reply-dislike-reply-btn', description: '二级评论 踩/回复 只在hover时显示', defaultStatus: true, - itemCSS: `.sub-reply-item:not(:has(i.disliked)) .sub-reply-btn, - .comment-container .sub-reply-item:not(:has(i.disliked)) .sub-reply-dislike { - visibility: hidden; - } - .comment-container .sub-reply-item:hover .sub-reply-btn, - .comment-container .sub-reply-item:hover .sub-reply-dislike { - visibility: visible !important; + itemCSS: ` + .sub-reply-item:not(:has(i.disliked)) :is(.sub-reply-btn, .sub-reply-dislike) { + opacity: 0; + } + @keyframes appear { + 0% {opacity: 0;} + 100% {opacity: 1;} + } + .sub-reply-item:hover :is(.sub-reply-btn, .sub-reply-dislike) { + animation: appear; + animation-duration: 0.2s; + animation-delay: 0.3s; + animation-fill-mode: forwards; }`, }), // 隐藏 大表情 diff --git a/vite.config.ts b/vite.config.ts index 99b7235..44f86b8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ userscript: { name: 'bilibili 页面净化大师', namespace: 'http://tampermonkey.net/', - version: '3.7.4', + version: '3.7.5', description: '净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站', author: 'festoney8',