Skip to content

Commit 0969ea8

Browse files
committed
update folio
1 parent a8e563f commit 0969ea8

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/components/Tech.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { technologies } from "../constants";
66

77
const Tech = () => {
88
return (
9-
<div className='flex flex-row flex-wrap justify-center gap-10'>
9+
<div className='block hidden sm:flex flex-row flex-wrap justify-center gap-10'>
1010
{technologies.map((technology) => (
1111
<div className='w-28 h-28' key={technology.name}>
1212
<BallCanvas icon={technology.icon} />

src/components/canvas/Ball.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const Ball = (props) => {
3939

4040
const BallCanvas = ({ icon }) => {
4141
return (
42-
<Canvas
42+
<Canvas className="sm:block hidden"
4343
frameloop='demand'
4444
dpr={[1, 2]}
4545
gl={{ preserveDrawingBuffer: true }}

src/components/canvas/Computers.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Suspense, useEffect, useState } from "react";
22
import { Canvas } from "@react-three/fiber";
33
import { OrbitControls, Preload, useGLTF } from "@react-three/drei";
4+
45
import CanvasLoader from "../Loader";
56

67
const Computers = ({ isMobile }) => {
@@ -20,8 +21,8 @@ const Computers = ({ isMobile }) => {
2021
<pointLight intensity={1} />
2122
<primitive
2223
object={computer.scene}
23-
scale={isMobile ? 0.5 : 0.75} // Adjust scale more aggressively
24-
position={isMobile ? [0, -3, -2.5] : [0, -3.25, -1.5]} // Adjust position
24+
scale={isMobile ? 0.7 : 0.75}
25+
position={isMobile ? [0, -3, -2.2] : [0, -3.25, -1.5]}
2526
rotation={[-0.01, -0.2, -0.1]}
2627
/>
2728
</mesh>
@@ -32,30 +33,37 @@ const ComputersCanvas = () => {
3233
const [isMobile, setIsMobile] = useState(false);
3334

3435
useEffect(() => {
35-
const mediaQuery = window.matchMedia("(max-width: 768px)"); // Adjust to 768px for broader coverage
36+
// Add a listener for changes to the screen size
37+
const mediaQuery = window.matchMedia("(max-width: 500px)");
38+
39+
// Set the initial value of the `isMobile` state variable
3640
setIsMobile(mediaQuery.matches);
3741

42+
// Define a callback function to handle changes to the media query
3843
const handleMediaQueryChange = (event) => {
3944
setIsMobile(event.matches);
4045
};
4146

47+
// Add the callback function as a listener for changes to the media query
4248
mediaQuery.addEventListener("change", handleMediaQueryChange);
49+
50+
// Remove the listener when the component is unmounted
4351
return () => {
4452
mediaQuery.removeEventListener("change", handleMediaQueryChange);
4553
};
4654
}, []);
4755

4856
return (
49-
<Canvas className='sm:block hidden'
57+
<Canvas className="sm:block hidden"
5058
frameloop='demand'
5159
shadows
52-
dpr={isMobile ? [1, 1.5] : [1, 2]} // Adjust DPR for mobile
53-
camera={{ position: isMobile ? [15, 3, 5] : [20, 3, 5], fov: 25 }} // Dynamic camera position
60+
dpr={[1, 2]}
61+
camera={{ position: [20, 3, 5], fov: 25 }}
5462
gl={{ preserveDrawingBuffer: true }}
5563
>
5664
<Suspense fallback={<CanvasLoader />}>
5765
<OrbitControls
58-
enableZoom={!isMobile} // Enable zoom for mobile
66+
enableZoom={false}
5967
maxPolarAngle={Math.PI / 2}
6068
minPolarAngle={Math.PI / 2}
6169
/>

0 commit comments

Comments
 (0)