Skip to content

Commit

Permalink
Merge pull request #41 from BasuDevTyagi10/main
Browse files Browse the repository at this point in the history
🛠fix: position of magnified image on hover
  • Loading branch information
1stdevfriend authored Dec 20, 2023
2 parents 6fb29bd + 9d83ccd commit b8bcc7e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
14 changes: 7 additions & 7 deletions src/components/Portfolio/Portfolio.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import PortfolioCard from "../PortfolioCard/PortfolioCard";
import "./Portfolio.scss";
import { arr, arr2, mobileAppOne, mobileAppTwo } from "../../helper/helper";
import { desktopAppImagesData, desktopAppImagesData2, mobileAppImagesData, mobileAppImagesData2 } from "../../helper/helper";
import { useState } from "react";

function Portfolio() {
const [data, setData] = useState([...arr]);
const [mobileApp, setMobileApp] = useState([...mobileAppOne]);
const [desktopAppImages, setDesktopAppImages] = useState([...desktopAppImagesData]);
const [mobileAppImages, setMobileAppImages] = useState([...mobileAppImagesData]);
const handleClick = () => {
setData((p) => [...p, ...arr2]);
setMobileApp((p) => [...p, ...mobileAppTwo]);
setDesktopAppImages((p) => [...p, ...desktopAppImagesData2]);
setMobileAppImages((p) => [...p, ...mobileAppImagesData2]);
document.querySelector(".portfolio-btn").style.display = "none";
};

Expand All @@ -24,7 +24,7 @@ function Portfolio() {
</p>
</div>
<div className="portfolio-cards">
{data.map((item) => (
{desktopAppImages.map((item) => (
<PortfolioCard
key={item.title}
hidden={item.hidden}
Expand All @@ -40,7 +40,7 @@ function Portfolio() {
</div>
<div style={{ height: "3rem" }}></div>
<div className="portfolio-cards">
{mobileApp.map((item) => (
{mobileAppImages.map((item) => (
<PortfolioCard
key={item.title}
hidden={item.hidden}
Expand Down
47 changes: 23 additions & 24 deletions src/helper/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ import epon2 from ".././assets/epon/epon2.png";
import epon3 from ".././assets/epon/epon3.png";
import epon4 from ".././assets/epon/epon4.png";

// import popbot1 from ".././assets/popbot/popbot1.png";
// import popbot2 from ".././assets/popbot/popbot2.png";

import instaride1 from ".././assets/instaride/instaride1.png";
import instaride2 from ".././assets/instaride/instaride2.png";
import instaride3 from ".././assets/instaride/instaride3.png";
Expand All @@ -94,13 +91,19 @@ import metamint2 from ".././assets/metamint/metamint2.webp";
import metamint3 from ".././assets/metamint/metamint3.webp";
import metamint4 from ".././assets/metamint/metamint4.webp";

export const arr = [
const resolveElementPosition = (imagesArray) => {
imagesArray.forEach((element, i) => {
element.position = i % 2 ? "right" : "left";
});
return imagesArray;
};

const desktopAppImagesData = [
{
imgSrc: [kt1, kt2, kt3, kt5, kt6],
hidden: false,
delay: "200",
classTitle: "kyro-tools",
position: "left",
title: "Kyro Tools",
techStack: ["ReactJS", "ElectronJS", "Docker", "Python", "NodeJS"],
},
Expand All @@ -109,7 +112,6 @@ export const arr = [
hidden: false,
delay: "300",
classTitle: "arc",
position: "right",
title: "Arc AIO",
techStack: ["ReactJS", "ElectronJS"],
},
Expand All @@ -118,7 +120,6 @@ export const arr = [
hidden: false,
delay: "200",
classTitle: "epon",
position: "left",
title: "Epon NFT",
techStack: ["ReactJS", "ElectronJS", "Python", "Docker"],
},
Expand All @@ -127,7 +128,6 @@ export const arr = [
hidden: false,
delay: "300",
classTitle: "metamint",
position: "right",
title: "Metamint",
techStack: ["ReactJS", "ElectronJS", "Python"],
},
Expand All @@ -136,7 +136,6 @@ export const arr = [
hidden: false,
delay: "300",
classTitle: "jupiter-toolbot",
position: "right",
title: "Jupiter Toolbot",
techStack: ["ReactJS", "ElectronJS", "NodeJS"],
},
Expand All @@ -145,7 +144,6 @@ export const arr = [
hidden: false,
delay: "300",
classTitle: "divine",
position: "right",
title: "Divine",
techStack: ["ReactJS", "ElectronJS", "NodeJs", "Socket.io"],
},
Expand All @@ -154,7 +152,6 @@ export const arr = [
hidden: false,
delay: "200",
classTitle: "hawa",
position: "left",
title: "Hawa",
techStack: ["ReactJS", "ElectronJS"],
},
Expand All @@ -163,7 +160,6 @@ export const arr = [
hidden: false,
delay: "300",
classTitle: "spacebot",
position: "right",
title: "Spacebot",
techStack: ["ReactJS"],
},
Expand All @@ -173,7 +169,6 @@ export const arr = [
hidden: false,
delay: "200",
classTitle: "genesis",
position: "left",
title: "Genesis",
techStack: ["Typescript", "ElectronJS"],
},
Expand All @@ -182,18 +177,16 @@ export const arr = [
hidden: false,
delay: "200",
classTitle: "pluto",
position: "left",
title: "Pluto",
techStack: ["ReactJS", "ElectronJS"],
},
];
export const arr2 = [
const desktopAppImagesData2 = [
{
imgSrc: [uc1, uc2, uc3, uc4, uc5, uc6, uc7, uc8],
hidden: false,
delay: "300",
classTitle: "uc-toolbot",
position: "right",
title: "UC Toolbot",
techStack: ["ReactJS", "ElectronJS", "NodeJS"],
},
Expand All @@ -202,7 +195,6 @@ export const arr2 = [
hidden: false,
delay: "200",
classTitle: "squared",
position: "left",
title: "Squared",
techStack: ["ReactJS", "ElectronJS"],
},
Expand All @@ -211,7 +203,6 @@ export const arr2 = [
hidden: false,
delay: "200",
classTitle: "aio-world",
position: "left",
title: "AIO World",
techStack: ["ReactJS"],
},
Expand All @@ -220,19 +211,17 @@ export const arr2 = [
hidden: false,
delay: "300",
classTitle: "argons",
position: "right",
title: "Argon",
techStack: ["ReactJS", "ElectronJS"],
},
];

export const mobileAppOne = [
const mobileAppImagesData = [
{
imgSrc: [instaride1, instaride2, instaride3, instaride4],
hidden: false,
delay: "300",
classTitle: "instaride",
position: "left",
title: "Instaride",
techStack: [
"React Native",
Expand All @@ -248,12 +237,22 @@ export const mobileAppOne = [
imgSrc: [wrencho1, wrencho2, wrencho3, wrencho4],
hidden: false,
delay: "300",
classTitle: "wrancho",
position: "right",
classTitle: "wrencho",
title: "Wrencho",
techStack: ["Flutter", "Node", "SOLR", "PostgreSQL", "AWS S3"],
isMobile: true,
},
];
const mobileAppImagesData2 = [];

resolveElementPosition(desktopAppImagesData);
resolveElementPosition(desktopAppImagesData2);
resolveElementPosition(mobileAppImagesData);
resolveElementPosition(mobileAppImagesData2);

export const mobileAppTwo = [];
export {
desktopAppImagesData,
desktopAppImagesData2,
mobileAppImagesData,
mobileAppImagesData2
}

0 comments on commit b8bcc7e

Please sign in to comment.