commit
220236a0d1
@ -0,0 +1,5 @@
|
||||
# easier blaseball betting
|
||||
|
||||
This is a truly horrible hack but it does put all the favoured teams on the left of their matches on the betting screen.
|
||||
|
||||
Calls a function every time anything in the DOM updates. Don't write js like this, kids.
|
@ -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);
|
||||
})();
|
After Width: | Height: | Size: 137 KiB |
Loading…
Reference in new issue