drymonfidelia

V2 隐藏丑丑头像 CSS 代码

  •  4
     
  •   drymonfidelia · May 16, 2024 · 16677 views
    This topic created in 751 days ago, the information mentioned may be changed or developed.
    .avatar, #my-recent-topics > div > div > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > a:nth-child(1) {display: none}
    

    填入 https://v2ex.com/settings 自定义 CSS ,选中启用开关,保存即可

    缺点是正常头像也会被隐藏,但至少比显示丑丑头像好

    130 replies    2024-05-20 11:31:07 +08:00
    1  2  
    beetlerx
        101
    beetlerx  
       May 17, 2024
    来了来了
    justfun
        102
    justfun  
       May 17, 2024
    为什么要隐藏
    Kristd
        103
    Kristd  
       May 17, 2024
    有被歧视到
    JoryJoestar
        104
    JoryJoestar  
       May 17, 2024
    丑头人出击!
    EJW
        105
    EJW  
       May 17, 2024
    这头像怎么你了
    15855pm
        106
    15855pm  
       May 17, 2024
    哪里丑了,有时候多找找自己的原因好吧,这么多年有变帅吗?
    garipan
        107
    garipan  
       May 17, 2024
    怎么这么多丑人头啊笑死
    YuanCome
        108
    YuanCome  
       May 17, 2024
    集合了兄弟们
    LavaC
        109
    LavaC  
       May 17, 2024
    @Chad0000 #2 我发布了一个隐藏恶意发言的代码 body{display:none}
    Lamlam147
        110
    Lamlam147  
       May 17, 2024
    为什么要隐藏起来?
    ysicing
        111
    ysicing  
       May 17, 2024
    我觉得我的头像还行啊
    yrhhh
        112
    yrhhh  
       May 17, 2024
    请求出战🤣
    cutehalo
        113
    cutehalo  
       May 17, 2024
    我是像素人
    Sanshi4396
        114
    Sanshi4396  
       May 17, 2024
    我来看看怎么个事
    Vegetable
        115
    Vegetable  
       May 17, 2024
    @sss15 把这个帖子里边的人全屏蔽了就好了
    PoorBe
        116
    PoorBe  
       May 17, 2024
    你嫌我丑?
    binaryify
        117
    binaryify  
       May 17, 2024 via iPhone
    duron600
        118
    duron600  
       May 17, 2024
    多谢楼主
    Zzdex
        119
    Zzdex  
       May 17, 2024
    哪里丑了
    ljsh093
        120
    ljsh093  
       May 17, 2024
    @LavaC #109 站长我 v2 怎么打不开了
    LavaC
        121
    LavaC  
       May 17, 2024
    @ljsh093 你不会真填了吧?打开开发者控制台把样式去掉
    LavaC
        122
    LavaC  
       May 17, 2024 via Android
    @LavaC 没了解过 CSS 的真别试,这个是会直接把整个网页隐藏掉的。
    V2Sean
        123
    V2Sean  
       May 17, 2024
    丑丑头像人集合
    kaishi123
        124
    kaishi123  
       May 17, 2024
    我是来看丑头像的
    jspatrick
        125
    jspatrick  
       May 17, 2024
    这个头像有特征的,脸的颜色都是 rgb(255,201,169),占比总像素在第二或第三,屏蔽脚本要解决读取图片像素跨域问题,就不放出来了
    elechi
        126
    elechi  
       May 17, 2024
    我的丑吗?
    davidqw
        127
    davidqw  
       May 18, 2024
    有老哥已经开发出丑丑 NFT 薄荷工具了,抢注中
    https://uglyface.lol/
    happybabys
        128
    happybabys  
       May 18, 2024 via iPhone
    lol
    ljsh093
        129
    ljsh093  
       May 20, 2024
    @LavaC #121 怎么可能,他这个 css 了解过的一眼都能看出来,不过我这边还是建议再添加个 important 呢
    banlink
        130
    banlink  
       May 20, 2024
    来个 js 的,好像还有点问题
    ```js
    // ==UserScript==
    // @name New Userscript
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @description try to take over the world!
    // @author You
    // @match https://v2ex.com/*
    // @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
    // @grant GM_xmlhttpRequest
    // ==/UserScript==


    (function () {
    "use strict";
    let avatar = document.getElementsByClassName("avatar");
    for (let index = 0; index < avatar.length; index++) {
    let item = avatar[index];
    GM_xmlhttpRequest({
    method: "GET",
    responseType: "blob",
    url: item.src,
    onload: function (response) {
    if (response.status === 200) {
    new Promise((resolve, reject) => {
    let reader = new FileReader();
    reader.addEventListener("load", () => {
    let img = new Image();
    img.setAttribute("crossOrigin", "anonymous");
    img.src = reader.result;
    img.addEventListener("load", () => resolve(img));
    });
    reader.readAsDataURL(response.response);
    }).then((img) => getImageData(item, img));
    }
    },
    });
    }

    function getImageData(item, img) {
    let canvas = document.createElement("canvas");
    canvas.setAttribute("width", `${item.width}px`);
    canvas.setAttribute("height", `${item.height}px`);
    var ctx = canvas.getContext("2d");
    ctx.drawImage(img, 0, 0, item.width, item.height);


    let imgData = ctx.getImageData(
    item.width / 4,
    item.height / 4,
    item.width / 2,
    item.height / 2
    );

    let map = new Map();
    for (let i = 0; i < imgData.data.length; i += 4) {
    let r = imgData.data[i];
    let g = imgData.data[i + 1];
    let b = imgData.data[i + 2];
    // let a
    let rgb = `${r},${g},${b}`;
    if (!map.has(rgb)) {
    map.set(rgb, 1);
    } else {
    map.set(rgb, map.get(rgb) + 1);
    }
    }
    // 寻找最大值
    let maxValue = 0;
    let color = "";
    map.forEach((value, key) => {
    if (value > maxValue) {
    maxValue = value;
    color = key;
    }
    });
    if (color == "255,201,169") {
    console.log("隐藏丑丑头像!");
    item.style.display = "none";
    }
    }
    })();

    ```
    1  2  
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2671 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 75ms · UTC 12:00 · PVG 20:00 · LAX 05:00 · JFK 08:00
    ♥ Do have faith in what you're doing.