-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Round Profile Pictures" update to feature version 2 #494
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"title": "Round Profile Pictures", | ||
"description": "All profile pictures on the Scratch website will be rounded.", | ||
"credits": [ | ||
{ "username": "Scratchfangs", "url": "https://scratch.mit.edu/users/scratchfangs/" }, | ||
{ "username": "rgantzos", "url": "https://scratch.mit.edu/users/rgantzos/" } | ||
], | ||
"type": ["Website", "Theme"], | ||
"tags": [], | ||
"scripts": [{ "file": "script.js", "runOn": "/*" }], | ||
"options": [ | ||
{ "id": "Rounding Percentage", "name": "Rounding Percentage", "default": "50%" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're going to add things like this, then we should also add an option validation system. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll make an issue for this and it should be added in the next few days. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Wilamaxin It's been merged, something like |
||
] | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this would work better as CSS. Options create CSS variables, so something such as |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var roundness = ScratchTools.Storage["Rounding Percentage"]; | ||
if (!roundness.includes("%")){roundness = roundness.concat("%");} | ||
function roundProfile() { | ||
document.querySelectorAll("img").forEach(function (el) { | ||
if (el.src !== undefined) { | ||
if (el.src.includes("scratch.mit.edu/get_image/user/")) { | ||
el.style.borderRadius = roundness; | ||
} | ||
} | ||
document.querySelectorAll(".mod-social-message").forEach(function (mod) { | ||
mod.style.paddingLeft = ".825rem"; | ||
el.style.paddingRight = "0rem"; | ||
}); | ||
}); | ||
window.setTimeout(roundProfile, 80); | ||
} | ||
roundProfile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature was previously bugged and has a few super cool new changes with this update, so let's move this to the top of the list as well.