Ad placeholder

User:Crashaholic/vector.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
function create_nightmode_toggle()
var currentMode = 0; // 0 is dark, 1 is light
// used by the text to determine toggle text
// is 0 by default cuz, well, the site's default is dark
// plan: write to cookie to store light or dark mode persistency
// cuz it actually would be annoying to keep clicking
// this cookie should only be for the user who has this script
// trying to say that this whole thing should *generally* be safe
// i hope
// how tf do i do cookies LMAO
 
 
 
// creates the toggle in the page
// will be beside the user's name in the "vector-menu-content-list"
function create_night_mode_toggle()
{
{
var foo = document.querySelector(".vector-menu-content-list");
var node1 = document.createElement("li");
var node2 = document.createElement("a");
node1.appendChild(node2);
foo.appendChild(node1);
node1.setAttribute("id", "dark_mode_toggle");
node1.innerHTML = "abcd";
}
}

Navigation menu