Last active
December 4, 2022 18:03
-
-
Save D1360-64RC14/9182976e16d433db6ba9b2368ecd6c74 to your computer and use it in GitHub Desktop.
An URL Text Viewer to be saved in the Bookmarks (literally). Copy the minified code, paste in the URL, and you'll have a simple text viewer for your drafts. You can also bookmark the URL to place it on the Bookmarks bar. Supports Ctrl + Scroll to change font size.
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
data:text/html,<textarea spellcheck="false"></textarea><style>body{display:flex;margin:0;height:100vh;overflow:hidden;background:rgb(33,37,41)}textarea{all:unset;flex:1;margin:8;padding:4;background:rgb(52,58,64);color:white;font-family:'Victor Mono','Fira Code','Ubuntu Mono',monospace;font-weight:500;font-variant-ligatures:normal;word-break:break-word;border-radius:8px}textarea::-webkit-scrollbar{width:12}textarea::-webkit-scrollbar-track{background:rgb(52,58,64)}textarea::-webkit-scrollbar-thumb{background:rgb(73,80,87);border:3 solid rgb(52 58 64);border-radius:50px}</style><script>t=document.querySelector('textarea');fs=50;ufs=_=>{t.style.fontSize=fs};ufs();document.body.addEventListener('wheel',e=>{if(!e.ctrlKey)return;fs+=Math.sign(e.deltaY)*-5;ufs();e.preventDefault()},{passive:false})</script> |
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
data:text/html, | |
<body> | |
<textarea spellcheck="false"></textarea> | |
</body> | |
<style> | |
body { | |
display: flex; | |
margin: 0; | |
height: 100vh; | |
overflow: hidden; | |
background: rgb(33, 37, 41); | |
} | |
textarea { | |
all: unset; | |
flex: 1; | |
margin: 8px; | |
padding: 4px; | |
background: rgb(52, 58, 64); | |
color: white; | |
font-family: 'Victor Mono', 'Fira Code', 'Ubuntu Mono', monospace; | |
font-weight: 500; | |
font-variant-ligatures: normal; | |
word-break: break-word; | |
border-radius: 8px; | |
} | |
textarea::-webkit-scrollbar { | |
width: 12px; | |
} | |
textarea::-webkit-scrollbar-track { | |
background: rgb(52, 58, 64); | |
} | |
textarea::-webkit-scrollbar-thumb { | |
background: rgb(73, 80, 87); | |
border: 3px solid rgb(52, 58, 64); | |
border-radius: 50px; | |
} | |
</style> | |
<script> | |
const textarea = document.querySelector('textarea'); | |
let fontSize = 50; | |
function updateFontSize() { | |
textarea.style.fontSize = fontSize; | |
} | |
updateFontSize(); | |
document.body.addEventListener('wheel', function(event) { | |
const { ctrlKey, deltaY } = event; | |
if (!ctrlKey) return; | |
fontSize += Math.sign(deltaY) * -5; | |
updateFontSize(); | |
event.preventDefault(); | |
}, { passive: false }); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment