网页添加灰色滤镜
创始人
2024-03-08 02:17:58
0

网页添加灰色滤镜

b站的灰色滤镜

image-20221201093325627

我校的灰色滤镜
在这里插入图片描述

CSDN的灰色滤镜

image-20221201094830690

自己调制css主题,给网页加上滤镜.

更快捷的,可以在可以调制css的浏览器插件中加上滤镜,只要开启插件就会自动修改网站滤镜

以darkreader为例打开其开发者工具

在这里插入图片描述

*INVERT
.jfk-bubble.gtx-bubble
.captcheck_answer_label > input + img
span#closed_text > img[src^="https://www.gstatic.com/images/branding/googlelogo"]
span[data-href^="https://www.hcaptcha.com/"] > #icon
#bit-notification-bar-iframe
::-webkit-calendar-picker-indicatorCSS
.vimvixen-hint {background-color: ${#ffd76e} !important;border-color: ${#c59d00} !important;color: ${#302505} !important;
}
html{	-webkit-filter: grayscale(0%);	-moz-filter: grayscale(0%);	-ms-filter: grayscale(0%);	-o-filter: grayscale(0%);	filter: grayscale(0%);
}
::placeholder {opacity: 0.5 !important;
}
#edge-translate-panel-body,
.MuiTypography-body1,
.nfe-quote-text {color: var(--darkreader-neutral-text) !important;
}
gr-main-header {background-color: ${lightblue} !important;
}
.tou-z65h9k,
.tou-mignzq,
.tou-1b6i2ox,
.tou-lnqlqk {background-color: var(--darkreader-neutral-background) !important;
}
.tou-75mvi {background-color: ${rgb(207, 236, 245)} !important;
}
.tou-ta9e87,
.tou-1w3fhi0,
.tou-1b8t2us,
.tou-py7lfi,
.tou-1lpmd9d,
.tou-1frrtv8,
.tou-17ezmgn {background-color: ${rgb(245, 245, 245)} !important;
}
.tou-uknfeu {background-color: ${rgb(250, 237, 218)} !important;
}
...

这就是darkreader默认的样式

该文件的结构是,首先是全局的设置,对所有网站起作用

然后是针对性的设置,只对有些域名的网站起作用.显然后面的css设置会覆盖前面的css设置,

darkreader的css设置会覆盖网站自己的css

我们只需要在全局位置覆盖网站自己的css

首先观察应该把覆盖css放到哪里,以我校课程网站为例

image-20221201094203916

这个滤镜在head的style元素中,调的是整个html的属性

也就是说,真正有效的是

html{	-webkit-filter: grayscale(100%);	-moz-filter: grayscale(100%);	-ms-filter: grayscale(100%);	-o-filter: grayscale(100%);	filter: grayscale(100%);
}

这里调整百分比可以设置滤镜灰度

只需要把这个添加到darkreader中的全局位置然后apply
在这里插入图片描述

此后不管访问什么网页,只要打开darkreader,一定带上灰色滤镜

比如github

image-20221201095054001

相关内容

热门资讯

保存时出现了1个错误,导致这篇... 当保存文章时出现错误时,可以通过以下步骤解决问题:查看错误信息:查看错误提示信息可以帮助我们了解具体...
汇川伺服电机位置控制模式参数配... 1. 基本控制参数设置 1)设置位置控制模式   2)绝对值位置线性模...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
表格中数据未显示 当表格中的数据未显示时,可能是由于以下几个原因导致的:HTML代码问题:检查表格的HTML代码是否正...
本地主机上的图像未显示 问题描述:在本地主机上显示图像时,图像未能正常显示。解决方法:以下是一些可能的解决方法,具体取决于问...
表格列调整大小出现问题 问题描述:表格列调整大小出现问题,无法正常调整列宽。解决方法:检查表格的布局方式是否正确。确保表格使...
不一致的条件格式 要解决不一致的条件格式问题,可以按照以下步骤进行:确定条件格式的规则:首先,需要明确条件格式的规则是...
Android|无法访问或保存... 这个问题可能是由于权限设置不正确导致的。您需要在应用程序清单文件中添加以下代码来请求适当的权限:此外...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...