MediaWiki:Common.js

Version från den 21 oktober 2021 kl. 09.43 av Sannadal-admin (diskussion | bidrag) (Skapade sidan med '→‎Minerva Nueue 2.0: window.onscroll = function() {scrollFunction()}; function scrollFunction() { if (window.innerWidth > 768) { if (document.body.scrollTop > 100 || d...')
(skillnad) ← Äldre version | Nuvarande version (skillnad) | Nyare version → (skillnad)

OBS: Efter du sparat sidan kan du behöva tömma din webbläsares cache för att se ändringarna.

  • Firefox / Safari: Håll ned Skift och klicka på Uppdatera sidan eller tryck antingen Ctrl-F5 eller Ctrl-R (⌘-R på Mac)
  • Google Chrome: Tryck Ctrl-Skift-R (⌘-Shift-R på Mac)
  • Internet Explorer / Edge: Håll ned Ctrl och klicka på Uppdatera eller tryck Ctrl-F5

Opera: Tryck Ctrl-F5.

/* Minerva Nueue 2.0 */

window.onscroll = function() {scrollFunction()};
function scrollFunction() {
  if (window.innerWidth > 768) {
		if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
				document.querySelector(".branding-box img").style.width = "0px";
				document.querySelector(".branding-box img").style.opacity = "0";
				document.querySelector(".header-container").style.width = "200px";
				document.querySelector(".header-container").style.height = "55px";
				document.querySelector(".header-container").style.margin = "0px 0px 0px 0px";
				document.querySelector(".header-container").style.borderRadius = "0px";
				document.querySelector(".header-container").style.borderBottomLeftRadius = "20px";
				document.querySelector(".header-container").style.paddingTop = "0px";
				document.querySelector(".header-container").style.paddingBottom = "0px";
		} else {
				document.querySelector(".branding-box img").style.width = "119px";
				document.querySelector(".branding-box img").style.opacity = "1";
				document.querySelector(".header-container").style.width = "350px";
				document.querySelector(".header-container").style.height = "65px";
				document.querySelector(".header-container").style.margin = "15px";
				document.querySelector(".header-container").style.borderRadius = "20px";
				document.querySelector(".header-container").style.borderBottomLeftRadius = "20px";
				document.querySelector(".header-container").style.paddingTop = "5px";
				document.querySelector(".header-container").style.paddingBottom = "5px";
		}
	} else {
			if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
				document.querySelector(".branding-box img").style.width = "0px";
				document.querySelector(".branding-box img").style.opacity = "0";
				document.querySelector(".header-container").style.width = "189px";
				document.querySelector(".header-container").style.height = "55px";
				document.querySelector(".header-container").style.margin = "0px 0px 0px 0px";
				document.querySelector(".header-container").style.borderRadius = "0px";
				document.querySelector(".header-container").style.borderBottomLeftRadius = "20px";
				document.querySelector(".header-container").style.paddingTop = "0px";
				document.querySelector(".header-container").style.paddingBottom = "0px";
				document.querySelector(".header-container").style.right = "0";
		} else {
				document.querySelector(".branding-box img").style.width = "119px";
				document.querySelector(".branding-box img").style.opacity = "1";
				document.querySelector(".header-container").style.width = "100%";
				document.querySelector(".header-container").style.height = "55px";
				document.querySelector(".header-container").style.margin = "0px";
				document.querySelector(".header-container").style.borderRadius = "0px";
				document.querySelector(".header-container").style.borderBottomLeftRadius = "0px";
				document.querySelector(".header-container").style.paddingTop = "0px";
				document.querySelector(".header-container").style.paddingBottom = "0px";
			}
	}
}
/* Preparing for iOS 15 and macOS Monterey
var link = document.createElement('meta');
function lightthemecolor() {
  link.setAttribute('name', 'theme-color');
  link.content = '#f2f2f2';
  document.getElementsByTagName('head')[0].appendChild(link);
}
function darkthemecolor() {
  link.setAttribute('name', 'theme-color');
  link.content = '#3d3d3d';
  document.getElementsByTagName('head')[0].appendChild(link);
}
if (window.matchMedia && 
    window.matchMedia('(prefers-color-scheme: dark)').matches) {
  darkthemecolor();
} else {
	lightthemecolor();
}
*/