OpenStreetMap Dark Mode (filter-based)

Dark Mode for OpenStreetMap tiles based on inverting the colors and then rotating the hue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         OpenStreetMap Dark Mode (filter-based)
// @namespace    http://tampermonkey.net/
// @version      1.1.0
// @description  Dark Mode for OpenStreetMap tiles based on inverting the colors and then rotating the hue.
// @author       scy
// @license      MIT
// @match        *://www.openstreetmap.org/*
// @grant        GM_addStyle
// ==/UserScript==

// SPDX-FileCopyrightText: 2024 scy
// SPDX-License-Identifier: MIT

(function() {
    'use strict';

    GM_addStyle(`
      @media (prefers-color-scheme: dark) {
        /* Add filter to the tile images and map key. We need to include
         * .leaflet-tile-container in the selector since that's what the dimming
         * on the original site is targeting (as of 2024-11-15). */
        .leaflet-tile-container .leaflet-tile, .mapkey-table-entry td:first-child > * {
          filter: invert(95%) hue-rotate(180deg);
        }
      }
    `);
})();