Last active
February 6, 2022 06:57
-
-
Save ConorOBrien-Foxx/38f2df1c9cbe16491b17 to your computer and use it in GitHub Desktop.
A userscript to redesign the PPCG website
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
// ==UserScript== | |
// @name favicon | |
// @namespace Cᴏɴᴏʀ O'Bʀɪᴇɴ | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function qS(x){ | |
return document.querySelector(x); | |
} | |
window.addEventListener("load",function(){ | |
var FAVICON = "http://i.stack.imgur.com/jOhpI.png"; | |
var SPRITE_SHEET = "http://i.stack.imgur.com/pHpiY.png"; | |
if((window.location+"").search("http://codegolf.stackexchange.com")>=0){ | |
qS("link[rel$=\"icon\"]").href = FAVICON; | |
var x = qS(".beta-title").parentElement; | |
qS(".beta-title").parentElement.removeChild(qS(".beta-title")); | |
x.innerHTML = "<table id=\"newlogo\"><tr><td><img src=\""+FAVICON+"\" height=50></td><td>Programming Puzzles & Code Golf</td></tr></table>"; | |
document.head.innerHTML += "<style>@import url(https://fonts.googleapis.com/css?family=Exo+2|Source+Sans+Pro);"+ | |
".container{box-shadow:none;}.envelope-on,.envelope-off,.vote-up-off,.vote-up-on,.vote-down-off,.vote-down-on,.star-on,.star-off,.comment-up-off,.comment-up-on,.comment-flag,.edited-yes,.feed-icon,.vote-accepted-off,.vote-accepted-on,.vote-accepted-bounty,.badge-earned-check,.delete-tag,.grippie,.expander-arrow-hide,.expander-arrow-show,.expander-arrow-small-hide,.expander-arrow-small-show,.anonymous-gravatar,.badge1,.badge2,.badge3,.gp-share,.fb-share,.twitter-share,#notify-containerspan.notify-close,.migrated.to,.migrated.from{background-image:url(\""+SPRITE_SHEET+"\");background-size: initial;}.youarehere{color:rgb(72,125,75) !important;border-bottom:2px solid rgb(72,125,75) !important;}/*.bounty-indicator-tab{background:rgb(172,225,175);color:rgb(72,125,75) !important;}*/#sidebar .module.community-bulletin{background:rgb(172,225,175);background:rgba(172,225,175,0.45);}html,body{font-family:\"Source Sans Pro\"}#header{background:#EDEDED;}#header *{color:#4C4C4C;}#content,.container{background:#FAFAFA}#newlogo{font-family:\"Exo 2\";top:-15px;position:relative;}#newlogo td{padding-right:15px;}#hlogo a{width:600px;}</style>"; | |
} | |
if((window.location+"").search("http://meta.codegolf.stackexchange.com")>=0){ | |
document.querySelector("link[rel$=\"icon\"").href = FAVICON; | |
} | |
if(document.getElementById("siterooms")!=null&&document.getElementById("siterooms").getAttribute("title")=="all Programming Puzzles & Code Golf rooms"){ | |
document.querySelector("link[rel$=\"icon\"").href = FAVICON; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment