434
editsAd placeholder
User:Crashaholic/vector.js: Difference between revisions
Jump to navigation
Jump to search
WILL THIS WORK PART 2????
Crashaholic (talk | contribs) (hmm) |
Crashaholic (talk | contribs) (WILL THIS WORK PART 2????) |
||
Line 16: | Line 16: | ||
localStorage.setItem(key, 'dark'); | localStorage.setItem(key, 'dark'); | ||
} | } | ||
if (lightmode == 'dark') currentMode = 0; | |||
if (lightmode == 'light') currentMode = 1; | |||
function switchTheme() { | function switchTheme() { | ||
Line 38: | Line 41: | ||
node1.appendChild(node2); | node1.appendChild(node2); | ||
node2.setAttribute('onclick', 'switchTheme()'); | node2.setAttribute('onclick', 'switchTheme()'); | ||
if ( | if (!currentMode) | ||
node2.innerText = "Change to Light Theme"; | node2.innerText = "Change to Light Theme"; | ||
else if ( | else if (currentMode) | ||
node2.innerText = "Change to Dark Theme" | node2.innerText = "Change to Dark Theme"; | ||
node1.classList += "mw-list-item"; | node1.classList += "mw-list-item"; | ||
} | } | ||
Line 85: | Line 88: | ||
set_var("--btn-active-bdr", "rgb(61, 43, 8)"); | set_var("--btn-active-bdr", "rgb(61, 43, 8)"); | ||
set_var("--btn-active-fg", "rgb(44, 34, 16)"); | set_var("--btn-active-fg", "rgb(44, 34, 16)"); | ||
$('.theme-dark-grey').each(function() { | |||
$(this).find('*').addClass('theme-light'); | |||
}); | |||
} | } |