Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,8 @@
"type": ["Website"]
},
{
"title": "Show if Following on Profile",
"description": "If a user is following you, it will show next to their username when you visit their profile.",
"credits": ["Bob the Potato with Drip", "TimMcCool"],
"urls": [
"https://scratch.mit.edu/users/JefferyTheSuperKat/",
"https://scratch.mit.edu/users/TimMcCool/"
],
"file": "follows-you",
"type": ["Website"],
"tags": ["Featured"],
"dynamic": true
"version": 2,
"id": "follows-you"
},
{
"title": "Custom Studio Section",
Expand Down
12 changes: 12 additions & 0 deletions features/follows-you/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "Show if Following on Profile",
"description": "If a user is following you, it will show next to their username when you visit their profile.",
"credits": [
{ "username": "Bob the Potato with Drip", "url": "https://scratch.mit.edu/users/JefferyTheSuperKat/" },
{ "username": "TimMcCool", "url": "https://scratch.mit.edu/users/TimMcCool/" }
],
"type": ["Website"],
"tags": ["Featured"],
"styles": [{ "file": "style.css", "runOn": "/users/*" }],
"scripts": [{ "file": "script.js", "runOn": "/users/*" }]
}
14 changes: 8 additions & 6 deletions features/follows-you.js → features/follows-you/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ async function getFollowing(user1, user2) {
document.createElement("span"),
document.querySelector(".profile-details")
);
if (typeof scratchAddons !== 'undefined') {
for(var i = 0; i < scratchAddons.eventTargets.self.length; i++) {
if(scratchAddons.eventTargets.self[i].id == "better-featured-project"){
span.style.color = "white";
}
}}
span.className = "scratchtoolsFollowsYou";
span.textContent = "Follows You";
span.style.opacity = ".5";
span.style.fontSize = ".8rem";
element.querySelector("h2").style.display = "inline-block";
}
}
});
}
});
Expand All @@ -45,9 +48,8 @@ if (
.split("/")[0]
);
}

ScratchTools.setDisable("follows-you", function () {
if (document.querySelector(".scratchtoolsFollowsYou")) {
document.querySelector(".scratchtoolsFollowsYou").remove();
}
});
});
8 changes: 8 additions & 0 deletions features/follows-you/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.scratchtoolsFollowsYou {
opacity: .6;
text-shadow: rgba(0, 0, 0, 0.5) 0 0 10px;
font-size: .9rem;
}
.header-text > h2 {
display: inline-block;
}