From 3833559ceccb642880013b18359ee36fa3cc757e Mon Sep 17 00:00:00 2001 From: incognitotgt Date: Tue, 16 Apr 2024 07:44:10 -0400 Subject: [PATCH 1/2] particles --- src/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 98c629e..476b6d6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -14,7 +14,7 @@ const particlesUrl = localStorage.getItem("particles") || "none"; export default function App() { const [init, setInit] = useState(false); - const {background} = useTheme(); + const { background } = useTheme(); // this should be run only once per application lifetime useEffect(() => { initParticlesEngine(async (engine) => { @@ -37,14 +37,17 @@ export default function App() { {window.location.origin === "https://nebulaproxy.io" && } {/* {window.location.origin === "http://localhost:8080" && } */} }> - -
+
+ +
+
{init && particlesUrl !== "none" && ( )}
From c2268be99741109d3bc375f7b4ad7497aebd8d4a Mon Sep 17 00:00:00 2001 From: incognitotgt Date: Tue, 16 Apr 2024 23:23:56 -0400 Subject: [PATCH 2/2] fix issue for last --- src/components/ThemeProvider.tsx | 10 ++++++---- src/index.tsx | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx index 6592ca8..9afdf47 100644 --- a/src/components/ThemeProvider.tsx +++ b/src/components/ThemeProvider.tsx @@ -54,10 +54,12 @@ export function ThemeProvider({ children, ...props }: ThemeProviderProps) { root.classList.remove(theme); }); root.classList.add(theme); - document.documentElement.style.setProperty( - "--background-image", - `url(${background})` - ); + if (background) { + document.documentElement.style.setProperty( + "--background-image", + `url(${background})` + ); + } }, [theme, themes, background]); const value = { diff --git a/src/index.tsx b/src/index.tsx index 476b6d6..ae0594b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -33,21 +33,22 @@ export default function App() { console.log(container); }; return ( -
+
{window.location.origin === "https://nebulaproxy.io" && } {/* {window.location.origin === "http://localhost:8080" && } */} }> -
+
-
+
{init && particlesUrl !== "none" && ( )}