Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Citizen.js: Difference between revisions

MediaWiki interface page
(Blanked the page)
Tag: Blanking
No edit summary
Tag: Reverted
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the Citizen skin */


// Page Header IMG
var page = document.querySelector("body");
if (page.classList.contains('page-Main_Page')) {
var mwBody = document.getElementById('content');
var newDiv = document.createElement('div');
newDiv.setAttribute('class', 'header-hero');
newDiv.innerHTML = '<div class="header-hero-image" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 150%), var(--hero-image);background-size: cover;background-position: center center;height: 36vh;margin-bottom: -31vh;"></div>';
mwBody.parentNode.insertBefore(newDiv, mwBody);
}
var html = document.querySelector("html");
if (html.classList.contains('skin-citizen-dark')) {
document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/2/26/Spirit_E1_flying_fast_over_Orison.jpg)');
} else {
document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/b/bd/890Jump_beach.jpg)');
}
document.addEventListener('click', function(event) {
  setTimeout(function() {
    var html = document.querySelector("html");
    if (html.classList.contains("skin-citizen-dark")) {
      document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/2/26/Spirit_E1_flying_fast_over_Orison.jpg)');
    } else if (html.classList.contains("skin-citizen-light"))
    {
      document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/b/bd/890Jump_beach.jpg)');
    }
  }, 100);
}, true);

Revision as of 16:31, 20 January 2023

/* All JavaScript here will be loaded for users of the Citizen skin */

// Page Header IMG 
var page = document.querySelector("body");
if (page.classList.contains('page-Main_Page')) {
	var mwBody = document.getElementById('content');
	var newDiv = document.createElement('div');
	newDiv.setAttribute('class', 'header-hero');
	newDiv.innerHTML = '<div class="header-hero-image" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 150%), var(--hero-image);background-size: cover;background-position: center center;height: 36vh;margin-bottom: -31vh;"></div>';
	mwBody.parentNode.insertBefore(newDiv, mwBody);
}

var html = document.querySelector("html");
	if (html.classList.contains('skin-citizen-dark')) {
		document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/2/26/Spirit_E1_flying_fast_over_Orison.jpg)');
	} else {
		document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/b/bd/890Jump_beach.jpg)');
}

document.addEventListener('click', function(event) {
  setTimeout(function() {
    var html = document.querySelector("html");
    if (html.classList.contains("skin-citizen-dark")) {
      document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/2/26/Spirit_E1_flying_fast_over_Orison.jpg)');
    } else if (html.classList.contains("skin-citizen-light"))
    {
      document.documentElement.style.setProperty('--hero-image', 'url(https://static.miraheze.org/sctoolszhwiki/b/bd/890Jump_beach.jpg)');
    }
  }, 100);
}, true);