版本比较
洛谷界面圆角高斯模糊美化
正文
增加 49 行删除 4 行
1234567272 行未改动全部展开28028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632718 行未改动346347348349307350351352353354355356357197 行未改动全部展开55555655755851355956056156251856356456556656745 行未改动6136146156165726176186196206214 行未改动(已经放弃)
# 前言个人一直比较喜欢模糊效果,尤其是在 macOS 和 iOS 中滑动页面顶栏也能自然地模糊下方内容。于是和 DeepSeek 一起写了这个 Tampermonkey 脚本,为洛谷添加统一圆角和高斯模糊效果。
此前虽有类似脚本,但大多已停止更新,可能无法完美适配新版页面。272 行未改动全部展开 .refined-input.keyword input { border-radius: 8px !important; }
/* ========== 搜索题单输入框圆角 ========== */ .search-box-right .refined-input { border-radius: 8px !important; overflow: hidden !important; } .search-box-right .refined-input input { border-radius: 8px !important; }
/* ========== IDE 设置下拉菜单内输入框圆角 ========== */ .refined-input.ide-setting { border-radius: 8px !important; overflow: hidden !important; } .refined-input.ide-setting input { border-radius: 8px !important; }
/* ========== IDE 设置下拉菜单毛玻璃与圆角(统一12px) ========== */ .dropdown:has(.setting-dropdown) { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; } div.setting-dropdown { background: rgba(255, 255, 255, 0.85) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; border-radius: 12px !important; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important; padding: 12px 16px !important; /* 增加内边距,使选项更宽松 */ } div.setting-dropdown * { text-shadow: 0 0 1px rgba(255, 255, 255, 0.6); }
/* SweetAlert2 图标修复 */ .swal2-success-circular-line-left, .swal2-success-fix, .swal2-success-circular-line-right,18 行未改动 .am-modal-prompt .am-modal-dialog *, .am-selected-content *, .mp-dialog-container *, .filters *, .refined-input.keyword * { .refined-input.keyword *, .search-box-right .refined-input *, .refined-input.ide-setting *, div.setting-dropdown * { text-shadow: 0 0 1px rgba(255, 255, 255, 0.6); }
/* ========== 仅添加圆角,不改变背景色(已排除用户浮动卡片) ========== */197 行未改动全部展开 overflow: hidden !important; }
/* ========== 用户主页卡片裁切(带有 .menu 导航的卡片) ========== */ /* 提升特异性以覆盖 .l-card:not(.float-card):not(.l-card.container.type-burger) */ .l-card:has(.menu):not(.float-card):not(.l-card.container.type-burger) { overflow: hidden !important; }
/* ========== 操作按钮栏毛玻璃圆角(仅限点赞/收藏栏) ========== */ /* ========== 操作按钮栏毛玻璃圆角 ========== */ .actions.left-mode.hasDrawer { background: rgba(255, 255, 255, 0.65) !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;45 行未改动::::
# 注意事项
由于使用了 `backdrop-filter` 和 `:has()` 选择器等较新的 CSS 特性,建议使用最新版浏览器。如果你的浏览器不支持,会导致部分样式意外出现在不该出现的地方,不是脚本的问题。由于使用了 `backdrop-filter` 和 `:has()` 选择器等较新的 CSS 特性,建议使用最新版浏览器。如果你的浏览器不支持,会导致部分样式意外出现在不该出现的地方,不是脚本的问题。如果最新版浏览器仍有问题,请反馈。
部分元素因为玄学原因无法生效模糊效果,所以改为了不透明。
4 行未改动