mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 09:11:38 +00:00
fix: missing url
update loading method
This commit is contained in:
@ -2,9 +2,11 @@
|
||||
|
||||
import { PerspectiveCamera } from '@react-three/drei/core/PerspectiveCamera';
|
||||
import { Canvas } from '@react-three/fiber';
|
||||
import clsx from 'clsx';
|
||||
import RuaLoading from 'components/rua/loading/rua-loading';
|
||||
import { Suspense, lazy, useMemo } from 'react';
|
||||
import { useMediaQuery } from 'react-responsive';
|
||||
import Loading from './loading';
|
||||
import useStore from 'store';
|
||||
|
||||
const DeskCamera = lazy(() => import('components/models/home/desk-camera'));
|
||||
const ComputerModel = lazy(
|
||||
@ -23,10 +25,12 @@ const ComputerDesk = () => {
|
||||
return 0.1;
|
||||
}, [isMobile]);
|
||||
|
||||
const modelLoading = useStore((state) => state.modelLoading);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Canvas>
|
||||
<Suspense fallback={<Loading />}>
|
||||
<Suspense fallback={<></>}>
|
||||
<ambientLight intensity={1} />
|
||||
<directionalLight position={[10, 10, 10]} intensity={0.5} />
|
||||
<DeskCamera>
|
||||
@ -42,6 +46,19 @@ const ComputerDesk = () => {
|
||||
<PerspectiveCamera makeDefault position={[0, 0, 36]} />
|
||||
</Suspense>
|
||||
</Canvas>
|
||||
|
||||
<div
|
||||
className={clsx(
|
||||
'h-full w-full absolute',
|
||||
'top-0 left-0 flex',
|
||||
'justify-center items-center',
|
||||
// 'bg-bluish-gray dark:bg-rua-gray-900',
|
||||
'transition-all duration-300',
|
||||
!modelLoading && 'opacity-0',
|
||||
)}
|
||||
>
|
||||
<RuaLoading />
|
||||
</div>
|
||||
{/* <Leva /> */}
|
||||
</>
|
||||
);
|
||||
|
Reference in New Issue
Block a user