Skip to content

Instantly share code, notes, and snippets.

@theodric
Last active December 20, 2024 20:42
Show Gist options
  • Save theodric/2c3b234c8a668eec50ceb3688aad0786 to your computer and use it in GitHub Desktop.
Save theodric/2c3b234c8a668eec50ceb3688aad0786 to your computer and use it in GitHub Desktop.
Mikrotik webfig color inverter userstyle (dark mode)
// ==UserScript==
// @name MikroTik Inverted Dark Mode
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Invert colors on MikroTik webfig
// @author Peepee Poopoo
// @source https://gist.github.com/theodric/2c3b234c8a668eec50ceb3688aad0786
// @fart hey you, edit this file so it works on your device's IP address/DNS name
// @match http://192.168.88.1/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Inject custom styles to invert colors
const invertColorsCSS = `
html {
filter: invert(1) hue-rotate(180deg) !important;
background: #000 !important;
}
img, video {
filter: invert(1) hue-rotate(180deg) !important;
}
`;
// Append the styles to the document
const styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.innerText = invertColorsCSS;
document.head.appendChild(styleSheet);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment