diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d39f298 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy React to Netlify + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Create .env file + run: | + echo "VITE_APP_EMAILJS_SERVICE_ID=${{ secrets.VITE_APP_EMAILJS_SERVICE_ID }}" >> .env + echo "VITE_APP_EMAILJS_TEMPLATE_ID=${{ secrets.VITE_APP_EMAILJS_TEMPLATE_ID }}" >> .env + echo "VITE_APP_EMAILJS_PUBLIC_KEY=${{ secrets.VITE_APP_EMAILJS_PUBLIC_KEY }}" >> .env + + - name: Install dependencies with legacy peer deps and force + run: npm install --legacy-peer-deps --force + + - name: Install Netlify CLI + run: npm install -g netlify-cli + + - name: Build React app + run: npm run build + + - name: Deploy to Netlify + run: netlify deploy --prod --dir=dist --site ${{ secrets.NETLIFY_SITE_ID }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} diff --git a/.gitignore b/.gitignore index a547bf3..83e1c00 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* - +.env node_modules dist dist-ssr diff --git a/src/components/Contact.jsx b/src/components/Contact.jsx index 16364e2..482018f 100644 --- a/src/components/Contact.jsx +++ b/src/components/Contact.jsx @@ -34,8 +34,8 @@ const Contact = () => { emailjs .send( - process.env.VITE_APP_EMAILJS_SERVICE_ID, - process.env.VITE_APP_EMAILJS_TEMPLATE_ID, + import.meta.env.VITE_APP_EMAILJS_SERVICE_ID, + import.meta.env.VITE_APP_EMAILJS_TEMPLATE_ID, { from_name: form.name, to_name: "Udoy Rahman", @@ -43,7 +43,7 @@ const Contact = () => { to_email: "udoyrahman983@gmail.com", message: form.message, }, - process.env.VITE_APP_EMAILJS_PUBLIC_KEY + import.meta.env.VITE_APP_EMAILJS_PUBLIC_KEY ) .then( () => { diff --git a/src/components/Works.jsx b/src/components/Works.jsx index ba072b4..949d759 100644 --- a/src/components/Works.jsx +++ b/src/components/Works.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import Tilt from "react-tilt"; import { motion } from "framer-motion"; @@ -8,6 +8,60 @@ import { SectionWrapper } from "../hoc"; import { projects } from "../constants"; import { fadeIn, textVariant } from "../utils/motion"; +const ProjectCardMobile = ({ + index, + name, + description, + tags, + image, + source_code_link, +}) => { + return ( +
+
+
+ project_image + +
+
window.open(source_code_link, "_blank")} + className='black-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer' + > + source code +
+
+
+ +
+

{name}

+

{description}

+
+ +
+ {tags.map((tag) => ( +

+ #{tag.name} +

+ ))} +
+
+
+ ); +}; + const ProjectCard = ({ index, name, @@ -68,14 +122,38 @@ const ProjectCard = ({ }; const Works = () => { + const [isMobile, setisMobile] = useState(false); + + useEffect(() => { + const mediaQuery = window.matchMedia('(max-width: 500px)'); + setisMobile(mediaQuery.matches); + + const handleMediaQueryChange = (event) => { + setisMobile(event.matches); + }; + + mediaQuery.addEventListener('change', handleMediaQueryChange); + + return () => { + mediaQuery.removeEventListener('change', handleMediaQueryChange); + }; + }, []); return ( <> + {!isMobile?

My work

Projects.

+ : +
+

My work

+

Projects.

+
+ }
+ {!isMobile? { ability to solve complex problems, work with different technologies, and manage projects effectively. + : +

+ Following projects showcases my skills and experience through + real-world examples of my work. Each project is briefly described with + links to code repositories and live demos in it. It reflects my + ability to solve complex problems, work with different technologies, + and manage projects effectively. +

+ + }
{projects.map((project, index) => ( - + !isMobile ? + + : + + ))}