1+ import { useState } from "react" ;
2+
3+ import firstpic from "../assets/artwork/viomgrealsigned.png" ;
4+ import anotherpic from "../assets/artwork/Viandvanderdrawinined.png" ;
5+ import thirdpic from "../assets/artwork/morevibabysigned.png" ;
6+ import fourthpic from "../assets/artwork/istheretime.png" ;
7+ import fifthpic from "../assets/artwork/kitchenorange.0004.png" ;
8+ import sixthpic from "../assets/artwork/playbillcovermeangirls_final.png" ;
9+
10+
11+
112export default function ArtPortfolio ( ) {
2- return < div className = "p-8 text-white" > Art portfolio content goes here.</ div > ;
3- }
4-
13+ const images = [ firstpic , anotherpic , thirdpic , fourthpic , fifthpic , sixthpic ] ;
14+ const [ selectedIndex , setSelectedIndex ] = useState ( null ) ;
15+
16+ const handleNext = ( e ) => {
17+ e . stopPropagation ( ) ;
18+ setSelectedIndex ( ( prev ) => ( prev + 1 ) % images . length ) ;
19+ } ;
20+
21+ const handlePrev = ( e ) => {
22+ e . stopPropagation ( ) ;
23+ setSelectedIndex ( ( prev ) => ( prev - 1 + images . length ) % images . length ) ;
24+ } ;
25+
26+
27+ return (
28+ < main className = "min-h-screen bg-black text-white flex flex-col items-center py-20" >
29+ < h1 className = "font-[Playfair Display] font-bold text-center leading-tight mb-12 text-[5rem] sm:text-[7rem] md:text-[10rem]" >
30+ My Work
31+ </ h1 >
32+
33+ < section className = "w-full max-w-6xl grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8 px-8" >
34+ { images . map ( ( src , i ) => (
35+ < div key = { i } className = "flex justify-center" >
36+ < img
37+ src = { src }
38+ alt = { `art-${ i } ` }
39+ className = "rounded-lg shadow-lg object-cover w-full h-[350px] cursor-pointer transition-transform duration-300 hover:scale-105"
40+ onClick = { ( ) => setSelectedIndex ( i ) }
41+ />
42+ </ div >
43+ ) ) }
44+ </ section >
45+
46+ < p className = "text-white text-center mt-16 text-md" >
47+ I have created these items both in my free time and as a part of various groups.
48+ </ p >
49+ < p className = "text-white text-center mt-16 text-md" >
50+ Updated frequently!
51+ </ p >
52+ { selectedIndex !== null && (
53+ < div
54+ className = "fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50"
55+ onClick = { ( ) => setSelectedIndex ( null ) }
56+ >
57+ < img
58+ src = { images [ selectedIndex ] }
59+ alt = "enlarged"
60+ className = "max-h-[90vh] max-w-[90vw] object-contain lg shadow-2xl"
61+ />
62+
63+ < button
64+ onClick = { handlePrev }
65+ className = "absolute left-8 text-white text-5xl font-bold hover:text-purple-400 select-none"
66+ >
67+ ‹
68+ </ button >
69+ < button
70+ onClick = { handleNext }
71+ className = "absolute right-8 text-white text-5xl font-bold hover:text-purple-400 select-none"
72+ >
73+ ›
74+ </ button >
75+
76+ < button
77+ onClick = { ( e ) => {
78+ e . stopPropagation ( ) ;
79+ setSelectedIndex ( null ) ;
80+ } }
81+ className = "absolute top-6 right-8 text-white text-4xl font-bold hover:text-purple-400"
82+ >
83+ ×
84+ </ button >
85+ </ div >
86+ ) }
87+
88+ </ main >
89+ ) ;
90+ }
0 commit comments