MediaWiki:Monobook.js: Difference between revisions

From The Soysylum
Jump to navigationJump to search
(Created page with "→‎All JavaScript here will be loaded for users of the MonoBook skin: document.addEventListener('DOMContentLoaded', function() { var logo = document.querySelector('.mw-wiki-logo'); if (logo) { logo.style.filter = 'none'; // Remove any filters logo.style.backgroundImage = "url('path/to/original/logo/image.png')"; // Set the original logo image // Set any other styles as needed } });")
 
No edit summary
 
Line 3: Line 3:
     var logo = document.querySelector('.mw-wiki-logo');
     var logo = document.querySelector('.mw-wiki-logo');
     if (logo) {
     if (logo) {
         logo.style.filter = 'none'; // Remove any filters
        // This removes any inversion applied by dark mode
         logo.style.backgroundImage = "url('path/to/original/logo/image.png')"; // Set the original logo image
         logo.style.filter = 'invert(0) hue-rotate(0deg)';
        // Set any other styles as needed
        // If the image was also flipped horizontally or vertically, you can revert it using the transform property
         logo.style.transform = 'scaleX(1) scaleY(1)';
     }
     }
});
});

Latest revision as of 05:57, 11 February 2024

/* All JavaScript here will be loaded for users of the MonoBook skin */
document.addEventListener('DOMContentLoaded', function() {
    var logo = document.querySelector('.mw-wiki-logo');
    if (logo) {
        // This removes any inversion applied by dark mode
        logo.style.filter = 'invert(0) hue-rotate(0deg)';
        // If the image was also flipped horizontally or vertically, you can revert it using the transform property
        logo.style.transform = 'scaleX(1) scaleY(1)';
    }
});