Skip to content

Commit

Permalink
Portfolio completed
Browse files Browse the repository at this point in the history
  • Loading branch information
harshbhar0629 committed Jul 29, 2024
1 parent 055e8dc commit 7a47531
Show file tree
Hide file tree
Showing 21 changed files with 323 additions and 598 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Harsh Bhardwaj 3D-Portfolio
<!-- @format -->

# Harsh Bhardwaj 3D-Portfolio
<h2>Don't fork this portfolio will not work because of some hidden content</h2>
<h2>For better view use laptop, desktop, Tablet, instead of phone</h2>
12 changes: 6 additions & 6 deletions src/assets/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @format */

import logo from "./logo.svg";
import backend from "./backend.png";
import creator from "./creator.png";
Expand All @@ -6,10 +8,10 @@ import web from "./web.png";
import github from "./github.png";
import menu from "./menu.svg";
import close from "./close.svg";
import Airbnb from "./Airbnb.png"
import Airbnb from "./Airbnb.png";
import shoppingCart from "./shoppingCart.png";
import blogContext from "./blogContext.png";
import snakeGame from "./snakeGame.png"
import snakeGame from "./snakeGame.png";
import razorpayClone from "./razorpayClone.png";
import github2 from "./github-2.png";
import linkedin from "./linkedin.png";
Expand All @@ -25,13 +27,12 @@ import nodejs from "./tech/nodejs.png";
import reactjs from "./tech/reactjs.png";
import redux from "./tech/redux.png";
import tailwind from "./tech/tailwind.png";
import cpp from "./tech/cpp.png"
import cpp from "./tech/cpp.png";

import leetcode from "./company/leetcode.png";
import coding_ninjas from "./company/coding_ninjas.png";
import gfg from "./company/gfg.png";


