├── README.md ├── background.js ├── img ├── artsy_zach.jpg ├── castro_hacking.jpg ├── orbit_profile.jpg ├── talk.jpg ├── thiel_profile.jpg └── zach_and_jonathan.jpg ├── manifest.json ├── zrl.png ├── zrl_128.png ├── zrl_16.png ├── zrl_48.png ├── zrlify.js ├── zrlify_demo.gif ├── zrlify_demo.png └── zrlify_tile.png /README.md: -------------------------------------------------------------------------------- 1 | # zrlify 2 | Zach Latta-ify your web browsing experience! 3 | 4 | ![](zrlify_demo.gif) 5 | 6 | ## Install 7 | [You can install it as a chrome extension](https://chrome.google.com/webstore/detail/zrlify/mpokfjeacmbjhldahgmoanmhddidgfio) 8 | 9 | ## What it does 10 | zrlify replaces your current webpages styling with something akin to those shown on [Zach Latta's website](http://zachlatta.com). 11 | 12 | ## Contributions 13 | As always, contributions are welcome and greatly appreciated! 14 | -------------------------------------------------------------------------------- /background.js: -------------------------------------------------------------------------------- 1 | // Run zrlify when the popup icon is pressed. 2 | chrome.browserAction.onClicked.addListener(function(tab) { 3 | chrome.tabs.getSelected(null, function(tab){ 4 | chrome.tabs.executeScript(tab.id, {code: 'window.ZRLIFY();'}, 5 | function(response) { 6 | console.log(response); 7 | }) 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /img/artsy_zach.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/artsy_zach.jpg -------------------------------------------------------------------------------- /img/castro_hacking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/castro_hacking.jpg -------------------------------------------------------------------------------- /img/orbit_profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/orbit_profile.jpg -------------------------------------------------------------------------------- /img/talk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/talk.jpg -------------------------------------------------------------------------------- /img/thiel_profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/thiel_profile.jpg -------------------------------------------------------------------------------- /img/zach_and_jonathan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/img/zach_and_jonathan.jpg -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | 4 | "name": "zrlify", 5 | "description": "zrlify ALL the websites", 6 | "version": "1.2", 7 | 8 | "browser_action": { 9 | "default_icon": "zrl.png", 10 | "default_title": "zrlify" 11 | }, 12 | 13 | "icons": { 14 | "16": "zrl_16.png", 15 | "48": "zrl_48.png", 16 | "128": "zrl_128.png" 17 | }, 18 | 19 | "background": { 20 | "scripts": ["background.js"], 21 | "persistent": false 22 | }, 23 | 24 | "content_scripts": [ 25 | { 26 | "matches": [""], 27 | "js": ["zrlify.js"], 28 | "run_at": "document_start" 29 | } 30 | ], 31 | 32 | "permissions": [ 33 | "tabs", 34 | "http://*/", 35 | "https://*/" 36 | ], 37 | "web_accessible_resources": [ 38 | "img/*.jpg" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /zrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrl.png -------------------------------------------------------------------------------- /zrl_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrl_128.png -------------------------------------------------------------------------------- /zrl_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrl_16.png -------------------------------------------------------------------------------- /zrl_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrl_48.png -------------------------------------------------------------------------------- /zrlify.js: -------------------------------------------------------------------------------- 1 | console.log("zrlifying"); 2 | 3 | var zrls = [ 4 | "artsy_zach.jpg", 5 | "orbit_profile.jpg", 6 | "thiel_profile.jpg", 7 | "castro_hacking.jpg", 8 | "talk.jpg", 9 | "zach_and_jonathan.jpg" 10 | ]; 11 | 12 | function randInt(min, max) { 13 | return Math.floor((Math.random() * max) + min); 14 | } 15 | 16 | // addZrlify creates a MutationObserver to watch the DOM and update elements which do not conform to style 17 | function addZrlify() { 18 | var observer = new window.WebKitMutationObserver(function(mutations, observer) { 19 | zrlify(); 20 | }); 21 | 22 | observer.observe(document, { 23 | subtree: true, 24 | childList: true, 25 | characterData: true 26 | }); 27 | } 28 | 29 | var ascii = /^[ -~]*$/; 30 | 31 | function zrlify() { 32 | var els = document.getElementsByTagName('*'); 33 | for (var i = 0; i < els.length; i++) { 34 | var el = els[i]; 35 | if (el.nodeType != Node.ELEMENT_NODE) { 36 | continue; 37 | } 38 | 39 | el.style.fontFamily = "Times, \"Times New Roman\", serif"; 40 | 41 | // If the element is a octicon or equivalent, do not apply a font. 42 | var content = window.getComputedStyle(el, ':before'); 43 | var text = content.getPropertyValue('content'); 44 | if (!ascii.test(text)) { 45 | el.style.fontFamily = ""; 46 | } 47 | 48 | // Make links look normal-ish 49 | if (el.tagName == "A") { 50 | el.style.color = "blue"; 51 | } else { 52 | el.style.color = "black"; 53 | } 54 | 55 | if (el.tagName = "IMG") { 56 | var image = el; 57 | var w = image.width; 58 | var h = image.height; 59 | 60 | image.src = chrome.extension.getURL("img/" + zrls[randInt(0, zrls.length)]); 61 | 62 | // Make sure that the image does not look too out of place by scaling it. 63 | image.width = w; 64 | image.height = h; 65 | image.style.width = w + "px"; 66 | image.style.height = h + "px"; 67 | } 68 | 69 | // Various style resets. 70 | el.style.background = "none"; 71 | el.style.backgroundColor = "white"; 72 | el.style.borderColor = "black"; 73 | el.style.borderRadius = "0px"; 74 | el.style.borderImage = "0px"; 75 | } 76 | } 77 | 78 | // Whether zrlify has been executed or not 79 | window.ZRLIFY_SET = false; 80 | 81 | // The entry point for zrlify 82 | window.ZRLIFY = function() { 83 | if (!window.ZRLIFY_SET) { 84 | zrlify(); 85 | addZrlify(); 86 | 87 | var wq = document.createElement("p"); 88 | wq.textContent = ":wq"; 89 | document.body.appendChild(wq); 90 | } 91 | 92 | window.ZRLIFY_SET = true; 93 | } 94 | -------------------------------------------------------------------------------- /zrlify_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrlify_demo.gif -------------------------------------------------------------------------------- /zrlify_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrlify_demo.png -------------------------------------------------------------------------------- /zrlify_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paked/zrlify/2aa1aac90604700959ea84cbed3d0bd60f5d25cf/zrlify_tile.png --------------------------------------------------------------------------------