NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Filter light // @namespace http://openuserjs.org/users/dddfffggg // @version 0.96 // @description Filter light // @author dddfffggg // @match https://*.destinyitemmanager.com/* // @run-at document-end // @license MIT // ==/UserScript== function makeButton(name, n, onclick) { const b = document.createElement('button'); b.style.position = 'fixed'; b.style.zIndex = 900; b.style.left = (400 + (n * 50)) + 'px'; b.style.top = 0; b.style.textAlign = 'center'; b.style.width = '50px'; b.textContent = name; b.onclick = onclick; document.body.appendChild(b); return b; } const above300 = makeButton('320]', 0, function (e) { const items = Array.from(document.querySelectorAll('.item .item-equipment')); items.filter(x => parseInt(x.textContent) < 320).forEach(x => x.parentElement.classList.add('hide-more')); }); const under300 = makeButton(']320', 1, function (e) { const items = Array.from(document.querySelectorAll('.item .item-equipment')); items.filter(x => parseInt(x.textContent) >= 320).forEach(x => x.parentElement.classList.add('hide-more')); }); const above40 = makeButton('4.0]', 2, function (e) { const items = Array.from(document.querySelectorAll('.item .item-review')); items.filter(x => parseFloat(x.textContent) < 4.0).forEach(x => x.parentElement.classList.add('hide-more')); }); const under40 = makeButton(']4.0', 3, function (e) { const items = Array.from(document.querySelectorAll('.item .item-review')); items.filter(x => parseFloat(x.textContent) >= 4.0).forEach(x => x.parentElement.classList.add('hide-more')); }); const clear = makeButton('clear', 4, function (e) { const items = Array.from(document.querySelectorAll('.item')); items.forEach(x => x.classList.remove('hide-more')); }); const styleNode = document.createElement('style'); styleNode.textContent = ` .hide-more {opacity: 0.1;} .section.postmaster{ display: block; position: fixed; right: 0; width: 500px; top: 125px; background: #434444; border: 2px solid rebeccapurple; }`; document.head.appendChild(styleNode);