Skip to content

Instantly share code, notes, and snippets.

@omkelderman
Last active December 10, 2016 20:39
Show Gist options
  • Save omkelderman/a6bdd5f87b75bee7080505dcf2605a2d to your computer and use it in GitHub Desktop.
Save omkelderman/a6bdd5f87b75bee7080505dcf2605a2d to your computer and use it in GitHub Desktop.
// ==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