File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
components/index-page/hero Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,9 @@ const _cache = new Map<string, HTMLImageElement>()
7
7
8
8
export interface ImageLoadedProps extends React . HTMLAttributes < HTMLDivElement > {
9
9
image : string | StaticImageData
10
- fetchPriority ?: "high" | "low" | "auto"
11
10
}
12
11
13
- export function ImageLoaded ( {
14
- image,
15
- fetchPriority = "auto" ,
16
- ...rest
17
- } : ImageLoadedProps ) {
12
+ export function ImageLoaded ( { image, ...rest } : ImageLoadedProps ) {
18
13
const [ loaded , setLoaded ] = useState ( false )
19
14
const src = typeof image === "string" ? image : image . src
20
15
@@ -32,11 +27,10 @@ export function ImageLoaded({
32
27
} else {
33
28
img = new Image ( )
34
29
img . src = src
35
- img . fetchPriority = fetchPriority
36
30
img . addEventListener ( "load" , ( ) => setLoaded ( true ) )
37
31
_cache . set ( src , img )
38
32
}
39
- } , [ src , fetchPriority ] )
33
+ } , [ src ] )
40
34
41
35
return < div data-loaded = { alreadyLoaded || loaded } { ...rest } />
42
36
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Button } from "@/app/conf/_design-system/button"
4
4
import { ImageLoaded } from "@/app/conf/2025/components/image-loaded"
5
5
6
6
import logoBlurred from "./logo-blurred.webp"
7
+ import Head from "next/head"
7
8
8
9
export function Hero ( ) {
9
10
return (
@@ -42,9 +43,17 @@ export function Hero() {
42
43
function HeroStripes ( ) {
43
44
return (
44
45
< div className = "pointer-events-none relative overflow-hidden max-lg:h-[210px]" >
46
+ < Head >
47
+ < link
48
+ rel = "preload"
49
+ as = "image"
50
+ href = { logoBlurred . src }
51
+ type = "image/webp"
52
+ fetchPriority = "high"
53
+ />
54
+ </ Head >
45
55
< ImageLoaded
46
56
image = { logoBlurred }
47
- fetchPriority = "high"
48
57
className = "relative h-full bg-gradient-to-b from-pri-base to-pri-lighter opacity-0 transition-opacity duration-[1.5s] [mask-position:center_12%] [mask-size:110%] data-[loaded=true]:opacity-100 dark:to-pri-base sm:[mask-size:auto_300%] lg:[mask-position:7%_7%] lg:[mask-size:200%]"
49
58
style = { {
50
59
maskImage : `url(${ logoBlurred . src } )` ,
You can’t perform that action at this time.
0 commit comments