@@ -9,42 +9,53 @@ type Props = {
9
9
const imgBase = `/Source_Skyboxes_NextJS/skyboxes/${ slug } /images` ;
10
10
const details = `/${ slug } ` ;
11
11
12
+ const thumbnail = `${ imgBase } /thumbnail.webp` ;
13
+
12
14
//placeholder
13
15
const description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' ;
14
16
15
17
return (
16
18
< Link href = { details } >
17
19
< article
18
20
className = "
19
- flex flex-col items-center
20
- bg-neutral-800
21
- ring-1 ring-neutral-700/60
22
- shadow-lg shadow-black/40
23
- p-2
24
- m-0.5
25
- tranform hover:scale-105
26
- transition duration-150
27
-
28
- " >
29
- < div className = 'w-full text-center font-bold' >
30
- < h2 className = "text-lg font-semibold text-left" > { slug } </ h2 >
31
- </ div >
32
-
33
- < div className = "relative w-full aspect-[16/9] overflow-hidden m-2" >
34
- < Image
35
- src = { `${ imgBase } /thumbnail.webp` }
36
- alt = { `${ slug } preview` }
37
- fill
38
- sizes = "(min-width:1280px) 16rem,
39
- (min-width:1024px) 22vw,
40
- (min-width:640px) 45vw,
41
- 100vw"
42
- className = "object-cover"
43
- unoptimized
44
- />
45
- </ div >
46
- < div className = 'w-full h-auto' >
47
- < h3 className = "text-sm" > { description } </ h3 >
21
+ group
22
+ relative flex flex-col items-center
23
+ bg-neutral-800 ring-1 ring-neutral-700/60
24
+ shadow-lg shadow-black/40
25
+ transition duration-150 hover:scale-105
26
+ overflow-hidden
27
+ aspect-[16/9]
28
+ "
29
+ style = { {
30
+ backgroundImage : `url(${ thumbnail } )` ,
31
+ backgroundSize : 'cover' ,
32
+ backgroundPosition : 'center' ,
33
+ } }
34
+ >
35
+
36
+ { /* Visually hidden image for SEO/alt text */ }
37
+ < Image
38
+ src = { thumbnail }
39
+ alt = { `${ slug } preview` }
40
+ fill
41
+ className = "opacity-0"
42
+ unoptimized
43
+ />
44
+ < div
45
+ className = "
46
+ absolute inset-x-0 bottom-0
47
+ translate-y-full
48
+ group-hover:translate-y-0
49
+ group-hover:opacity-100
50
+ opacity-0
51
+ bg-black/60
52
+ px-3 py-2
53
+ transition duration-150
54
+ "
55
+ >
56
+ < h2 className = "text-sm font-semibold text-neutral-100 truncate" >
57
+ { slug }
58
+ </ h2 >
48
59
</ div >
49
60
</ article >
50
61
</ Link >
0 commit comments