• 网页添加灰色滤镜


    网页添加灰色滤镜

    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-indicator
    
    CSS
    .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;
    }
    ...
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56

    这就是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%);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

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

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

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

    比如github

    image-20221201095054001

  • 相关阅读:
    四甲基罗丹明TRITC修饰聚缩醛Polyacetal/HA透明质酸载药纳米粒|TRITC-Polyacetal|TRITC-TK-PEG-HA
    Git Bash/GUI Here “找不到应用程序问题
    MapReduce(林子雨慕课课程)
    【软考:系统集成项目管理】之 五组十域图
    [洛谷] P1097 [NOIP2007 提高组] 统计数字
    C++对象模型(20)-- 函数语义学:函数和变量的绑定问题
    鸿蒙App基础
    spring+pom-注意多重依赖时的兼容问题[java.lang.NoSuchMethodError]
    JSP第三篇 -----JSP浅聊JSTL标签库
    【王道】操作系统OS第三章存储系统(三)
  • 原文地址:https://blog.csdn.net/qq_26131031/article/details/128132501