MediaWiki:Common.js: Difference between revisions

From jugglingpatterns
Content deleted Content added
No edit summary
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
function loadModule(src) {
// use by using Template:AnimateSiteswap which provides the matching html
const s = document.createElement('script');
import("/js/animation.js");
s.type = 'module';
import("/js/darkreader/darkreader.js");
s.src = src;
document.head.appendChild(s);
}


// deine beiden Dateien laden
DarkReader.enable({
loadModule('/js/animation.js');
brightness: 100,
contrast: 90,
sepia: 10
});


// use by using Template:AnimateSiteswap which provides the matching html
DarkReader.disable();
console.log("importing animations");

// Enable when the system color scheme is dark.
DarkReader.auto({
brightness: 100,
contrast: 90,
sepia: 10
});

// Stop watching for the system color scheme.
DarkReader.auto(false);

// Get the generated CSS of Dark Reader returned as a string.
const CSS = await DarkReader.exportGeneratedCSS();

// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();

Latest revision as of 19:20, 8 September 2025

function loadModule(src) {
    const s = document.createElement('script');
    s.type = 'module';
    s.src = src;
    document.head.appendChild(s);
}

// deine beiden Dateien laden
loadModule('/js/animation.js');

// use by using Template:AnimateSiteswap which provides the matching html
console.log("importing animations");