feat: instant model loading

This commit is contained in:
TrèsAbhi committed 2024-07-10 20:47:02 -05:00
1 parent db4c207708
commit 11e75e48ce
2 files changed
+45 -24

No files matched your search

@@ -1,16 +1,17 @@
import { Flex, Progress } from '@radix-ui/themes';
import { Flex, FlexProps, Progress } from '@radix-ui/themes';
import { useProgress } from '@react-three/drei';
import { tankIcon } from '../../../../../../core/blitzkit/tankIcon';
export function TankSandboxLoader({ id }: { id: number }) {
type TankSandboxLoaderProps = Omit<FlexProps, 'id'> & {
id: number;
};
export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) {
const data = useProgress();
return (
<Flex width="100%" height="100%" align="center" justify="center">
<img
src={tankIcon(id)}
style={{ height: '60%', filter: 'blur(4px) grayscale(1)' }}
/>
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
<img src={tankIcon(id)} style={{ height: '60%', filter: 'blur(4px)' }} />
<Progress
size="3"
value={data.progress}