From f86e8ea1e7bc4d3f3804b6a4a0202f6badc996cd Mon Sep 17 00:00:00 2001 From: Wilamaxin <63302372+Wilamaxin@users.noreply.github.com> Date: Sun, 28 May 2023 01:38:00 +0200 Subject: [PATCH 1/3] "Round Profile Pictures" update to feature version 2 --- features/features.json | 45 +++++------------------ features/round-profile-pictures/data.json | 14 +++++++ features/round-profile-pictures/script.js | 17 +++++++++ 3 files changed, 40 insertions(+), 36 deletions(-) create mode 100644 features/round-profile-pictures/data.json create mode 100644 features/round-profile-pictures/script.js diff --git a/features/features.json b/features/features.json index f3b5ed09..9124eb5c 100644 --- a/features/features.json +++ b/features/features.json @@ -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", @@ -203,15 +194,9 @@ { "id": "Studio ID", "name": "Studio ID", "default": "27205657" } ] }, - { - "title": "Highlight Unanswered Forum Topics", - "description": "Adds a blue highlight to topics in the forums that have no replies.", - "credits": ["rgantzos"], - "urls": ["https://scratch.mit.edu/users/rgantzos/"], - "file": "highlight-unanswered", - "type": ["Website"], - "tags": ["New", "Recommended"], - "dynamic": true + { + "version": 2, + "id": "highlight-unanswered" }, { "title": "Hide Project Tags", @@ -764,13 +749,8 @@ "type": ["Website"] }, { - "title": "Go to Parent Button", - "description": "In the editor for any project that is a remix, you can click a button to go to the editor in the parent project.", - "credits": ["rgantzos"], - "urls": ["https://scratch.mit.edu/users/rgantzos/"], - "file": "go-to-parent", - "tags": [], - "type": ["Editor"] + "version": 2, + "id": "go-to-parent" }, { "title": "Most Popular Project", @@ -1013,15 +993,8 @@ "type": ["Editor"] }, { - "title": "Round Profile Pictures", - "description": "All profile pictures on the Scratch website will be rounded.", - "credits": ["Scratchfangs", "rgantzos"], - "urls": [ - "https://scratch.mit.edu/users/scratchfangs/", - "https://scratch.mit.edu/users/rgantzos/" - ], - "file": "round-profile-pictures", - "type": ["Website", "Theme"] + "version": 2, + "id": "round-profile-pictures" }, { "title": "Sidebar", diff --git a/features/round-profile-pictures/data.json b/features/round-profile-pictures/data.json new file mode 100644 index 00000000..cb8d77d6 --- /dev/null +++ b/features/round-profile-pictures/data.json @@ -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%" } + ] +} \ No newline at end of file diff --git a/features/round-profile-pictures/script.js b/features/round-profile-pictures/script.js new file mode 100644 index 00000000..2c709580 --- /dev/null +++ b/features/round-profile-pictures/script.js @@ -0,0 +1,17 @@ +var roundness = ScratchTools.Storage["Round 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(); \ No newline at end of file From c67a649578d1b3d05ba5dd29a4c64202b30673c7 Mon Sep 17 00:00:00 2001 From: Wilamaxin <63302372+Wilamaxin@users.noreply.github.com> Date: Sun, 28 May 2023 01:44:07 +0200 Subject: [PATCH 2/3] Mistake fix --- features/round-profile-pictures/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/round-profile-pictures/script.js b/features/round-profile-pictures/script.js index 2c709580..ef5b09bb 100644 --- a/features/round-profile-pictures/script.js +++ b/features/round-profile-pictures/script.js @@ -1,4 +1,4 @@ -var roundness = ScratchTools.Storage["Round Percentage"]; +var roundness = ScratchTools.Storage["Rounding Percentage"]; if (!roundness.includes("%")){roundness = roundness.concat("%");} function roundProfile() { document.querySelectorAll("img").forEach(function (el) { From 1809b726c843753f02cfdebb1861d6d7d88a5866 Mon Sep 17 00:00:00 2001 From: rgantzos Date: Wed, 31 May 2023 10:35:27 -0700 Subject: [PATCH 3/3] Update features.json --- features/features.json | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/features/features.json b/features/features.json index 9124eb5c..c2990930 100644 --- a/features/features.json +++ b/features/features.json @@ -179,8 +179,17 @@ "type": ["Website"] }, { - "version": 2, - "id": "follows-you" + "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 }, { "title": "Custom Studio Section", @@ -194,9 +203,15 @@ { "id": "Studio ID", "name": "Studio ID", "default": "27205657" } ] }, - { - "version": 2, - "id": "highlight-unanswered" + { + "title": "Highlight Unanswered Forum Topics", + "description": "Adds a blue highlight to topics in the forums that have no replies.", + "credits": ["rgantzos"], + "urls": ["https://scratch.mit.edu/users/rgantzos/"], + "file": "highlight-unanswered", + "type": ["Website"], + "tags": ["New", "Recommended"], + "dynamic": true }, { "title": "Hide Project Tags", @@ -749,8 +764,13 @@ "type": ["Website"] }, { - "version": 2, - "id": "go-to-parent" + "title": "Go to Parent Button", + "description": "In the editor for any project that is a remix, you can click a button to go to the editor in the parent project.", + "credits": ["rgantzos"], + "urls": ["https://scratch.mit.edu/users/rgantzos/"], + "file": "go-to-parent", + "tags": [], + "type": ["Editor"] }, { "title": "Most Popular Project", @@ -993,8 +1013,8 @@ "type": ["Editor"] }, { - "version": 2, - "id": "round-profile-pictures" + "id": "round-profile-pictures", + "version": 2 }, { "title": "Sidebar",