export {
logo,
backend,
Expand All @@ -42,7 +43,6 @@ export {
menu,
close,
css,

git,
html,
javascript,
Expand All @@ -63,5 +63,5 @@ export {
cpp,
linkedin,
gmail,
phoneCall
phoneCall,
};
2 changes: 1 addition & 1 deletion src/components/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Tilt from "react-tilt";
import { motion } from "framer-motion";

import { styles } from "../styles";
import { services } from "../constants";
import { services } from "../constant";
import { SectionWrapper } from "../hoc";
import { fadeIn, textVariant } from "../utils/motion";

Expand Down
16 changes: 11 additions & 5 deletions src/components/Contact.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { styles } from "../styles";
import { EarthCanvas } from "./canvas";
import { SectionWrapper } from "../hoc";
import { slideIn } from "../utils/motion";
import { socials, personalInfo } from "../constants";
import { socials, personalInfo } from "../constant";

const Contact = () => {
const formRef = useRef();
Expand Down Expand Up @@ -130,7 +130,7 @@ const Contact = () => {
</motion.div>
</div>

<div className="w-[90%] sm:max-w-[80%] mx-auto flex flex-row justify-evenly items-center gap-10 bg-[#151030] mt-[50px] py-[15px] px-[30px] flex-wrap rounded-md">
<div className="w-full sm:max-w-[80%] mx-auto flex sm:flex-row flex-col justify-evenly items-center gap-10 bg-[#151030] mt-[50px] py-[10px] sm:py-[15px] sm:px-[30px] flex-wrap rounded-md">
{socials.map((social) => (
<div
key={social.id}
Expand All @@ -140,11 +140,17 @@ const Contact = () => {
width={`40px`}
height={`40px`}></img>
{social.id === 1 ? (
<p className="underline">{social.name}</p>
<p className="underline text-[12px]">
{social.name}
</p>
) : (
<a className="underline" href={social.link} target="_blank">{social.name}</a>
<a
className="underline sm:text-[12px] text-[10px]"
href={social.link}
target="_blank">
{social.name}
</a>
)}

</div>
))}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Experience.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { motion } from "framer-motion";
import "react-vertical-timeline-component/style.min.css";

import { styles } from "../styles";
import { experiences } from "../constants";
import { experiences } from "../constant";
import { SectionWrapper } from "../hoc";
import { textVariant } from "../utils/motion";

Expand All @@ -33,7 +33,7 @@ const ExperienceCard = ({ experience }) => {
}>
<div>
<a href={`${experience.link}`} target="_blank">
<h3 className="text-white text-[24px] font-bold underline">
<h3 className="text-white sm:text-[24px] text-[16px] font-bold underline">
{experience.title}
</h3>
</a>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/** @format */

import { motion } from "framer-motion";

import { styles } from "../styles";
import { ComputersCanvas } from "./canvas";

const Hero = () => {
return (
return (
<section className={`relative w-full h-screen mx-auto`}>
<div
className={`absolute inset-0 top-[140px] max-w-7xl mx-auto ${styles.paddingX} flex flex-row items-start gap-5`}>
Expand All @@ -17,7 +19,6 @@ const Hero = () => {
<h1 className={`${styles.heroHeadText} text-white`}>
Hi, I'm <span className="text-[#915EFF]">Harsh Bhardwaj</span>
</h1>

</div>
</div>

Expand Down
50 changes: 25 additions & 25 deletions src/components/Loader.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/** @format */

import { Html, useProgress } from "@react-three/drei";

const CanvasLoader = () => {
const { progress } = useProgress();
return (
<Html
as='div'
center
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
flexDirection: "column",
}}
>
<span className='canvas-loader'></span>
<p
style={{
fontSize: 14,
color: "#F1F1F1",
fontWeight: 800,
marginTop: 40,
}}
>
{progress.toFixed(2)}%
</p>
</Html>
);
const { progress } = useProgress();
return (
<Html
as="div"
center
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
flexDirection: "column",
}}>
<span className="canvas-loader"></span>
<p
style={{
fontSize: 14,
color: "#F1F1F1",
fontWeight: 800,
marginTop: 40,
}}>
{progress.toFixed(2)}%
</p>
</Html>
);
};

export default CanvasLoader;
2 changes: 1 addition & 1 deletion src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom";

import { styles } from "../styles";
import { navLinks } from "../constants";
import { navLinks } from "../constant";
import { logo, menu, close } from "../assets";

const Navbar = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tech.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

import { BallCanvas } from "./canvas";
import { SectionWrapper } from "../hoc";
import { technologies } from "../constants";
import { technologies } from "../constant";

const Tech = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Works.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { motion } from "framer-motion";
import { styles } from "../styles";
import { github } from "../assets";
import { SectionWrapper } from "../hoc";
import { projects } from "../constants";
import { projects } from "../constant";
import { fadeIn, textVariant } from "../utils/motion";


Expand Down
3 changes: 1 addition & 2 deletions src/components/canvas/Ball.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const BallCanvas = ({ icon }) => {
gl={{ preserveDrawingBuffer: true }}>
<Suspense fallback={<CanvasLoader />}>
<OrbitControls enableZoom={false} />
<Ball imgUrl={icon} />

<Ball imgUrl={icon} />
</Suspense>

<Preload all />
Expand Down
118 changes: 61 additions & 57 deletions src/components/canvas/Computers.jsx
Original file line number Diff line number Diff line change
@@ -1,78 +1,82 @@
/** @format */

import React, { Suspense, useEffect, useState } from "react";
import { Canvas } from "@react-three/fiber";
import { OrbitControls, Preload, useGLTF } from "@react-three/drei";

import CanvasLoader from "../Loader";

const Computers = ({ isMobile }) => {
const computer = useGLTF("./desktop_pc/scene.gltf");
const computer = useGLTF("./desktop_pc/scene.gltf");

return (
<mesh>
<hemisphereLight intensity={0.15} groundColor='black' />
<spotLight
position={[-20, 50, 10]}
angle={0.12}
penumbra={1}
intensity={1}
castShadow
shadow-mapSize={1024}
/>
<pointLight intensity={1} />
<primitive
object={computer.scene}
scale={isMobile ? 0.7 : 0.75}
position={isMobile ? [0, -3, -2.2] : [0, -3.25, -1.5]}
rotation={[-0.01, -0.2, -0.1]}
/>
</mesh>
);
return (
<mesh>
<hemisphereLight
intensity={0.15}
groundColor="black"
/>
<spotLight
position={[-20, 50, 10]}
angle={0.12}
penumbra={1}
intensity={1}
castShadow
shadow-mapSize={1024}
/>
<pointLight intensity={1} />
<primitive
object={computer.scene}
scale={isMobile ? 0.7 : 0.75}
position={isMobile ? [0, -3, -2.2] : [0, -3.25, -1.5]}
rotation={[-0.01, -0.2, -0.1]}
/>
</mesh>
);
};

const ComputersCanvas = () => {
const [isMobile, setIsMobile] = useState(false);
const [isMobile, setIsMobile] = useState(false);

useEffect(() => {
// Add a listener for changes to the screen size
const mediaQuery = window.matchMedia("(max-width: 500px)");
useEffect(() => {
// Add a listener for changes to the screen size
const mediaQuery = window.matchMedia("(max-width: 500px)");

// Set the initial value of the `isMobile` state variable
setIsMobile(mediaQuery.matches);
// Set the initial value of the `isMobile` state variable
setIsMobile(mediaQuery.matches);

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

// Add the callback function as a listener for changes to the media query
mediaQuery.addEventListener("change", handleMediaQueryChange);
// Add the callback function as a listener for changes to the media query
mediaQuery.addEventListener("change", handleMediaQueryChange);

// Remove the listener when the component is unmounted
return () => {
mediaQuery.removeEventListener("change", handleMediaQueryChange);
};
}, []);
// Remove the listener when the component is unmounted
return () => {
mediaQuery.removeEventListener("change", handleMediaQueryChange);
};
}, []);

return (
<Canvas
frameloop='demand'
shadows
dpr={[1, 2]}
camera={{ position: [20, 3, 5], fov: 25 }}
gl={{ preserveDrawingBuffer: true }}
>
<Suspense fallback={<CanvasLoader />}>
<OrbitControls
enableZoom={false}
maxPolarAngle={Math.PI / 2}
minPolarAngle={Math.PI / 2}
/>
<Computers isMobile={isMobile} />
</Suspense>
return (
<Canvas
frameloop="demand"
shadows
dpr={[1, 2]}
camera={{ position: [20, 3, 5], fov: 25 }}
gl={{ preserveDrawingBuffer: true }}>
<Suspense fallback={<CanvasLoader />}>
<OrbitControls
enableZoom={false}
maxPolarAngle={Math.PI / 2}
minPolarAngle={Math.PI / 2}
/>
<Computers isMobile={isMobile} />
</Suspense>

<Preload all />
</Canvas>
);
<Preload all />
</Canvas>
);
};

export default ComputersCanvas;
Loading

0 comments on commit 7a47531

Please sign in to comment.