Replace NixOS Logo to be pride

Too short pride month.

As of 2025-08-05. See the latest version.

// ==UserScript==
// @name        Replace NixOS Logo to be pride
// @name:zh-CN  替换 NixOS 图标来变得骄傲
// @namespace   http://tampermonkey.net/
// @match       https://search.nixos.org/*
// @grant       none
// @description Too short pride month.
// @description:zh-CN 骄傲月疑似有点短了。
// @version 0.0.1.20250805082602
// ==/UserScript==

(function() {
    'use strict';


    const style = document.createElement('style');
    style.id = 'rgb-marquee-style';
    style.textContent = `
  
        :root {
            --marquee-color: hsl(0, 100%, 50%); 
            --light-blue: #63b3ed; 
        }

        @media (prefers-color-scheme: dark) {
            :focus-visible {
                border-radius: 8px !important;
                outline-color: var(--marquee-color) !important;
                outline-offset: 4px !important;
                outline-style: solid !important;
                outline-width: 3px !important;
                transition: outline-color 0.1s linear;
            }
        }

        a, a:focus, a:focus-visible, a:hover {
            color: var(--marquee-color) !important;
            text-decoration: none;
            transition: color 0.1s linear;
        }

        .label-info {
            background: var(--marquee-color) !important; 
            transition: background 0.1s linear; 
        }
    `;
    document.head.appendChild(style);

    let hue = 0; 
    const root = document.documentElement; 

    setInterval(() => {
        hue = (hue + 2) % 360; 
        root.style.setProperty('--marquee-color', `hsl(${hue}, 100%, 50%)`); // 设置 --marquee-color CSS变量
    }, 50); 


    document.addEventListener('DOMContentLoaded', function() {
        const images = document.querySelectorAll('img'); 

        images.forEach(img => {
            if (img.src.includes('/images/nix-logo.png')) {
                img.src = img.src.replace('/images/nix-logo.png', '/images/nix-logo-pride.png');
            }
        });
    });
})();


// Replace NixOS Pride Logo was reported 2025-08-05 for Abusive or hateful content
// The reporter said:

//     homophobic

// 米凛(MiRin)Author said:

//     Hi, I'm also a transgender. The accusation that I am homophobic is inaccurate. I have adhd, and colored logos are sensitive to me. According to Apple's color section on inclusive design (https://developer.apple.com/design/human-interface-guidelines/color#Inclusive-color), my attention is not allowed to focus on the search box on the website. On the contrary, the colored logo will distract me. Before publishing this script, I asked several friends who are sexual minorities for advice, and they all had no objection to it. It has really helped friends with the same adhd.