AppState context add

This commit is contained in:
Johannes Kirschbauer
2023-10-01 22:47:09 +02:00
parent 82db33d047
commit f9c35ceaa4
14 changed files with 406 additions and 220 deletions

View File

@@ -0,0 +1,51 @@
import Image from "next/image";
import clanLight from "../../public/clan-dark.png";
import clanDark from "../../public/clan-dark.png";
import { useAppState } from "./hooks/useAppContext";
export default function Background() {
const { data, isLoading } = useAppState();
return (
<div
className={
"fixed -z-10 h-[100vh] w-[100vw] overflow-hidden opacity-10 blur-md dark:opacity-40"
}
>
{(isLoading || !data.isJoined) && (
<>
<Image
className="dark:hidden"
alt="clan"
src={clanLight}
placeholder="blur"
quality={100}
fill
sizes="100vw"
style={{
objectFit: "cover",
}}
/>
<Image
className="hidden dark:block"
alt="clan"
src={clanDark}
placeholder="blur"
quality={100}
fill
sizes="100vw"
style={{
objectFit: "cover",
}}
/>
</>
)}
</div>
);
}
// position: fixed;
// height: 100vh;
// width: 100vw;
// overflow: hidden;
// z-index: -1;