Last active
December 10, 2016 20:39
-
-
Save omkelderman/a6bdd5f87b75bee7080505dcf2605a2d to your computer and use it in GitHub Desktop.
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 osu! Profile GameMode Background Changer | |
// @namespace https://github.com/omkelderman/ | |
// @version 1.0 | |
// @description Change user-profile background according to game-mode | |
// @author Olle Kelderman | |
// @match https://osu.ppy.sh/u/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// std is the only one with a color atm | |
var colors = ['', '#ffffcc', '#ccffcc', '#ccffff']; | |
function updateGameModeBg() { | |
console.log("GAAAAME MOOOOOODE: " + activeGameMode); | |
var color = colors[activeGameMode] || ''; | |
$('.bodytopbg').css('background', color); | |
// remove pippi if there is a custom color | |
$('#coolheader').toggle(color === ''); | |
} | |
// catch game-mode changes | |
$('.profileGameModeButton').click(updateGameModeBg); | |
// apply on page-load | |
updateGameModeBg(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment