User:Bagusa4/vector.js

function vectorDarkMode { cmp = { // https://material.io/tools/color/#!/?view.left=0&view.right=0&primary.color=212121&secondary.color=616161 'primary': "#212121", 'primary_light': "#484848", 'primary_dark': "#000000", 'secondary': "#616161", 'secondary_light': "#8e8e8e", 'secondary_dark': "#373737", 'text_primary': "#ffffff", 'text_secondary': "#ffffff", 'text_link': "#a2a9b1", 'text_link_visited': "#72777d", }	var css = ""+ "body{"+ "background-color: "+cmp.primary+";"+ "color: "+cmp.text_primary+";}"+ ""+	"h1, h2, h3, h4, h5, h6, #mw-panel .portal h3{color: "+cmp.text_primary+"}"+ ""+	"a{color: "+cmp.text_link+"}"+ "a:visited{color: "+cmp.text_link_visited+"}"+ "#mw-panel .portal .body li a{color: "+cmp.text_link+"}"+ "#mw-panel .portal .body li a:visited{color: "+cmp.text_link_visited+"}"+ ""+	"#mw-page-base{"+ "background-color: "+cmp.primary+";"+ "background-image: -webkit-linear-gradient(top,"+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-image: -moz-linear-gradient(top,"+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-image: linear-gradient("+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-color: "+cmp.primary+";}"+ ""+	".mw-body{"+ "background-color: "+cmp.primary+";"+ //"border: 1px solid "+cmp.secondary_light+";"+ "border: none;"+ "color: "+cmp.text_primary+";}"+ ""+	".toc, .mw-warning, .toccolours, div.thumbinner, .navbox, .sidebar, .metadata, .plainlinks, .plainlist, .mbox-small{"+ "border: 3px double "+cmp.secondary_light+"; background-color: transparent !important;}"+ ".sidebar tbody tr, .sidebar tbody tr td, div.NavFrame div.NavHead{"+ "border: 1px solid "+cmp.secondary_light+"; background-color: transparent !important;}"+ ""+	"#footer ul li{color: "+cmp.text_primary+";}" var head = document.head || document.getElementByTag('head')[0], style = document.createElement('style') style.type = 'text/css' if (style.styleSheet) { style.styleSheet.cssText = css } else { style.appendChild(document.createTextNode(css)) }	head.appendChild(style) /** --- LONG --- **/ /*	function assignStyleByClass(tobj, csstext) { for(var i=0; i<tobj.length; i++) { tobj[i].style.cssText = csstext }	}	document.body.style.backgroundColor = cmp.primary document.body.style.color = cmp.text_primary document.getElementById('mw-page-base').style.cssText = "background-color: "+cmp.primary+";"+ "background-image: -webkit-linear-gradient(top,"+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-image: -moz-linear-gradient(top,"+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-image: linear-gradient("+cmp.primary_light+" 50%,"+cmp.primary+" 100%);"+ "background-color: "+cmp.primary+";" assignStyleByClass(document.getElementsByClassName('mw-body'), 		"background-color: "+cmp.primary+";"+		"border: 1px solid "+cmp.primary_light+";"+		"color: "+cmp.text_primary+";"	) */ }

var fp = document.getElementById("footer-places"), fp_dm = document.createElement("LI")

fp_dm.setAttribute('id', "footer-places-darkmode") fp_dm.innerHTML = "Dark Mode" fp.appendChild(fp_dm)