Skip to content
Merged
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
5 changes: 3 additions & 2 deletions api/update/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ async function checkUpdate() {
forum: "0",
},
});
checkUpdate()
// checkUpdate()
}
}
checkUpdate();
// checkUpdate();

function makeScreen(update) {
return
console.log(update);
if (document.querySelector(".ste-update-bg")) return;
let background = Object.assign(document.createElement("div"), {
Expand Down
38 changes: 34 additions & 4 deletions extras/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ async function checkBetaUpdates() {
).json();
if (
data.version !== chrome.runtime.getManifest().version_name ||
(await (await fetch("/changelog/beta.json")).json()).beta !==
data.beta
(await (await fetch("/changelog/beta.json")).json()).beta !== data.beta
) {
// chrome.tabs.create({
// url: "/extras/beta/index.html",
Expand All @@ -64,6 +63,7 @@ if (chrome.runtime.getManifest().version_name.endsWith("-beta")) {
}

chrome.runtime.onInstalled.addListener(async function (object) {
checkApril();
try {
var featureData = await (await fetch("/features/features.json")).json();
} catch (err) {
Expand Down Expand Up @@ -671,12 +671,17 @@ chrome.runtime.onMessageExternal.addListener(async function (
}
if (msg.msg === "openPong") {
await chrome.tabs.create({
url: "/api/april/pong/index.html?username=" + msg.username + "&id=" + msg.id,
url:
"/api/april/pong/index.html?username=" + msg.username + "&id=" + msg.id,
});
}
if (msg.msg === "openDashboardPage") {
await chrome.tabs.create({
url: "/extras/dashboard/index.html?code=" + msg.token + "&username=" + msg.username,
url:
"/extras/dashboard/index.html?code=" +
msg.token +
"&username=" +
msg.username,
});
chrome.tabs.remove(sender.tab.id, function () {});
}
Expand Down Expand Up @@ -821,7 +826,32 @@ chrome.runtime.onMessage.addListener(async function (
}
});

async function checkApril() {
if (new Date().getMonth() === 3 && new Date().getDate() === 1) {
let features = (await chrome.storage.sync.get("features"))?.features || "";
if (!features.includes("random-block-colors")) {
await chrome.storage.sync.set({ aprilAutomatic2025: true });
features = features + ".random-block-colors";
await chrome.storage.sync.set({ features });
}
} else {
let aprilAutomatic = (await chrome.storage.sync.get("aprilAutomatic2025"))
?.aprilAutomatic2025;

if (aprilAutomatic) {
let features =
(await chrome.storage.sync.get("features"))?.features || "";
if (features.includes("random-block-colors")) {
features = features.replaceAll("random-block-colors", "");
await chrome.storage.sync.set({ features });
await chrome.storage.sync.set({ aprilAutomatic2025: false });
}
}
}
}

chrome.alarms.onAlarm.addListener(async function () {
checkApril();
chrome.alarms.clearAll();
chrome.alarms.create("test", {
delayInMinutes: 0.5,
Expand Down
5 changes: 5 additions & 0 deletions features/features.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"version": 2,
"id": "random-block-colors",
"versionAdded": "v4.1.0"
},
{
"version": 2,
"id": "remove-confirmation",
Expand Down
3 changes: 3 additions & 0 deletions features/more-block-themes/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export default async function ({ feature, console, scratchClass }) {
let randomBlockColorsEnabled = !!ScratchTools.modules.find((el) => el.feature.id === "random-block-colors")
if (randomBlockColorsEnabled) return;

let CIRCLE = await (await fetch(feature.self.getResource("circle"))).text();

let COLORS = document.createElement("link")
Expand Down
3 changes: 3 additions & 0 deletions features/random-block-colors/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions features/random-block-colors/circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions features/random-block-colors/colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
:root {
--motion-fill: transparent;
--motion-stroke: #3373CC;

--looks-fill: transparent;
--looks-stroke: #774DCB;

--sound-fill: transparent;
--sound-stroke: #BD42BD;

--event-fill: transparent;
--event-stroke: #CC9900;

--control-fill: transparent;
--control-stroke: #CF8B17;

--sensing-fill: transparent;
--sensing-stroke: #2E8EB8;

--operators-fill: transparent;
--operators-stroke: #389438;

--data-fill: transparent;
--data-stroke: #DB6E00;
--data-lists-fill: transparent;
--data-lists-stroke: #E64D00;

--custom-fill: transparent;
--custom-stroke: #FF3355;

--other-fill: transparent;
--other-stroke: #0B8E69;

--text-light: #000000;
--text-normal: #000000;
--text-light: var(--editorDarkMode-primary-text);
--text-normal: var(--editorDarkMode-primary-text);

--arg-border: transparent;
}
28 changes: 28 additions & 0 deletions features/random-block-colors/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "Random Block Colors",
"description": "Swaps around the colors of all the blocks each time you press the green flag!",
"credits": [
{
"username": "Alan",
"url": "https://www.youtube.com/watch?v=z54AmH9Yi78&feature=youtu.be"
}
],
"type": ["Editor", "Egg"],
"styles": [{ "file": "style.css", "runOn": "/projects/*" }],
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
"resources": [
{ "name": "check", "path": "/check.svg" },
{ "name": "circle", "path": "/circle.svg" },
{ "name": "colors", "path": "/colors.css" }
],
"components": [
{
"type": "info",
"content": "This is an April Fool's Day feature. It was likely enabled automatically on April 1st, but you may disable it if you'd like."
},
{
"type": "warning",
"content": "This feature is not compatible with the \"More Block Themes\" feature. You will not be able to use other block themes while this feature is enabled."
}
]
}
Loading
Loading