Skip to content

Commit

Permalink
git ignore for .zip and hide animated awards
Browse files Browse the repository at this point in the history
  • Loading branch information
datguyducky committed Oct 2, 2020
1 parent 9618b47 commit 5f03926
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "1.1",
"version": "1.2",

"name": "No awards for Reddit",
"description": "Hide awards on posts and comments for redesigned and also old Reddit.",
Expand Down
27 changes: 27 additions & 0 deletions no-awards.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const config = {
// Callback function to execute when mutations are observed
const callback = (mutationsList, observer) => {
// hide awards on posts and comments
// used only in new Reddit
const NEW_AWARDS_BAR = document.getElementsByClassName(
"_1wgnb6w6OJogtEV2N4B3lD"
);
Expand All @@ -24,6 +25,7 @@ const callback = (mutationsList, observer) => {
}

// hide awards on cross-posted posts
// used only in new Reddit
const CROSS_POST_NEW_AWARDS_BAR = document.getElementsByClassName(
"_3XoW0oYd5806XiOr24gGdb"
);
Expand All @@ -36,6 +38,31 @@ const callback = (mutationsList, observer) => {
for (let i = 0; i < OLD_AWARDS_BAR.length; i++) {
OLD_AWARDS_BAR[i].style.display = "none";
}

// hide animated awards (both icon and the box-shadow arround the comment)
// used only in new Reddit
const ANIMATED_BOX = document.getElementsByClassName(
"_3VH2iGVh92XtlKq0-eVoEN"
);
for (let i = 0; i < ANIMATED_BOX.length; i++) {
ANIMATED_BOX[i].style.display = "none";
}

const ANIMATED_ICON = document.getElementsByClassName(
"_28x1bnTjOY6zWZfooCxkKQ"
);
for (let i = 0; i < ANIMATED_ICON.length; i++) {
ANIMATED_ICON[i].style.display = "none";
}

// hide background-gradient for comments with a lot of awards(?)
// used only in new Reddit
const BOX_WITH_GRADIENT = document.getElementsByClassName(
"TmlaIdEplCzZ0F1aRGYQh"
);
for (let i = 0; i < BOX_WITH_GRADIENT.length; i++) {
BOX_WITH_GRADIENT[i].style.background = "inherit";
}
};

const observer = new MutationObserver(callback);
Expand Down

0 comments on commit 5f03926

Please sign in to comment.