const dashBut = document.createElement("a") dashBut.innerHTML = "dashboard" dashBut.setAttribute("href", location.origin + "/mod.php?/") const toggleBot = document.createElement("a") toggleBot.innerHTML = "toggle mod.php" if (location.href.includes("mod.php")) { toggleBot.setAttribute("href", location.href.replace("mod.php?/", "")) } else { toggleBot.setAttribute("href", location.origin + "/mod.php?" + location.pathname) } const span = document.querySelector("div.boardlist:nth-child(1) > span:nth-child(1)") span.insertBefore(dashBut, span.lastChild) span.insertBefore(new Text(" / "), dashBut) span.insertBefore(toggleBot, span.lastChild) span.insertBefore(new Text(" / "), toggleBot) if (location.href.includes("mod.php")) { const warning = document.createElement("div"); warning.className = "mod-warning"; warning.innerText = "âš  You are in moderation mode âš "; const boardlist = document.querySelector("div.boardlist"); if (boardlist) boardlist.parentNode.insertBefore(warning, boardlist.nextSibling); const style = document.createElement("style"); style.innerHTML = ` .mod-warning { padding: 0.2em; text-align: center; font-weight: bold; color: white; position: fixed; background: repeating-linear-gradient(45deg, #ffeb3b 0, #ffeb3b 15px, #000 15px, #000 27px); text-shadow: 1px 1px 2px black; font-size: 1.2em; /* background: repeating-linear-gradient(45deg, #ffeb3b, #ffeb3b 10px, #000 10px, #000 20px); */ background-size: 38px 38px; animation: caution-move 1s linear infinite; /* border-radius: 8px; */ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3); } @keyframes caution-move { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } `; document.head.appendChild(style); }