Twitter Dim Theme

Overrides "Lights Out" mode with Dim theme. Vibe coded with Gemini.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        Twitter Dim Theme
// @namespace   Violentmonkey Scripts
// @match       https://twitter.com/*
// @match       https://x.com/*
// @grant       none
// @version     1.0
// @run-at      document-start
// @author      Gemini
// @description Overrides "Lights Out" mode with Dim theme. Vibe coded with Gemini.
// @license     GNU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    const css = `
        :root {
            --dim-bg: rgb(21, 32, 43);
            --dim-backdrop: rgba(21, 32, 43, .85);
            --dim-border: rgb(56, 68, 77);
            --dim-text-dim: rgb(139, 152, 165);
            --dim-hover: rgba(30, 39, 50, 1);
        }

        /* Immediate Background Overrides */
        html, body, #react-root,
        [style*="background-color: rgb(0, 0, 0)"],
        [style*="background-color: #000000"],
        .r-kemksi {
            background-color: var(--dim-bg) !important;
        }

        /* Lights Out variable overrides */
        body.LightsOut {
            --border-color: var(--dim-border) !important;
            --color: var(--dim-text-dim) !important;
            --hover-bg-color: var(--dim-hover) !important;
        }

        /* Layout Elements: Backdrop, Borders, and Hovers */
        .r-5zmot { background-color: var(--dim-backdrop) !important; }
        .r-1kqtdi0, .r-1igl3o0, .r-2sztyj { border-color: var(--dim-border) !important; }
        .r-g2wdr4, .r-1hdo0pc, .r-cuuowz { background-color: var(--dim-hover) !important; }

        /* Typography and Shadows */
        .cpft_text, [style*="color: rgb(113, 118, 123);"] {
            color: var(--dim-text-dim) !important;
        }

        .r-qo02w8 {
            box-shadow: rgba(136, 153, 166, 0.2) 0px 0px 15px, rgba(136, 153, 166, 0.15) 0px 0px 3px 1px !important;
        }
    `;

    const injectStyles = () => {
        if (document.getElementById('gm-dim-theme')) return; // Don't double-inject
        
        const head = document.head || document.getElementsByTagName('head')[0];
        if (head) {
            const style = document.createElement('style');
            style.id = 'gm-dim-theme';
            style.textContent = css;
            head.appendChild(style);
        } else {
            // Check again on the next animation frame if head isn't ready
            requestAnimationFrame(injectStyles);
        }
    };

    injectStyles();
})();