|
|
@ -0,0 +1,38 @@ |
|
|
|
// ==UserScript==
|
|
|
|
// @name Easier Blaseball Betting
|
|
|
|
// @namespace https://glaceon.social/@monorail
|
|
|
|
// @version 0.1
|
|
|
|
// @description Put every favoured team on the left of its matchup
|
|
|
|
// @author monorail
|
|
|
|
// @match https://blaseball.com/*
|
|
|
|
// @match https://www.blaseball.com/*
|
|
|
|
// @grant none
|
|
|
|
// @updateURL https://hollymcfarland.com/easier-blaseball-betting.user.js
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
(function() { |
|
|
|
function reorderMatchupIfNeeded(matchup) { |
|
|
|
let away = matchup.children[0]; |
|
|
|
let home = matchup.children[1]; |
|
|
|
|
|
|
|
let awayOdds = Number(away.getElementsByClassName("Bet-List-MatchUps-Team-Odds")[0].innerText.slice(0, -1)); |
|
|
|
let homeOdds = Number(home.getElementsByClassName("Bet-List-MatchUps-Team-Odds")[0].innerText.slice(0, -1)); |
|
|
|
|
|
|
|
matchup.style.transform = (homeOdds > awayOdds) ? "scale(-1, 1)" : ""; |
|
|
|
} |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
let main = document.getElementsByTagName("body")[0]; |
|
|
|
|
|
|
|
const callback = function(mutationsList, observer) { |
|
|
|
for (let matchup of document.getElementsByClassName("Bet-List-MatchUps-Group")) { |
|
|
|
reorderMatchupIfNeeded(matchup); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const config = { childList: true, subtree: true, attributes: true }; |
|
|
|
const observer = new MutationObserver(callback); |
|
|
|
|
|
|
|
observer.observe(main, config); |
|
|
|
})(); |