diff --git a/packages/website/src/components/TankSandboxLoader/index.module.css b/packages/website/src/components/TankSandboxLoader/index.module.css new file mode 100644 index 000000000..83b1f80b9 --- /dev/null +++ b/packages/website/src/components/TankSandboxLoader/index.module.css @@ -0,0 +1,44 @@ +.loader { + position: absolute; + + top: 50%; + left: 50%; + + transform: translate(-50%, -50%); + + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); + + opacity: 1; + filter: blur(0); + + transition: var(--duration-subtle); + + &[data-visible="false"] { + opacity: 0; + pointer-events: none; + + filter: blur(4rem); + } + + .icon { + height: 25%; + } + + .progress { + height: var(--space-2); + width: 100%; + + background-color: var(--gray-3); + + border-radius: calc(var(--space-2) / 2); + overflow: hidden; + + .bar { + height: 100%; + background-color: var(--accent-9); + } + } +} diff --git a/packages/website/src/components/TankSandboxLoader/index.tsx b/packages/website/src/components/TankSandboxLoader/index.tsx new file mode 100644 index 000000000..81b485d82 --- /dev/null +++ b/packages/website/src/components/TankSandboxLoader/index.tsx @@ -0,0 +1,35 @@ +import { alias } from "@blitzkit/core"; +import { useProgress } from "@react-three/drei"; +import { Tankopedia } from "../../stores/tankopedia"; +import styles from "./index.module.css"; + +export function TankSandboxLoader() { + const tank = Tankopedia.use((state) => state.protagonist.tank); + const revealed = Tankopedia.use((state) => state.revealed); + + const data = useProgress(); + + const isVisible = !revealed; + + return ( +
+ + +
+ ); +} + +interface ProgressProps { + value: number; +} + +function Progress({ value }: ProgressProps) { + return ( +
+
+
+ ); +} diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandboxLoader.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandboxLoader.tsx deleted file mode 100644 index 015b7d095..000000000 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandboxLoader.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { alias } from "@blitzkit/core"; -import { Flex, type FlexProps, Progress } from "@radix-ui/themes"; -import { useProgress } from "@react-three/drei"; - -type TankSandboxLoaderProps = Omit & { - id: number; -}; - -export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) { - const data = useProgress(); - - return ( - - - - - ); -} diff --git a/packages/website/src/components/TankopediaSandbox/index.tsx b/packages/website/src/components/TankopediaSandbox/index.tsx index 4e95bfa93..451afef2d 100644 --- a/packages/website/src/components/TankopediaSandbox/index.tsx +++ b/packages/website/src/components/TankopediaSandbox/index.tsx @@ -24,6 +24,7 @@ import { StaticArmor, type ThicknessRange } from "../StaticArmor"; import { TankModel } from "../TankModel"; import { TankopediaAntagonistControl } from "../TankopediaAntagonistControl"; import { TankopediaSkinSwitcher } from "../TankopediaSkinSwitcher"; +import { TankSandboxLoader } from "../TankSandboxLoader"; import styles from "./index.module.css"; type TankSandboxProps = MaybeSkeletonComponentProps & { @@ -172,6 +173,7 @@ export function TankopediaSandbox({ {!skeleton && } +