网页添加灰色滤镜
创始人
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

相关内容

热门资讯

前端-session、jwt 目录:   (1)session (2&#x...
linux入门---制作进度条 了解缓冲区 我们首先来看看下面的操作: 我们首先创建了一个文件并在这个文件里面添加了...
关于测试,我发现了哪些新大陆 关于测试 平常也只是听说过一些关于测试的术语,但并没有使用过测试工具。偶然看到编程老师...
前缀和与对数器与二分法 1. 前缀和 假设有一个数组,我们想大量频繁的去访问L到R这个区间的和,...
nodejs:本地安装nvm实... 一、背景-使用不同版本node的原因 vue3+ts、nuxt3版本,node...
JAVA集合知识整理 Java集合知识整理 HashMap相关 HashMap的底层数据结构:jdk1.8之...
无刷直流电机介绍及单片机控制实... 无刷直流电机介绍及单片机控制实例前言基本概念优势与劣势使用寿命基本结构使用单片机控制实例电子调速器&...
fwdiary(2) dp2 1.传纸条  AcWing 275. 传纸条 - AcWing 走两条路,走一条最大的...
常用的DOS命令 常用的DOS命令 DOS(Disk Operating System,磁...
<C++> 类和对象(下) 1.const成员函数将const修饰的“成员函数”称之为const成员函数,cons...