commit
19635704c8
2 changed files with 15 additions and 9 deletions
|
|
@ -54,10 +54,12 @@ export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
||||||
root.classList.remove(theme);
|
root.classList.remove(theme);
|
||||||
});
|
});
|
||||||
root.classList.add(theme);
|
root.classList.add(theme);
|
||||||
document.documentElement.style.setProperty(
|
if (background) {
|
||||||
"--background-image",
|
document.documentElement.style.setProperty(
|
||||||
`url(${background})`
|
"--background-image",
|
||||||
);
|
`url(${background})`
|
||||||
|
);
|
||||||
|
}
|
||||||
}, [theme, themes, background]);
|
}, [theme, themes, background]);
|
||||||
|
|
||||||
const value = {
|
const value = {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ const particlesUrl = localStorage.getItem("particles") || "none";
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const [init, setInit] = useState(false);
|
const [init, setInit] = useState(false);
|
||||||
const {background} = useTheme();
|
const { background } = useTheme();
|
||||||
// this should be run only once per application lifetime
|
// this should be run only once per application lifetime
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initParticlesEngine(async (engine) => {
|
initParticlesEngine(async (engine) => {
|
||||||
|
|
@ -33,18 +33,22 @@ export default function App() {
|
||||||
console.log(container);
|
console.log(container);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className={!background && "bg-primary"}>
|
<div>
|
||||||
{window.location.origin === "https://nebulaproxy.io" && <Meta />}
|
{window.location.origin === "https://nebulaproxy.io" && <Meta />}
|
||||||
{/* {window.location.origin === "http://localhost:8080" && <Meta />} */}
|
{/* {window.location.origin === "http://localhost:8080" && <Meta />} */}
|
||||||
<Suspense fallback={<LoadSuspense />}>
|
<Suspense fallback={<LoadSuspense />}>
|
||||||
<Routes />
|
<main className="absolute z-30 h-screen w-screen">
|
||||||
<div className="z-10 h-full w-full bg-primary">
|
<Routes />
|
||||||
|
</main>
|
||||||
|
<div
|
||||||
|
className={`z-20 h-screen w-screen ${!background && "bg-primary"}`}
|
||||||
|
>
|
||||||
{init && particlesUrl !== "none" && (
|
{init && particlesUrl !== "none" && (
|
||||||
<Particles
|
<Particles
|
||||||
id="tsparticles"
|
id="tsparticles"
|
||||||
url={particlesUrl}
|
url={particlesUrl}
|
||||||
particlesLoaded={particlesLoaded}
|
particlesLoaded={particlesLoaded}
|
||||||
class="bg-primary"
|
className="bg-primary"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue