Skip to content

Instantly share code, notes, and snippets.

@doyousketch2
Last active November 10, 2016 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doyousketch2/6b822259c9523a02c053510e0d610286 to your computer and use it in GitHub Desktop.
Save doyousketch2/6b822259c9523a02c053510e0d610286 to your computer and use it in GitHub Desktop.
Dims the background of your Twitter feed.

HitCount GitIO License ForTwitter

Firefox users need GreaseMonkey
Chrome users need TamperMonkey


Once you have one of those, Scroll DOWN...

Image

Scroll down a little bit more... then press the 'Raw' button
at the right-side of the Dim.Twit.user.js script.

    (normally clicking Raw would show you the raw text,  
    but GreaseMonkey and TamperMonkey recognize the text as a script,  
    so they ask if you want to install it.)  
// ==UserScript==
// @name Dim.Twit
// @namespace Sketch2
// @description Dims your Twitter feed.
// @include https://twitter.*
// @version 1.5
// @grant GM_info
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @updateURL https://git.io/vX2DV
// @require https://git.io/vXaG2
// @require https://code.jquery.com/jquery-3.1.1.slim.min.js
// @license GNU GPLv3 - https://www.gnu.org/licenses/gpl-3.0.html
// ==/UserScript==
//=================================================================
// set your color variables to whatever you like.
// standard websafe color codes
// #RRGGBB or #RGB
var Background, BG = '#224'
var Twits = '#88a'
var Text1 = '#fff'
var Text2 = '#999'
// #000000 or #000 = black
// #FF0000 or #F00 = red
// #00FF00 or #0F0 = green
// #0000FF or #00F = blue
// #FFFFFF or #FFF = white
// <--- dimmer brighter --->
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
// '0' is off full on is 'f'
//=================================================================
// Don't edit below this line, unless you know jQuery / Javascript
//dim outer background
$('body') .css('background', BG);
//dim background on your own userpage
$('div#page-container') .css('background', BG);
//wait a moment for page to load
window .addEventListener('load', function() {
//brighten background of messages again
$('div.TwitterCard') .css('background', Twits);
// they normally have a transparent background,
// and dark text doesn't show up on a dark backdrop.
}, false);
//brighten text in the sidebar
waitForKeyElements (".ProfileHeaderCard-name", sidebar);
function sidebar (jNode) {
jNode .css('color', Text1);
$('.ProfileSidebar') .css('color', Text1);
$('.ProfileHeaderCard-locationText') .css('color', Text2);
$('.ProfileHeaderCard-joinDateText') .css('color', Text2);
};
//full names take longer to show up on certain pages,
//so we must wait longer for them to appear
waitForKeyElements ("b.fullname", brightText);
function brightText (jNode) {
jNode .css('color', Text2);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment