Skip to content

Commit c94d68e

Browse files
committed
feat(): Adding the new 3d object
1 parent 2bf4f23 commit c94d68e

17 files changed

Lines changed: 156 additions & 64 deletions

File tree

public/IonDrive.glb

-4.83 MB
Binary file not shown.

public/ReapTheWhirlwind.glb

83.4 MB
Binary file not shown.
File renamed without changes.

public/music/dream.mp3

5.97 MB
Binary file not shown.

public/music/electro.mp3

2.93 MB
Binary file not shown.

public/music/horror.mp3

3.52 MB
Binary file not shown.

src/components/WavyBackground/WavyBackground.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const WavyBackground = ({
108108

109109
return (
110110
<div
111-
className={'flex flex-col items-center justify-center mx-auto'}
111+
className={'flex flex-col items-center justify-center'}
112112
style={{
113113
height: '15vh',
114114
zIndex: 0,
@@ -121,6 +121,7 @@ const WavyBackground = ({
121121
ref={canvasRef}
122122
id="canvas"
123123
style={{
124+
zIndex: -1,
124125
height: '100vh',
125126
width: '100%',
126127
...(isSafari ? { filter: `blur(${blur}px)` } : {}),

src/screens/mainFlow/CoverContent/CoverContent.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
import { useState } from 'react';
22
import { CoverText, Lights, MeteorsEffect } from '@components';
3-
import { CharacterType, RobotScene } from '../scene';
3+
import { CharacterType, RobotScene1, RobotScene2 } from '../scene';
44
import { SocialNavigation } from '../components';
55
import { useTranslation } from 'react-i18next';
66
import { Box } from '@chakra-ui/react';
77

8+
const MusicMap: Record<CharacterType, string> = {
9+
[CharacterType.ADAM]: '/music/dream.mp3',
10+
[CharacterType.LIEUTENANT]: '/music/horror.mp3',
11+
[CharacterType.COPERNICUS]: '/music/bg1.mp3',
12+
[CharacterType.REAP]: '/music/electro.mp3',
13+
};
14+
815
const CoverContent = () => {
916
const { t } = useTranslation();
10-
const [characterType, setCharacterType] =
11-
useState<CharacterType>('copernicus');
17+
const [characterType, setCharacterType] = useState<CharacterType>(
18+
CharacterType.REAP,
19+
);
20+
1221
return (
1322
<Box minH={'100vh'}>
1423
<MeteorsEffect number={30} />
15-
<RobotScene type={characterType} />
24+
{characterType === CharacterType.REAP ? (
25+
<RobotScene2 />
26+
) : (
27+
<RobotScene1 type={characterType} />
28+
)}
1629
<CoverText
1730
text={t('coverText.greeting')}
1831
highlightedText={t('coverText.name')}
1932
role={t('coverText.role')}
2033
/>
2134
<Lights />
2235
<SocialNavigation
36+
audioSource={MusicMap[characterType]}
2337
handleCharacterClick={(type) => {
2438
setCharacterType(type);
2539
}}

src/screens/mainFlow/components/SocialNavigation.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ const IconProps = {
3737

3838
const SocialNavigation = ({
3939
handleCharacterClick: handlerCharacterClick,
40+
audioSource,
4041
}: {
4142
handleCharacterClick: (type: CharacterType) => void;
43+
audioSource: string;
4244
}) => {
4345
const ref = useRef<HTMLDivElement>(null);
4446
const [isPlaying, setIsPlaying] = useState(false);
@@ -96,7 +98,7 @@ const SocialNavigation = ({
9698
onMouseEnter={onMouseEnter(musicRef, '10px')}
9799
onMouseLeave={onMouseLeave}
98100
/>
99-
<audio src="bg.mp3" loop hidden autoPlay>
101+
<audio src={audioSource} loop hidden autoPlay>
100102
<p>
101103
If you are reading this, it is because your browser does not support
102104
the audio element.
@@ -129,16 +131,14 @@ const SocialNavigation = ({
129131
boxShadow: '0px 0px 10px 4px gray',
130132
}}
131133
>
132-
{(['adam', 'lieutenant', 'copernicus'] as CharacterType[]).map(
133-
(character: CharacterType) => (
134-
<MenuItem
135-
key={character}
136-
onClick={() => handlerCharacterClick(character)}
137-
>
138-
<Text fontSize={'xl'}>{character.toUpperCase()}</Text>
139-
</MenuItem>
140-
),
141-
)}
134+
{Object.values(CharacterType).map((character: CharacterType) => (
135+
<MenuItem
136+
key={character}
137+
onClick={() => handlerCharacterClick(character)}
138+
>
139+
<Text fontSize={'xl'}>{character.toUpperCase()}</Text>
140+
</MenuItem>
141+
))}
142142
</MenuList>
143143
</Menu>
144144
</Box>

src/screens/mainFlow/scene/AdamHead.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ ExporterVersion: 2.2.0
77
import { useGLTF } from '@react-three/drei';
88
import { forwardRef } from 'react';
99

10-
useGLTF.preload('adamHead.glb');
10+
useGLTF.preload('/adamHead.glb');
1111

1212
const Model = forwardRef((props, ref) => {
13-
const { scene } = useGLTF('adamHead.glb');
13+
const { scene } = useGLTF('/adamHead.glb');
1414

1515
scene.traverse((child) => {
1616
if (child.isMesh) {

0 commit comments

Comments
 (0)