Last active
June 16, 2022 06:08
-
-
Save Ivajkin/b1a1da24dfbe4f5132e1bdc1fde09fb1 to your computer and use it in GitHub Desktop.
Can be used with Run Javascript – Chrome Extension. Hides and make opaque low rating sites on Google according to SiteJabber rating.
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
| setTimeout(() => { | |
| var ratings = document.querySelectorAll(".sj_info"); var blocks = document.querySelectorAll("[sj_processed='true']"); | |
| for (let index = 0; index < ratings.length; index++) { | |
| var rating = ratings[index]; | |
| var block = blocks[index]; | |
| var number = Number(rating.textContent.split(" ")[0]); | |
| var opacity = Math.max(Math.min((Math.pow(number,1.2)-0.05)/5 + 0.05, 1), 0); | |
| rating.style.opacity = block.style.opacity = opacity; | |
| if(opacity < 0.1) { | |
| rating.style.display = block.style.display = 'none'; | |
| } | |
| console.log({number}); | |
| console.log({opacity}); | |
| } | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment