diff --git a/frontend/src/app/(routes)/artists/[slug]/page.tsx b/frontend/src/app/(routes)/artists/[slug]/page.tsx index 33fc1d4..c21746b 100644 --- a/frontend/src/app/(routes)/artists/[slug]/page.tsx +++ b/frontend/src/app/(routes)/artists/[slug]/page.tsx @@ -4,7 +4,7 @@ import { Button, Chip } from "@nextui-org/react"; import { DEFAULT_IMAGE } from "@/config/constants"; import { getArtist, getTattoosByArtist } from "@/lib/api"; -import { Instagram, EmptyList, WhatsApp, ArtistGallery } from "@/components"; +import { Instagram, EmptyList, WhatsApp, TattooList } from "@/components"; import { IStyle } from "@/interfaces"; import Link from "next/link"; @@ -107,7 +107,7 @@ export default async function ArtistDetailPage({ params }: Props) {
{hasTattoos ? ( - + ) : ( )} diff --git a/frontend/src/components/artists/artist-card/ArtistCard.tsx b/frontend/src/components/artists/artist-card/ArtistCard.tsx deleted file mode 100644 index 237dfe4..0000000 --- a/frontend/src/components/artists/artist-card/ArtistCard.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export const ArtistCard = () => { - return
ArtistCard
; -}; diff --git a/frontend/src/components/artists/artist-gallery/ArtistGallery.tsx b/frontend/src/components/artists/artist-gallery/ArtistGallery.tsx deleted file mode 100644 index 72f74e5..0000000 --- a/frontend/src/components/artists/artist-gallery/ArtistGallery.tsx +++ /dev/null @@ -1,64 +0,0 @@ -"use client"; - -import { useEffect } from "react"; -import Image from "next/image"; -import { useInView } from "react-intersection-observer"; -import { motion, useAnimation } from "framer-motion"; -import { Chip } from "@nextui-org/react"; -import { ITattoo } from "@/interfaces"; - -interface Props { - tattoos: ITattoo[]; -} - -export const ArtistGallery = ({ tattoos }: Props) => { - const controls = useAnimation(); - const { ref, inView } = useInView({ - triggerOnce: true, - threshold: 0.1, - }); - - useEffect(() => { - if (inView) { - controls.start("visible"); - } - }, [inView, controls]); - - const itemVariants = { - hidden: { opacity: 0, x: 0 }, - visible: { opacity: 1, x: 0 }, - }; - return ( -
- {tattoos.map((tattoo, index) => ( - - {tattoo.name} - - {tattoo.name} - - - ))} -
- ); -}; diff --git a/frontend/src/components/company/tattoo-section/TattooList.tsx b/frontend/src/components/company/tattoo-section/TattooList.tsx new file mode 100644 index 0000000..25012b0 --- /dev/null +++ b/frontend/src/components/company/tattoo-section/TattooList.tsx @@ -0,0 +1,55 @@ +"use client"; + +import Image from "next/image"; +import { motion } from "framer-motion"; +import { useAnimateOnView } from "@/hooks"; +import { ITattoo } from "@/interfaces"; +import { Chip } from "@nextui-org/react"; + +interface Props { + tattoos: ITattoo[]; + className?: string; +} + +export const TattooList = ({ tattoos, className }: Props) => { + const { ref, controls, itemVariants } = useAnimateOnView(0.1, false); + + return ( +
+ {tattoos.map((tattoo, idx) => ( + +
+ {tattoo.name} +
+ + {tattoo.name} + +
+ ))} +
+ ); +}; diff --git a/frontend/src/components/company/tattoo-section/TattooSection.tsx b/frontend/src/components/company/tattoo-section/TattooSection.tsx index c9c440a..96a96f4 100644 --- a/frontend/src/components/company/tattoo-section/TattooSection.tsx +++ b/frontend/src/components/company/tattoo-section/TattooSection.tsx @@ -1,5 +1,4 @@ -import { TATTOO_EXAMPLE_OBJ } from "@/config/constants"; -import { HeaderSection, ParallaxScrollMain } from "@/components"; +import { HeaderSection, TattooList } from "@/components"; import { ITattoo } from "@/interfaces"; interface Props { @@ -8,9 +7,9 @@ interface Props { export const TattooSection = ({ tattoos }: Props) => { return ( -
+
- +
); }; diff --git a/frontend/src/components/index.ts b/frontend/src/components/index.ts index aac9924..b1a903b 100644 --- a/frontend/src/components/index.ts +++ b/frontend/src/components/index.ts @@ -2,10 +2,8 @@ export * from "./applicants/applicant-form/ApplicantForm"; // Artists -export * from "./artists/artist-card/ArtistCard"; export * from "./artists/artist-list/ArtistList"; export * from "./artists/artist-section/ArtistSection"; -export * from "./artists/artist-gallery/ArtistGallery"; // Bookings export * from "./bookings/booking-card/BookingCard"; @@ -22,6 +20,7 @@ export * from "./company/price-section/PriceSection"; export * from "./company/promotion-section/PromotionSection"; export * from "./company/service-section/ServiceSection"; export * from "./company/tattoo-section/TattooSection"; +export * from "./company/tattoo-section/TattooList"; // Products export * from "./products/product-counter/ProductCounter"; @@ -45,8 +44,6 @@ export * from "./ui/instagram/Instagram"; export * from "./ui/logo/Logo"; export * from "./ui/menubar/MenuBar"; export * from "./ui/pagination/PaginationItem"; -export * from "./ui/parallax-scroll/ParallaxScroll"; -export * from "./ui/parallax-scroll/ParallaxScrollMain"; export * from "./ui/twitch/Twitch"; export * from "./ui/whatsapp/WhatsApp"; export * from "./ui/whatsapp/WhatsAppButton"; diff --git a/frontend/src/components/ui/parallax-scroll/ParallaxScroll.tsx b/frontend/src/components/ui/parallax-scroll/ParallaxScroll.tsx deleted file mode 100644 index 4ae33d8..0000000 --- a/frontend/src/components/ui/parallax-scroll/ParallaxScroll.tsx +++ /dev/null @@ -1,108 +0,0 @@ -"use client"; - -import { useRef } from "react"; -import Image from "next/image"; -import { motion, useScroll, useTransform } from "framer-motion"; -import { ITattoo } from "@/interfaces"; - -interface Props { - tattoos: ITattoo[]; -} - -export const ParallaxScroll = ({ tattoos }: Props) => { - const gridRef = useRef(null); - const { scrollYProgress } = useScroll({ - container: gridRef, - offset: ["start start", "end start"], - }); - - const translateFirst = useTransform(scrollYProgress, [0, 1], [0, -200]); - const translateSecond = useTransform(scrollYProgress, [0, 1], [0, 200]); - const translateThird = useTransform(scrollYProgress, [0, 1], [0, -200]); - const translateFourth = useTransform(scrollYProgress, [0, 1], [0, 200]); - - const quarter = Math.ceil(tattoos.length / 4); - - const firstPart = tattoos.slice(0, quarter); - const secondPart = tattoos.slice(quarter, 2 * quarter); - const thirdPart = tattoos.slice(2 * quarter, 3 * quarter); - const fourthPart = tattoos.slice(3 * quarter); - - return ( -
-
-
- {firstPart.map((firstPart, idx) => ( - - {`${firstPart.name} - - ))} -
-
- {secondPart.map((secondPart, idx) => ( - - {`${secondPart.name} - - ))} -
-
- {thirdPart.map((thirdPart, idx) => ( - - {`${thirdPart.name} - - ))} -
-
- {fourthPart.map((fourthPart, idx) => ( - - {`${fourthPart.name} - - ))} -
-
-
- ); -}; diff --git a/frontend/src/components/ui/parallax-scroll/ParallaxScrollMain.tsx b/frontend/src/components/ui/parallax-scroll/ParallaxScrollMain.tsx deleted file mode 100644 index e2ee197..0000000 --- a/frontend/src/components/ui/parallax-scroll/ParallaxScrollMain.tsx +++ /dev/null @@ -1,133 +0,0 @@ -"use client"; - -import { useRef } from "react"; -import Image from "next/image"; -import { motion, useScroll, useTransform } from "framer-motion"; -import { cn } from "@/lib/utils"; -import { ITattoo } from "@/interfaces"; - -interface Props { - tattoos: ITattoo[]; -} - -export const ParallaxScrollMain = ({ tattoos }: Props) => { - const gridRef = useRef(null); - const { scrollYProgress } = useScroll({ - container: gridRef, // remove this if your container is not fixed height - offset: ["start start", "end start"], // remove this if your container is not fixed height - }); - - // Define transformations for each of the five sections - const translateFirst = useTransform(scrollYProgress, [0, 1], [0, -200]); - const translateSecond = useTransform(scrollYProgress, [0, 1], [0, 200]); - const translateThird = useTransform(scrollYProgress, [0, 1], [0, -200]); - const translateFourth = useTransform(scrollYProgress, [0, 1], [0, 200]); - const translateFifth = useTransform(scrollYProgress, [0, 1], [0, -200]); - - // Divide images into 5 equal parts - const partSize = Math.ceil(tattoos.length / 5); - - const firstPart = tattoos.slice(0, partSize); - const secondPart = tattoos.slice(partSize, 2 * partSize); - const thirdPart = tattoos.slice(2 * partSize, 3 * partSize); - const fourthPart = tattoos.slice(3 * partSize, 4 * partSize); - const fifthPart = tattoos.slice(4 * partSize); - - return ( -
-
-
- {firstPart.map((firstPart, idx) => ( - - {`${firstPart.name} - - ))} -
-
- {secondPart.map((secondPart, idx) => ( - - {`${secondPart.name} - - ))} -
-
- {thirdPart.map((thirdPart, idx) => ( - - {`${thirdPart.name} - - ))} -
-
- {fourthPart.map((fourthPart, idx) => ( - - {`${fourthPart.name} - - ))} -
-
- {fifthPart.map((fifthPart, idx) => ( - - {`${fifthPart.name} - - ))} -
-
-
- ); -}; diff --git a/frontend/src/config/constants.ts b/frontend/src/config/constants.ts index 1122874..5c3efb5 100644 --- a/frontend/src/config/constants.ts +++ b/frontend/src/config/constants.ts @@ -51,146 +51,3 @@ export const MENU_ITEMS = [ { id: 4, label: "Products", href: "/products" }, { id: 5, label: "Bookings", href: "/bookings" }, ]; - -export const TATTOO_EXAMPLE_OBJ = [ - { - id: 1, - name: "Tattoo Design 1", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 2, - name: "Tattoo Design 2", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 3, - name: "Tattoo Design 3", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 4, - name: "Tattoo Design 4", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 5, - name: "Tattoo Design 5", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 6, - name: "Tattoo Design 6", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 7, - name: "Tattoo Design 7", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 8, - name: "Tattoo Design 8", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 9, - name: "Tattoo Design 9", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 10, - name: "Tattoo Design 10", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 11, - name: "Tattoo Design 11", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 12, - name: "Tattoo Design 12", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 13, - name: "Tattoo Design 13", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 14, - name: "Tattoo Design 14", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 15, - name: "Tattoo Design 15", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 16, - name: "Tattoo Design 16", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 17, - name: "Tattoo Design 17", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 18, - name: "Tattoo Design 18", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, - { - id: 19, - name: "Tattoo Design 19", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560785/gwojsaglfb78ubmqgqzc.webp", - artist: "Artist Name 1", - }, - { - id: 20, - name: "Tattoo Design 20", - image: - "https://res.cloudinary.com/dwyvfa5dj/image/upload/v1725560726/qfmmxblvlctpjtkrg0km.jpg", - artist: "Artist Name 2", - }, -];