@@ -56,45 +56,36 @@ export default function Carousel({ projects }: Props) {
5656 const t = useTranslations ( )
5757
5858 return (
59- < div className = "bg-vector-grey flex flex-col justify-evenly lg:pt-10 lg: gap-y-10 set-header-screen" >
59+ < div className = "bg-vector-grey flex flex-col justify-evenly lg:gap-y-10 set-header-screen" >
6060 < h1 className = "text-2xl! font-bold text-center" > { t ( 'NavBar.projects' ) } </ h1 >
61- < div id = "carousel" className = "hidden grow lg:block" >
62- < div
63- className = "glide__track h-full bg-vector-grey relative flex flex-col"
64- data-glide-el = "track"
65- >
66- < ol className = " glide__slides grow flex items-center justify-center" >
61+ < div id = "carousel" className = "hidden lg:block" >
62+ < div className = "glide__track h-fit bg-vector-grey relative" data-glide-el = "track" >
63+ < ol className = " glide__slides h-fit! flex items-center justify-center" >
6764 { projects . map ( ( { id, name, thumbnail } , i ) => {
6865 thumbnail = thumbnail as Media
6966
7067 if ( ! thumbnail ?. url ) return 'Imagen no configurada'
7168
7269 return (
73- < li className = "glide__slide flex justify-center items-center" key = { id } >
70+ < li className = "glide__slide h-fit! flex justify-center items-center" key = { id } >
7471 < Link
7572 href = { `/projects/${ id } ` }
7673 className = "size-fit flex-col items-start transition-transform hover:scale-110 hover:cursor-pointer flex"
7774 >
78- < figure >
79- < div
80- className = "h-100 relative"
81- style = { { aspectRatio : '2/3' , maxHeight : '45svh' } }
82- >
83- < Image
84- src = { thumbnail . url ! }
85- alt = { thumbnail . alt ! }
86- fill
87- sizes = "33vw"
88- className = "object-cover"
89- />
90- </ div >
91- < figcaption >
92- < p
93- className = "font-Nexa my-5 text-xs font-extralight"
94- style = { { letterSpacing : '0.1rem' } }
95- >
96- { i + 1 } . { name }
97- </ p >
75+ < figure
76+ className = "h-100 relative overflow-hidden"
77+ style = { { aspectRatio : '0.705' } }
78+ >
79+ < Image
80+ src = { thumbnail . url ! }
81+ alt = { thumbnail . alt ! }
82+ fill
83+ sizes = "33vw"
84+ className = "object-cover blur-[2px]"
85+ />
86+ < div className = "img-overlay" > </ div >
87+ < figcaption className = "font-Nexa uppercase text-center text-sm w-4/5 absolute z-20 top-1/2 left-1/2 bg-vector-black/70 -translate-1/2 border-1 border-vector-cream/30 p-2" >
88+ { i + 1 } . { name }
9889 </ figcaption >
9990 </ figure >
10091 </ Link >
@@ -104,7 +95,7 @@ export default function Carousel({ projects }: Props) {
10495 </ ol >
10596 < div
10697 data-glide-el = "controls"
107- className = "pointer-events-none flex items-center justify-end gap-x-5 px-20 text-xl"
98+ className = "pointer-events-none flex items-center justify-end gap-x-5 px-20 text-xl mt-5 "
10899 >
109100 < button
110101 data-glide-dir = "<"
@@ -127,10 +118,13 @@ export default function Carousel({ projects }: Props) {
127118 </ div >
128119 </ div >
129120 </ div >
130- < div id = "carousel-mobile" className = "lg:hidden flex flex-col justify-center bg-vector-grey" >
121+ < div
122+ id = "carousel-mobile"
123+ className = "lg:hidden flex flex-col gap-y-5 justify-center bg-vector-grey"
124+ >
131125 < div className = "glide__track bg-vector-grey" data-glide-el = "track" >
132126 < ol className = " glide__slides" >
133- { projects . map ( ( { id, name, thumbnail } ) => {
127+ { projects . map ( ( { id, name, thumbnail } , i ) => {
134128 thumbnail = thumbnail as Media
135129
136130 if ( ! thumbnail ?. url ) return 'Sin miniatura seleccionada'
@@ -141,25 +135,26 @@ export default function Carousel({ projects }: Props) {
141135 href = { `/projects/${ id } ` }
142136 className = "mx-auto w-fit flex-col items-start transition-transform hover:scale-110 hover:cursor-pointer flex"
143137 >
144- < figure >
145- < div className = "h-100 relative" style = { { aspectRatio : '3/5' } } >
146- < Image
147- src = { thumbnail . url ! }
148- alt = { thumbnail . alt ! }
149- fill
150- sizes = "80vw"
151- className = "object-cover"
152- placeholder = "blur"
153- blurDataURL = { thumbnail . sizes ! . loading ! . url ! }
154- style = { {
155- objectPosition : `${ thumbnail . focalX } % ${ thumbnail . focalY } %` ,
156- } }
157- />
158- </ div >
159- < figcaption >
160- < p className = "font-Nexa my-5" style = { { letterSpacing : '0.1rem' } } >
161- { name }
162- </ p >
138+ < figure
139+ className = "h-100 relative overflow-hidden"
140+ style = { { aspectRatio : '0.705' } }
141+ >
142+ < Image
143+ src = { thumbnail . url ! }
144+ alt = { thumbnail . alt ! }
145+ fill
146+ sizes = "80vw"
147+ className = "object-cover zoom"
148+ placeholder = "blur"
149+ priority = { i === projectIndex }
150+ blurDataURL = { thumbnail . sizes ! . loading ! . url ! }
151+ style = { {
152+ objectPosition : `${ thumbnail . focalX } % ${ thumbnail . focalY } %` ,
153+ } }
154+ />
155+ < div className = "img-overlay" > </ div >
156+ < figcaption className = "font-Nexa uppercase font-bold text-center text-sm w-4/5 absolute z-20 top-1/2 left-1/2 bg-vector-black/40 -translate-1/2 border-1 border-vector-cream/30 p-2" >
157+ { i + 1 } . { name }
163158 </ figcaption >
164159 </ figure >
165160 </ Link >
0 commit comments