Created
March 5, 2021 12:29
-
-
Save mimonelu/0303cb5d035e8cecaa0ce9168df511fd to your computer and use it in GitHub Desktop.
Font Changer Bookmarklet
This file contains hidden or 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
| javascript: (() => { const fonts = [ '-', 'serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-serif', 'ui-sans-serif', 'ui-monospace', 'ui-rounded', '-', 'Arial', 'Arial Black', 'Bookman', 'Comic Sans MS', 'Courier', 'Courier New', 'Garamond', 'Georgia', 'Impact', 'Palatino', 'Tahoma', 'Times', 'Times New Roman', 'Trebuchet MS', 'Verdana' ]; const select = document.createElement('select'); select.style.cssText = 'position: fixed; top: 1rem; right: 1rem; z-index: 65535;'; fonts.forEach((font) => { const option = document.createElement('option'); option.innerText = font; select.appendChild(option); }); select.onchange = () => { let font = fonts[select.selectedIndex]; if (font === '-') font = ''; document.body.style.fontFamily = font; }; document.body.appendChild(select); select.focus(); })(); void 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment