"use client" import { useState, useEffect, useRef } from "react" import { Button } from "@/components/ui/button" import Link from "next/link" import { artists } from "@/data/artists" export function ArtistsSection() { const [visibleCards, setVisibleCards] = useState([]) const [scrollY, setScrollY] = useState(0) const sectionRef = useRef(null) const leftColumnRef = useRef(null) const centerColumnRef = useRef(null) const rightColumnRef = useRef(null) useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { const cardIndex = Number.parseInt(entry.target.getAttribute("data-index") || "0") setVisibleCards((prev) => [...new Set([...prev, cardIndex])]) } }) }, { threshold: 0.2, rootMargin: "0px 0px 0px 0px" }, ) const cards = sectionRef.current?.querySelectorAll("[data-index]") cards?.forEach((card) => observer.observe(card)) return () => observer.disconnect() }, []) useEffect(() => { let ticking = false const handleScroll = () => { if (!ticking) { requestAnimationFrame(() => { const scrollTop = window.pageYOffset setScrollY(scrollTop) ticking = false }) ticking = true } } window.addEventListener("scroll", handleScroll, { passive: true }) return () => window.removeEventListener("scroll", handleScroll) }, []) useEffect(() => { if (leftColumnRef.current && centerColumnRef.current && rightColumnRef.current) { const sectionTop = sectionRef.current?.offsetTop || 0 const relativeScroll = scrollY - sectionTop leftColumnRef.current.style.transform = `translateY(${relativeScroll * -0.025}px)` centerColumnRef.current.style.transform = `translateY(0px)` rightColumnRef.current.style.transform = `translateY(${relativeScroll * 0.025}px)` const leftImages = leftColumnRef.current.querySelectorAll(".artist-image") const centerImages = centerColumnRef.current.querySelectorAll(".artist-image") const rightImages = rightColumnRef.current.querySelectorAll(".artist-image") leftImages.forEach((img) => { ;(img as HTMLElement).style.transform = `translateY(${relativeScroll * -0.01}px)` }) centerImages.forEach((img) => { ;(img as HTMLElement).style.transform = `translateY(${relativeScroll * -0.0075}px)` }) rightImages.forEach((img) => { ;(img as HTMLElement).style.transform = `translateY(${relativeScroll * -0.005}px)` }) } }, [scrollY]) // Better distribution for visual balance const leftColumn = [artists[0], artists[3], artists[6]] // Christy, Donovan, John const centerColumn = [artists[1], artists[4], artists[7]] // Angel, EJ, Pako const rightColumn = [artists[2], artists[5], artists[8]] // Amari, Heather, Sole return (

ARTISTS

Our exceptional team of tattoo artists, each bringing unique expertise and artistic vision to create your perfect tattoo.

{leftColumn.map((artist, index) => (
{/* Portfolio background - full width */}
{`${artist.name} {/* Darkening overlay to push background further back */}
{/* Artist portrait - with proper feathered mask */}
{`${artist.name}
{artist.experience}

{artist.name}

{artist.specialty}

{artist.bio}

))}
{centerColumn.map((artist, index) => (
{/* Portfolio background - full width */}
{`${artist.name} {/* Darkening overlay to push background further back */}
{/* Artist portrait - with proper feathered mask */}
{`${artist.name}
{artist.experience}

{artist.name}

{artist.specialty}

{artist.bio}

))}
{rightColumn.map((artist, index) => (
{/* Portfolio background - full width */}
{`${artist.name} {/* Darkening overlay to push background further back */}
{/* Artist portrait - with proper feathered mask */}
{`${artist.name}
{artist.experience}

{artist.name}

{artist.specialty}

{artist.bio}

))}

READY?

Choose your artist and start your tattoo journey with United Tattoo.

) }