The Sexy Button

Allow The Button to change colour

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         The Sexy Button
// @namespace    http://www.reddit.com/r/thebutton
// @version      0.1
// @description  Allow The Button to change colour
// @author       Ray57
// @match        http://www.reddit.com/r/thebutton
// @match        http://www.reddit.com/r/thebutton/
// @grant        none
// ==/UserScript==

(function(){var colorblind = document.createElement('span');
colorblind.className = 'thebutton-colorblind';
$('.thebutton-counter').prepend(colorblind);
colorTimer = window.setInterval(function(){ 
var s = r.thebutton._msgSecondsLeft, ring = $('#thebutton'), color = '';
ring.css('-webkit-transition', 'background-color 0.4s')
    .css('-moz-transition', 'background-color 0.4s')
    .css('-ms-transition', 'background-color 0.4s')
    .css('-o-transition', 'background-color 0.4s')
    .css('transition', 'background-color 0.4s')
if (s < 12) { ring.css('background-color', '#e50000'); color = 'red' } else
if (s < 22) { ring.css('background-color', '#e59500'); color = 'orange' } else
if (s < 32) { ring.css('background-color', '#e5d900'); color = 'yellow' } else
if (s < 42) { ring.css('background-color', '#02be01'); color = 'green' } else
if (s < 52) { ring.css('background-color', '#0083c7'); color = 'blue' } else
{ ring.css('background-color', '#820080'); color = 'purple' }
$('.thebutton-colorblind').text(color + ' - ')}, 10);})();