We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i manage to sort the cards, by subscribers, with js will be nice to be able to sort things
let enum_type = { views: 1, subscribers: 2, favorites: 3, } const gridElement = document.querySelector("body > div > section > div > div.grid.grid-cols-1"); const sortTextSelector = `.card .my-2 .flex.justify-center:nth-child(1) h5:nth-child(${enum_type.subscribers})`; function reorderCards(gridElement, sortTextSelector) { // 1. Get all cards as an array const cards = Array.from(gridElement.children); // 2. Extract sort text for each card const cardsWithText = cards.map(card => { let sortTextElement = card.querySelector(sortTextSelector); sortTextElement = sortTextElement.textContent.trim().replaceAll(",","") return { card: card, text: sortTextElement ? sortTextElement : "", }; }); // 3. Sort the cards based on the extracted text (assuming numeric sort) cardsWithText.sort((a, b) => { const numberA = parseFloat(a.text); const numberB = parseFloat(b.text); return numberB - numberA; }); // 4. Update the grid element with the reordered cards gridElement.innerHTML = ""; cardsWithText.forEach(cardObj => gridElement.appendChild(cardObj.card)); } reorderCards(gridElement, sortTextSelector);
The text was updated successfully, but these errors were encountered:
It will be done some day. Is a planned feature.
Sorry, something went wrong.
No branches or pull requests
i manage to sort the cards, by subscribers, with js
will be nice to be able to sort things
The text was updated successfully, but these errors were encountered: