Created
May 5, 2019 07:12
-
-
Save harsh183/1a0b92dd5c82a893e102baf2ecf97c85 to your computer and use it in GitHub Desktop.
Opinated userscript that makes Paul Graham's website slightly nicer to me to read since I go there a lot.
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
// ==UserScript== | |
// @name Paul Graham website beautifier | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// Based off http://bettermotherfuckingwebsite.com/ | |
var styles = ` | |
body { | |
margin: 40px auto; | |
max-width: 800px; | |
line-height: 1.4; | |
color: #444; | |
padding:0 10px | |
background: #EEEEEE | |
} | |
h1,h2,h3 { | |
line-height:1.2 | |
} | |
` | |
var styleSheet = document.createElement("style"); | |
styleSheet.type = "text/css"; | |
styleSheet.innerText = styles; | |
document.head.appendChild(styleSheet); | |
// Font size has some sort of font tag at 2, increase it | |
fontTags = document.getElementsByTagName("font"); | |
for (var i = 0; i < fontTags.length; i += 1) { | |
fontTags[i].setAttribute("size", 4); | |
} | |
document.body.appendChild("<h1>Paul Graham</h1>"); | |
// TODO: Get table width to 800 | |
// TODO: Figure out centering |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MIT License