Created
September 15, 2020 01:00
-
-
Save pfgithub/b03f5ea74a3a0c4d16286552608440af to your computer and use it in GitHub Desktop.
discord font switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
window.buttonarea && window.buttonarea.remove(); | |
const buttonarea = document.createElement("div"); | |
window.buttonarea = buttonarea; | |
const ttl = document.querySelector("#app-mount > div.app-1q1i1E > div > div.layers-3iHuyZ.layers-3q14ss > div > div > nav > div.scroller-2TZvBN.none-2Eo-qx.scrollerBase-289Jih > div:nth-child(2)"); | |
if(!ttl) alert("Uh oh! discord class hashes or app layout changed!"); | |
ttl.appendChild(buttonarea); | |
const mkbtn = (txt, ffmly, onev) => { | |
const btn = document.createElement("button"); | |
btn.textContent = txt; | |
btn.style.fontFamily = ffmly; | |
buttonarea.appendChild(btn); | |
btn.addEventListener("click", () => { | |
document.body.style.fontFamily = ffmly; | |
}); | |
}; | |
mkbtn("English", "Whitney"); | |
mkbtn("toki-pona", "Linja Pona"); | |
mkbtn("toki pona", "sitelen-pona"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment