// ==UserScript== // @name tumblr optica restyle // @namespace https://greasyfork.org/en/users/36620 // @version 0.4 // @description for tumblrs with the optica theme, move header to side and automatically display post notes // @author scriptfairy // @include http*://*.tumblr.com/* // @exclude http*://www.tumblr.com/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js // @downloadURL https://update.greasyfork.icu/scripts/19131/tumblr%20optica%20restyle.user.js // @updateURL https://update.greasyfork.icu/scripts/19131/tumblr%20optica%20restyle.meta.js // ==/UserScript== (function($) { if ($('a[href$="optica"]').length > 0) { var themeBackground = $('body').css('background-color'), r, g, b, searchColor; themeBackground = themeBackground.slice(themeBackground.indexOf('(')+1,themeBackground.indexOf(')')).split(','); if ((themeBackground[0] < 128 && themeBackground[1] < 128) || (themeBackground[0] < 128 && themeBackground[2] < 128) || (themeBackground[1] < 128 && themeBackground[2] < 128)) { r = b = g = 255; } else {r = g = b = 0;} searchColor = 'rgb('+r+','+g+','+b+')'; $('