From 9a3c1bd4e1073942c299776b3248cfd6949420fc Mon Sep 17 00:00:00 2001
From: raclim <43053081+raclim@users.noreply.github.com>
Date: Mon, 1 Dec 2025 18:59:37 -0500
Subject: [PATCH 1/4] update banner copy for eoy 2025 fundraiser
---
client/modules/IDE/components/Banner.jsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/client/modules/IDE/components/Banner.jsx b/client/modules/IDE/components/Banner.jsx
index 5449bac0b7..06cc115744 100644
--- a/client/modules/IDE/components/Banner.jsx
+++ b/client/modules/IDE/components/Banner.jsx
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
+import { Trans } from 'react-i18next';
import { CrossIcon } from '../../../common/icons';
/**
@@ -23,12 +24,11 @@ import { CrossIcon } from '../../../common/icons';
const Banner = ({ onClose }) => {
// URL can be updated depending on the opportunity or announcement.
- const bannerURL = 'https://openprocessing.org/curation/89576';
+ const bannerURL = 'https://processingfoundation.org/donate';
+
const bannerCopy = (
<>
- We’re accepting p5.js sketches for a special curation exploring mental
- health and the newest features in p5.js 2.0!{' '}
- Submit by July 20!
+ }} />
>
);
From 0fc30b1b9387d9c0c4a66dd67299d51cdd2fabb6 Mon Sep 17 00:00:00 2001
From: raclim <43053081+raclim@users.noreply.github.com>
Date: Mon, 1 Dec 2025 19:00:41 -0500
Subject: [PATCH 2/4] add in translation key for slim banner text for all lang
---
translations/locales/en-US/translations.json | 3 +++
translations/locales/es-419/translations.json | 3 +++
translations/locales/fr-CA/translations.json | 3 +++
translations/locales/hi/translations.json | 3 +++
translations/locales/it/translations.json | 3 +++
translations/locales/ja/translations.json | 3 +++
translations/locales/ko/translations.json | 3 +++
translations/locales/pt-BR/translations.json | 3 +++
translations/locales/sv/translations.json | 3 +++
translations/locales/tr/translations.json | 3 +++
translations/locales/uk-UA/translations.json | 3 +++
translations/locales/ur/translations.json | 3 +++
translations/locales/zh-CN/translations.json | 3 +++
translations/locales/zh-TW/translations.json | 3 +++
14 files changed, 42 insertions(+)
diff --git a/translations/locales/en-US/translations.json b/translations/locales/en-US/translations.json
index a7f95e55a3..1d254a5afc 100644
--- a/translations/locales/en-US/translations.json
+++ b/translations/locales/en-US/translations.json
@@ -49,6 +49,9 @@
"LogOut": "Log Out"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Toggle Replace",
"Find": "Find",
diff --git a/translations/locales/es-419/translations.json b/translations/locales/es-419/translations.json
index 830a3b917b..3694eba545 100644
--- a/translations/locales/es-419/translations.json
+++ b/translations/locales/es-419/translations.json
@@ -47,6 +47,9 @@
"LogOut": "Cerrar sesión"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Alternar reemplazar",
"Find": "Buscar",
diff --git a/translations/locales/fr-CA/translations.json b/translations/locales/fr-CA/translations.json
index ac0feaadbb..f3b1767a75 100644
--- a/translations/locales/fr-CA/translations.json
+++ b/translations/locales/fr-CA/translations.json
@@ -48,6 +48,9 @@
"LogOut": "Se déconnecter"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Activer/désactiver le remplacement",
"Find": "Rechercher",
diff --git a/translations/locales/hi/translations.json b/translations/locales/hi/translations.json
index 7ed913cf0d..7f666c24bb 100644
--- a/translations/locales/hi/translations.json
+++ b/translations/locales/hi/translations.json
@@ -47,6 +47,9 @@
"LogOut": "लॉग आउट"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "टॉगल बदली करें",
"Find": "खोज",
diff --git a/translations/locales/it/translations.json b/translations/locales/it/translations.json
index 1ee889e9ad..28dd939f18 100644
--- a/translations/locales/it/translations.json
+++ b/translations/locales/it/translations.json
@@ -47,6 +47,9 @@
"LogOut": "Esci"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Attiva/disattiva Sostituzione",
"Find": "Cerca",
diff --git a/translations/locales/ja/translations.json b/translations/locales/ja/translations.json
index 8d2030aa46..bb65617c9c 100644
--- a/translations/locales/ja/translations.json
+++ b/translations/locales/ja/translations.json
@@ -47,6 +47,9 @@
"LogOut": "ログアウト"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "置換の切り替え",
"Find": "検索",
diff --git a/translations/locales/ko/translations.json b/translations/locales/ko/translations.json
index 14f9cff948..901a948b2a 100644
--- a/translations/locales/ko/translations.json
+++ b/translations/locales/ko/translations.json
@@ -48,6 +48,9 @@
"LogOut": "로그아웃"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"LoginForm": {
"UsernameOrEmail": "이메일 또는 아이디",
"UsernameOrEmailARIA": "이메일 또는 아이디",
diff --git a/translations/locales/pt-BR/translations.json b/translations/locales/pt-BR/translations.json
index 8c0da13e83..b17caa74b2 100644
--- a/translations/locales/pt-BR/translations.json
+++ b/translations/locales/pt-BR/translations.json
@@ -45,6 +45,9 @@
"LogOut": "Sair"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Alternar entre localizar/substituir",
"FindPlaceholder": "Localizar em arquivos",
diff --git a/translations/locales/sv/translations.json b/translations/locales/sv/translations.json
index 62241fbb7e..5937f38449 100644
--- a/translations/locales/sv/translations.json
+++ b/translations/locales/sv/translations.json
@@ -47,6 +47,9 @@
"LogOut": "Logga ut"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Växla ersätt",
"Find": "Sök",
diff --git a/translations/locales/tr/translations.json b/translations/locales/tr/translations.json
index bf0d00014b..f7b3b42d2b 100644
--- a/translations/locales/tr/translations.json
+++ b/translations/locales/tr/translations.json
@@ -47,6 +47,9 @@
"LogOut": "Çıkış Yap"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Değiştirme Aç/Kapa",
"Find": "Bul",
diff --git a/translations/locales/uk-UA/translations.json b/translations/locales/uk-UA/translations.json
index b548333a57..62e223dfde 100644
--- a/translations/locales/uk-UA/translations.json
+++ b/translations/locales/uk-UA/translations.json
@@ -47,6 +47,9 @@
"LogOut": "Вийти"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "Увімкнути заміну",
"Find": "Знайти",
diff --git a/translations/locales/ur/translations.json b/translations/locales/ur/translations.json
index e91e48996d..a6a54a0ed2 100644
--- a/translations/locales/ur/translations.json
+++ b/translations/locales/ur/translations.json
@@ -47,6 +47,9 @@
"LogOut": "لاگ آوٹ"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "تبدیل کرنے کو ٹوگل کریں۔",
"Find": "تلاش کریں",
diff --git a/translations/locales/zh-CN/translations.json b/translations/locales/zh-CN/translations.json
index fc5164e493..ff59d90b03 100644
--- a/translations/locales/zh-CN/translations.json
+++ b/translations/locales/zh-CN/translations.json
@@ -47,6 +47,9 @@
"LogOut": "登出"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "开关替换选项",
"Find": "查找",
diff --git a/translations/locales/zh-TW/translations.json b/translations/locales/zh-TW/translations.json
index 17ffc05781..69eba743b5 100644
--- a/translations/locales/zh-TW/translations.json
+++ b/translations/locales/zh-TW/translations.json
@@ -47,6 +47,9 @@
"LogOut": "登出"
}
},
+ "Banner": {
+ "Copy": "Donate Today! Support p5.js and the Processing Foundation."
+ },
"CodemirrorFindAndReplace": {
"ToggleReplace": "切換取代",
"Find": "尋找",
From f2646dcdb3d7cc017259ad5d7dfa72910d5bf629 Mon Sep 17 00:00:00 2001
From: raclim <43053081+raclim@users.noreply.github.com>
Date: Mon, 1 Dec 2025 19:01:59 -0500
Subject: [PATCH 3/4] import p5soundurl as named export
---
client/modules/IDE/components/Preferences/index.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/modules/IDE/components/Preferences/index.jsx b/client/modules/IDE/components/Preferences/index.jsx
index 10829032ea..aa3a4b68a6 100644
--- a/client/modules/IDE/components/Preferences/index.jsx
+++ b/client/modules/IDE/components/Preferences/index.jsx
@@ -22,7 +22,7 @@ import {
setPreferencesTab
} from '../../actions/preferences';
import { majorVersion, p5URL, useP5Version } from '../../hooks/useP5Version';
-import p5SoundURL from '../../../../../common/p5URLs';
+import { p5SoundURL } from '../../../../../common/p5URLs';
import VersionPicker from '../VersionPicker';
import { updateFileContent } from '../../actions/files';
import { CmControllerContext } from '../../pages/IDEView';
From 224f55e9b0614ccd0ad779d312526e77f3018677 Mon Sep 17 00:00:00 2001
From: raclim <43053081+raclim@users.noreply.github.com>
Date: Mon, 1 Dec 2025 19:02:54 -0500
Subject: [PATCH 4/4] set banner cooldown for hiding
---
client/modules/IDE/pages/IDEView.jsx | 35 ++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx
index f3d869937b..d81930a327 100644
--- a/client/modules/IDE/pages/IDEView.jsx
+++ b/client/modules/IDE/pages/IDEView.jsx
@@ -29,6 +29,13 @@ import useIsMobile from '../hooks/useIsMobile';
import Banner from '../components/Banner';
import { P5VersionProvider } from '../hooks/useP5Version';
+const BANNER_DISMISS_KEY = 'bannerLastDismissedAt';
+const BANNER_COOLDOWN_MINUTES = 30;
+
+function minutesSince(timestamp) {
+ return (Date.now() - timestamp) / (1000 * 60);
+}
+
function getTitle(project) {
const { id } = project;
return id ? `p5.js Web Editor | ${project.name}` : 'p5.js Web Editor';
@@ -106,7 +113,7 @@ const IDEView = () => {
const [sidebarSize, setSidebarSize] = useState(160);
const [isOverlayVisible, setIsOverlayVisible] = useState(false);
const [MaxSize, setMaxSize] = useState(window.innerWidth);
- const [displayBanner, setDisplayBanner] = useState(false);
+ const [displayBanner, setDisplayBanner] = useState(true);
const cmRef = useRef({});
@@ -151,6 +158,7 @@ const IDEView = () => {
}
};
}, [shouldAutosave, dispatch]);
+
useEffect(() => {
const updateInnerWidth = (e) => {
setMaxSize(e.target.innerWidth);
@@ -163,6 +171,29 @@ const IDEView = () => {
};
}, [setMaxSize]);
+ // checks how long banner has been closed for to hide banner
+ useEffect(() => {
+ const stored = window.localStorage.getItem(BANNER_DISMISS_KEY);
+ const lastClosedAt = stored ? Number(stored) : null;
+
+ if (!lastClosedAt) {
+ setDisplayBanner(true);
+ return;
+ }
+
+ if (minutesSince(lastClosedAt) >= BANNER_COOLDOWN_MINUTES) {
+ setDisplayBanner(true);
+ } else {
+ setDisplayBanner(false);
+ }
+ }, []);
+
+ const handleBannerClose = () => {
+ setDisplayBanner(false);
+
+ window.localStorage.setItem(BANNER_DISMISS_KEY, String(Date.now()));
+ };
+
const consoleCollapsedSize = 29;
const currentConsoleSize = ide.consoleIsExpanded
? consoleSize
@@ -173,7 +204,7 @@ const IDEView = () => {
{getTitle(project)}
- {displayBanner && setDisplayBanner(false)} />}
+ {displayBanner && }
cmRef.current?.getContent()} />