User:Stumblean/common.js: Difference between revisions

Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 1: Line 1:
(function() {
(function() {
     // Create a container
     // Create the menu container
     const menu = document.createElement("div");
     const menu = document.createElement("div");
     menu.id = "mahitoMenu";
     menu.id = "mahitoMenu";
Line 22: Line 22:
     menu.appendChild(title);
     menu.appendChild(title);


     // Add a button (example)
     // "Open Explanation" button (placeholder)
     const btn = document.createElement("button");
     const openBtn = document.createElement("button");
     btn.textContent = "Transfigure Stuff";
     openBtn.textContent = "Open Explanation";
     btn.style.background = "#444";
     openBtn.style.background = "#444";
     btn.style.color = "#fff";
     openBtn.style.color = "#fff";
     btn.style.border = "none";
     openBtn.style.border = "none";
     btn.style.padding = "5px 10px";
     openBtn.style.padding = "5px 10px";
     btn.style.cursor = "pointer";
     openBtn.style.cursor = "pointer";
     btn.onclick = function() {
     openBtn.onclick = function() {
         alert("You have been transfigured 💀");
         // do something later
        console.log("Open Explanation clicked");
     };
     };
     menu.appendChild(btn);
     menu.appendChild(openBtn);


     // Add the menu to the page
     // Add the menu to the page
     document.body.appendChild(menu);
     document.body.appendChild(menu);
})();
})();