From df6594ad48907daf6b09141e06a1704b4333521c Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Sat, 27 May 2023 23:55:39 +0600 Subject: [PATCH 1/9] adding dynamic margin as props --- pages/contact.js | 2 +- pages/index.js | 6 +-- pages/products/[productId].js | 96 ++++++++++++++++++----------------- pages/products/index.js | 18 ++++--- pages/products/men.js | 17 ++++--- pages/products/women.js | 17 ++++--- 6 files changed, 83 insertions(+), 73 deletions(-) diff --git a/pages/contact.js b/pages/contact.js index e627fb7..2308e59 100644 --- a/pages/contact.js +++ b/pages/contact.js @@ -47,7 +47,7 @@ const ContactPage = () => { }; return ( -
+

Contact Us

diff --git a/pages/index.js b/pages/index.js index 324d2fe..d77c020 100644 --- a/pages/index.js +++ b/pages/index.js @@ -19,10 +19,10 @@ const HomePage = ({ products }) => {
- + - - + +
); diff --git a/pages/products/[productId].js b/pages/products/[productId].js index 8c99a55..9bfcc43 100644 --- a/pages/products/[productId].js +++ b/pages/products/[productId].js @@ -20,55 +20,57 @@ const ProductDetails = ({ product }) => { const dispatch = useDispatch(); return ( -
- product.imageUrl} - src={product.imageUrl} - width={500} - height={500} - alt={product.title} - className="w-full h-full object-cover" - /> +
+
+ product.imageUrl} + src={product.imageUrl} + width={500} + height={500} + alt={product.title} + className="w-full h-full object-cover" + /> -
- - {product.category} - -

{product.title}

-
-

- {formatCurrency(product.price * quantity)} -

-
- - - {quantity} - - +
+ + {product.category} + +

{product.title}

+
+

+ {formatCurrency(product.price * quantity)} +

+
+ + + {quantity} + + +
+
+ dispatch(addToCart({ ...product, quantity }))} + href="/cart" + className="bg-cyan-500 text-center py-3 text-white text-xl font-medium hover:bg-cyan-600 duration-300 mt-5" + > + Add to Cart + +
+

Description:

+

{product.description}

-
- dispatch(addToCart({ ...product, quantity }))} - href="/cart" - className="bg-cyan-500 text-center py-3 text-white text-xl font-medium hover:bg-cyan-600 duration-300 mt-5" - > - Add to Cart - -
-

Description:

-

{product.description}

