Last active
November 16, 2023 11:25
-
-
Save crashmax-dev/5f74b00597d4ebe2cff5a89094a4c37e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name LastSticker | |
// @version 0.1 | |
// @author crashmax | |
// @match https://www.laststicker.ru/cards/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=laststicker.ru | |
// @grant none | |
// ==/UserScript== | |
const missingCardsList = [] | |
const cardsInfoContainer = document.querySelector('.cards_info') | |
const cardsList = Array.from( | |
document.querySelectorAll('tbody > tr.even, tr.odd') | |
) | |
for (const card of cardsList) { | |
const trCount = card.children[7] | |
if (trCount.classList.contains('i_hold')) { | |
continue | |
} | |
missingCardsList.push(card.firstChild.textContent) | |
} | |
if (!missingCardsList.length) return | |
const textareaCardList = document.createElement('textarea') | |
textareaCardList.value = `${missingCardsList.join(', ')}\n${missingCardsList.length} карт` | |
Object.assign(textareaCardList.style, { | |
width: '100%', | |
height: '100px', | |
padding: '5px', | |
marginBottom: '1rem', | |
fontSize: '1.2em', | |
fontWeight: 'normal' | |
}) | |
cardsInfoContainer.prepend(textareaCardList) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment