-
Install the User JavaScript and CSS chrome extension (or something similar in your favorite browser)
-
Add the following snippets into the extension.
-
If everthing works as expected you will see an Ornn icon in the tabs:
-
-
Save xjeeh/23283efe98b222de743bed8df8035a55 to your computer and use it in GitHub Desktop.
Toggle Ornn Items visibility at lolshop.gg
This file contains 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
.toggleOrnnItems { | |
padding: 1rem .75rem; | |
} | |
.toggleOrnnItems.disabled { | |
filter: grayscale(.8); | |
} | |
.hidden { | |
display: none; | |
} |
This file contains 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
const toggleOrnnItems = (e) => { | |
const allOrnnItems = document.querySelectorAll(".Image_ornnBorder__Fu1ul"); | |
e.target.closest("button").classList.toggle("disabled"); | |
allOrnnItems.forEach(i => i.closest("[class^='Grid_grid']").classList.toggle("hidden")); | |
} | |
const reset = (e) => document.querySelector(".toggleOrnnItems").classList.remove("disabled"); | |
const searchControls = document.querySelector("[class^='Tabs_tabs'"); | |
const toggleOrnnItemsIcon = `<button class='toggleOrnnItems' onClick="toggleOrnnItems(event)"><img width='24px' src='https://raw.communitydragon.org/pbe/game/assets/characters/ornn/hud/ornn_circle.png' /></button>`; | |
setTimeout(() => { | |
[...document.querySelectorAll("[class^='Tabs_tab_']")].map(i => i.addEventListener("click", reset)) | |
searchControls.insertAdjacentHTML('beforeend', toggleOrnnItemsIcon); | |
}, 300); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment