Skip to content

Instantly share code, notes, and snippets.

@imsamuka
imsamuka / SteamBadgesPage.js
Created January 25, 2021 17:06
Gives list of badges sorted by how many cards are missing in the deck
function getDiference(node){
return parseInt(node.innerText.split(" ")[2]) - parseInt(node.innerText.split(" ")[0])
}
Array.from(document.getElementsByClassName("badge_progress_info"))
.sort( (a, b) => getDiference(a) - getDiference(b) )
.map( a => ( getDiference(a) ) + " | " + a.parentElement.parentElement.getElementsByClassName("badge_title")[0].innerText.trim() )
@imsamuka
imsamuka / notification_spawner.js
Last active September 29, 2023 18:19
Spawn a updatable notification that includes a optional progress bar, styled with Bulma
function spawnNotif(box, category, message, progressMax = 0) {
const categories = {
"error": "is-danger",
"info": "is-info",
"success": "is-success",
"warning": "is-warning",
"warn": "is-warning",
"primary": "is-primary",
}