11/* eslint-disable react/no-unknown-property */
2- import { Canvas , ThreeElements } from '@react-three/fiber' ;
2+ import { Canvas } from '@react-three/fiber' ;
33import { lazy , Suspense , useEffect , useRef } from 'react' ;
44
55import {
66 Environment ,
77 Html ,
8+ OrbitControls ,
89 ScrollControls ,
910 useProgress ,
10- useScroll ,
1111} from '@react-three/drei' ;
1212import { Box , Progress } from '@chakra-ui/react' ;
13- import { useMousePositions , useSpringMousePosition } from '@hooks' ;
13+ import { useMousePositions } from '@hooks' ;
1414import gsap from 'gsap' ;
15- import { useAnimate } from 'framer-motion' ;
16- import { has } from 'lodash' ;
17- import { Mesh } from 'three' ;
15+ import { DirectionalLight , Mesh } from 'three' ;
1816
1917const LoaderComponent = ( ) => {
2018 const { progress } = useProgress ( ) ;
@@ -29,6 +27,7 @@ const LoaderComponent = () => {
2927
3028const AdamHead = lazy ( ( ) => import ( './AdamHead' ) ) ;
3129const LieutenantHead = lazy ( ( ) => import ( './LieutenantHead' ) ) ;
30+ const IonDrive = lazy ( ( ) => import ( './IonDrive' ) ) ;
3231
3332const RobotScene = ( {
3433 type = 'lieutenant' ,
@@ -47,8 +46,8 @@ const RobotScene = ({
4746 } ) ;
4847 if ( ! ref . current ) return ;
4948 tl . current . to ( ref . current . rotation , {
50- y : x !== 0 ? x / 2500 - 0.25 : - 0.25 ,
51- x : y !== 0 ? - y / 2500 - 0.2 : - 0.2 ,
49+ y : x !== 0 ? x / 5000 - 0.18 : - 0.25 ,
50+ x : y !== 0 ? - y / 5000 - 0.17 : - 0.2 ,
5251 duration : 1.5 ,
5352 } ) ;
5453
@@ -68,22 +67,24 @@ const RobotScene = ({
6867 dpr = { [ 1 , 2 ] }
6968 performance = { { min : 0.1 , max : 1 } }
7069 camera = { {
71- position : [ 0 , - 5 , - 20 ] ,
72- fov : 10 ,
70+ position : [ 0 , - 3 , - 20 ] ,
71+ fov : 12 ,
7372 } }
7473 >
7574 < ambientLight intensity = { 0.5 } color = { 'violet' } />
7675 < spotLight position = { [ 10 , 10 , 10 ] } angle = { 0.15 } penumbra = { 1 } />
76+ < directionalLight position = { [ 0 , 0 , 1 ] } intensity = { 0.5 } />
7777 < Suspense fallback = { < LoaderComponent /> } >
78- < ScrollControls pages = { 3 } damping = { 10 } >
79- { type === 'adam' ? (
80- < AdamHead ref = { ref } />
81- ) : (
82- < LieutenantHead ref = { ref } />
83- ) }
84- </ ScrollControls >
78+ { type === 'adam' ? (
79+ < AdamHead ref = { ref } />
80+ ) : (
81+ < LieutenantHead ref = { ref } />
82+ ) }
8583 </ Suspense >
86- < Environment preset = "dawn" blur = { 0.2 } />
84+ < Suspense >
85+ < IonDrive />
86+ </ Suspense >
87+ < Environment preset = "city" blur = { 0.8 } />
8788 </ Canvas >
8889 ) ;
8990} ;
0 commit comments