diff --git a/pages/products/index.js b/pages/products/index.js index 94ee3bb..0830173 100644 --- a/pages/products/index.js +++ b/pages/products/index.js @@ -1,15 +1,17 @@ import ProductItem from "@/components/ProductItem"; import { getAllProducts } from "@/prisma/products"; -const ProductsPage = ({ products }) => { +const ProductsPage = ({ products, isAddedInHomepage }) => { + const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
-

Browse all products

- -
- {products.map((product) => ( - - ))} +
+
+

Browse all products

+
+ {products.map((product) => ( + + ))} +
); diff --git a/pages/products/men.js b/pages/products/men.js index d6f1dcc..990c706 100644 --- a/pages/products/men.js +++ b/pages/products/men.js @@ -1,15 +1,18 @@ import ProductItem from "@/components/ProductItem"; import { getAllProducts } from "@/prisma/products"; -const MenProductsPage = ({ products }) => { +const MenProductsPage = ({ products, isAddedInHomepage }) => { + const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
-

Browse all mens wear

+
+
+

Browse all mens wear

-
- {products.map((product) => ( - - ))} +
+ {products.map((product) => ( + + ))} +
); diff --git a/pages/products/women.js b/pages/products/women.js index 9aa5123..23356cf 100644 --- a/pages/products/women.js +++ b/pages/products/women.js @@ -1,15 +1,18 @@ import ProductItem from "@/components/ProductItem"; import { getAllProducts } from "@/prisma/products"; -const WomenProductsPage = ({ products }) => { +const WomenProductsPage = ({ products, isAddedInHomepage }) => { + const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
-

Browse all womens wear

+
+
+

Browse all womens wear

-
- {products.map((product) => ( - - ))} +
+ {products.map((product) => ( + + ))} +
); From e9870eab109eb29cdccd9bda76d601e30acd2887 Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Sun, 28 May 2023 00:13:27 +0600 Subject: [PATCH 2/9] restricting horizontal overflow --- components/Categories.jsx | 2 +- components/Countdown.jsx | 2 +- components/Gallery.jsx | 2 +- pages/products/index.js | 2 +- pages/products/men.js | 2 +- pages/products/women.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/Categories.jsx b/components/Categories.jsx index 245974f..01858f6 100644 --- a/components/Categories.jsx +++ b/components/Categories.jsx @@ -2,7 +2,7 @@ import Link from "next/link"; const Category = () => { return ( -
+

Categories

diff --git a/components/Countdown.jsx b/components/Countdown.jsx index a576acf..5930ee0 100644 --- a/components/Countdown.jsx +++ b/components/Countdown.jsx @@ -28,7 +28,7 @@ const CountdownTimer = ({ endDate }) => { }, [endDate]); return ( -
+

April Sale Ends in

{expired ? ( diff --git a/components/Gallery.jsx b/components/Gallery.jsx index b207a0b..aee12fa 100644 --- a/components/Gallery.jsx +++ b/components/Gallery.jsx @@ -57,7 +57,7 @@ const data = [ const Gallery = () => { return ( -
+
{`LET'S SEE`} GALLERY OF THE EUPHORIA diff --git a/pages/products/index.js b/pages/products/index.js index 0830173..78d740e 100644 --- a/pages/products/index.js +++ b/pages/products/index.js @@ -4,7 +4,7 @@ import { getAllProducts } from "@/prisma/products"; const ProductsPage = ({ products, isAddedInHomepage }) => { const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
+

Browse all products

diff --git a/pages/products/men.js b/pages/products/men.js index 990c706..fb8d28a 100644 --- a/pages/products/men.js +++ b/pages/products/men.js @@ -4,7 +4,7 @@ import { getAllProducts } from "@/prisma/products"; const MenProductsPage = ({ products, isAddedInHomepage }) => { const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
+

Browse all mens wear

diff --git a/pages/products/women.js b/pages/products/women.js index 23356cf..31bf7e4 100644 --- a/pages/products/women.js +++ b/pages/products/women.js @@ -4,7 +4,7 @@ import { getAllProducts } from "@/prisma/products"; const WomenProductsPage = ({ products, isAddedInHomepage }) => { const marginClass = `${isAddedInHomepage ? "mt-20" : "mt-40"}`; return ( -
+

Browse all womens wear

From 39732d9b6c5bbfa0719160ab3a69b732b10e8a52 Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Mon, 29 May 2023 00:29:42 +0600 Subject: [PATCH 3/9] added parallex in about background --- package-lock.json | 10 ++++++++++ package.json | 1 + pages/about.js | 30 ++++++++++++------------------ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index cced9a6..8313633 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.8.0", + "react-parallax": "^3.5.1", "react-redux": "^8.0.5", "react-responsive-carousel": "^3.2.23", "react-toastify": "^9.1.2", @@ -3630,6 +3631,15 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-parallax": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/react-parallax/-/react-parallax-3.5.1.tgz", + "integrity": "sha512-p5zPsPsqELlIOGaPS01O0IRx8R2bxcBAtrdF/RHf9nIxxk5hijbM2y89tk4rJQBcNH6ESSLe7J2NV4/ms7FLFw==", + "peerDependencies": { + "react": "16.x.x || 17.x.x || 18.x.x", + "react-dom": "16.x.x || 17.x.x || 18.x.x" + } + }, "node_modules/react-redux": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", diff --git a/package.json b/package.json index a0eaf75..c8d379e 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.8.0", + "react-parallax": "^3.5.1", "react-redux": "^8.0.5", "react-responsive-carousel": "^3.2.23", "react-toastify": "^9.1.2", diff --git a/pages/about.js b/pages/about.js index 97b2d28..173b091 100644 --- a/pages/about.js +++ b/pages/about.js @@ -1,6 +1,7 @@ import { ImageAbout } from "@/components/ImageAbout"; import LogoItemForAbout from "@/components/LogoItemForAbout"; import Image from "next/image"; +import { Parallax } from "react-parallax"; const AboutPage = () => { const logos = [ @@ -39,24 +40,17 @@ const AboutPage = () => { return (
- - "https://images.pexels.com/photos/242829/pexels-photo-242829.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" - } - src={ - "https://images.pexels.com/photos/242829/pexels-photo-242829.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" - } - width={50} - height={25} - alt={"Man Riding on Motorcycle"} - className="w-full h-[48rem] object-cover brightness-50" - /> - -

- About Euphoria -

+ +
+

+ About Euphoria +

+
+
From 5426f16a543fdfe415bc03e4924e57bafe496d4d Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Mon, 29 May 2023 13:09:52 +0600 Subject: [PATCH 4/9] slider animation added --- components/Slide.jsx | 22 ++++++++++++++++++++-- package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/components/Slide.jsx b/components/Slide.jsx index a0a5d61..2587138 100644 --- a/components/Slide.jsx +++ b/components/Slide.jsx @@ -1,16 +1,34 @@ import Link from "next/link"; +import AOS from "aos"; +import "aos/dist/aos.css"; +import { useEffect } from "react"; const Slide = ({ image }) => { + useEffect(() => { + AOS.init(); + }, []); + return (
-

+

{image.headline}

-

+

{image.body}

diff --git a/package-lock.json b/package-lock.json index 8313633..de3e68c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@prisma/client": "^4.12.0", "@reduxjs/toolkit": "^1.9.3", "@stripe/stripe-js": "^1.52.1", + "aos": "^2.3.4", "axios": "^1.4.0", "date-fns": "^2.30.0", "eslint": "8.37.0", @@ -631,6 +632,16 @@ "node": ">= 8" } }, + "node_modules/aos": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/aos/-/aos-2.3.4.tgz", + "integrity": "sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==", + "dependencies": { + "classlist-polyfill": "^1.0.3", + "lodash.debounce": "^4.0.6", + "lodash.throttle": "^4.0.1" + } + }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -997,6 +1008,11 @@ "node": ">= 6" } }, + "node_modules/classlist-polyfill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz", + "integrity": "sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ==" + }, "node_modules/classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", @@ -2778,11 +2794,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", diff --git a/package.json b/package.json index c8d379e..29b7938 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@prisma/client": "^4.12.0", "@reduxjs/toolkit": "^1.9.3", "@stripe/stripe-js": "^1.52.1", + "aos": "^2.3.4", "axios": "^1.4.0", "date-fns": "^2.30.0", "eslint": "8.37.0", From 9ef73a32509c1aafde26217a9b86a40868c45182 Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Mon, 29 May 2023 13:25:33 +0600 Subject: [PATCH 5/9] animation added in footer --- components/Footer.jsx | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/components/Footer.jsx b/components/Footer.jsx index 1b60c74..bd7f3e1 100644 --- a/components/Footer.jsx +++ b/components/Footer.jsx @@ -1,10 +1,13 @@ import Link from "next/link"; +import { useEffect } from "react"; import { FaFacebookF, FaLinkedinIn, FaInstagram, FaTwitter, } from "react-icons/fa"; +import AOS from "aos"; +import "aos/dist/aos.css"; const Footer = () => { return ( @@ -12,13 +15,21 @@ const Footer = () => {
euphoria.
-
+

{`Don't forget to follow us`}

@@ -35,7 +46,12 @@ const Footer = () => {
-
+

Useful Links

@@ -67,7 +83,12 @@ const Footer = () => {
-
+

Need more informations?

@@ -78,7 +99,12 @@ const Footer = () => {
-

+

© {new Date().getFullYear()} Euphoria. All rights reserved.

From 72fc4a0f3394d65ff9ad81a5630b1e3c13ed9070 Mon Sep 17 00:00:00 2001 From: abirtasrif Date: Mon, 29 May 2023 13:28:42 +0600 Subject: [PATCH 6/9] fine tuning footer animation --- components/Footer.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Footer.jsx b/components/Footer.jsx index bd7f3e1..b8bca7e 100644 --- a/components/Footer.jsx +++ b/components/Footer.jsx @@ -10,6 +10,10 @@ import AOS from "aos"; import "aos/dist/aos.css"; const Footer = () => { + useEffect(() => { + AOS.init(); + }, []); + return (