Browse Source

Initial commit

main
Holly McFarland 9 months ago
commit
220236a0d1
3 changed files with 43 additions and 0 deletions
  1. +5
    -0
      README.md
  2. +38
    -0
      easier-blaseball-betting.user.js
  3. BIN
      screenshot.png

+ 5
- 0
README.md View File

@ -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.

+ 38
- 0
easier-blaseball-betting.user.js View File

@ -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);
})();

BIN
screenshot.png View File

Before After
Width: 1920  |  Height: 1080  |  Size: 137 KiB

Loading…
Cancel
Save