1
+ import { ReactNode } from "react"
2
+
1
3
import { CalendarIcon } from "@/app/conf/_design-system/pixelarticons/calendar-icon"
2
4
import { PinIcon } from "@/app/conf/_design-system/pixelarticons/pin-icon"
3
5
@@ -6,12 +8,17 @@ import GraphQLFoundationWordmark from "../../assets/graphql-foundation-wordmark.
6
8
import { ImageLoaded } from "../image-loaded"
7
9
import blurBean from "./blur-bean-cropped.webp"
8
10
import clsx from "clsx"
11
+ import {
12
+ StripesDecoration ,
13
+ StripesDecorationProps ,
14
+ } from "@/app/conf/_design-system/stripes-decoration"
9
15
10
16
export type HeroProps = {
11
17
pageName ?: string
12
18
children : React . ReactNode
13
19
bottom ?: React . ReactNode
14
20
colorScheme ?: "primary" | "neutral"
21
+ stripes ?: ReactNode
15
22
} & (
16
23
| { year : string | number ; subtitle ?: never }
17
24
| { year ?: never ; subtitle : string }
@@ -23,19 +30,21 @@ export function Hero(props: HeroProps) {
23
30
return (
24
31
< article
25
32
className = { clsx (
26
- "gql-conf-navbar-strip relative isolate flex flex-col justify-center selection:bg-blk/40 before:bg-white/30 dark:bg-pri-darker dark:text-neu-900 dark:selection:bg-white/40 before:dark:bg-blk/40" ,
27
- colorScheme === "primary" ? "bg-pri-base text-neu-0" : "bg-neu-100" ,
33
+ "gql-conf-navbar-strip relative isolate flex flex-col justify-center selection:bg-blk/40 before:bg-white/30 before:dark:bg-blk/40" ,
34
+ colorScheme === "primary"
35
+ ? "bg-pri-base text-neu-0 dark:bg-pri-darker dark:text-neu-900 dark:selection:bg-white/40"
36
+ : "bg-neu-100 dark:bg-neu-50/25" ,
28
37
) }
29
38
>
30
39
< article className = "relative" >
31
- < HeroStripes />
40
+ { props . stripes || < HeroStripes /> }
32
41
< div className = "gql-conf-container mx-auto flex max-w-full flex-col gap-12 overflow-hidden p-4 pt-6 sm:p-8 sm:pt-12 md:gap-12 md:bg-left md:p-12 lg:px-24 lg:pb-16 lg:pt-24" >
33
42
< div className = "flex gap-10 max-md:flex-col md:justify-between" >
34
43
{ props . pageName ? (
35
44
< div >
36
45
< span
37
46
className = { clsx (
38
- "typography-h3" ,
47
+ "typography-body-lg lg:typography- h3" ,
39
48
colorScheme === "primary"
40
49
? "text-sec-base"
41
50
: "text-pri-base" ,
@@ -92,40 +101,31 @@ export function HeroDateAndLocation() {
92
101
)
93
102
}
94
103
95
- const maskEven =
96
- "repeating-linear-gradient(to right, transparent, transparent 12px, black 12px, black 24px)"
97
- const maskOdd =
98
- "repeating-linear-gradient(to right, black, black 12px, transparent 12px, transparent 24px)"
99
-
100
- export function HeroStripes ( ) {
104
+ export interface HeroStripesProps extends StripesDecorationProps {
105
+ className ?: string
106
+ }
107
+ export function HeroStripes ( { className, ...rest } : HeroStripesProps ) {
101
108
return (
102
109
< ImageLoaded
103
110
role = "presentation"
104
111
image = { blurBean }
105
- className = "pointer-events-none absolute inset-x-0 bottom-[-385px] top-[-203px] -z-10 translate-y-12 opacity-0 transition duration-[400ms] ease-linear [mask-size:100%_50%] data-[loaded=true]:translate-y-0 data-[loaded=true]:opacity-100 sm:[mask-size:125%] xl:[mask-size:100%]"
112
+ className = { clsx (
113
+ "pointer-events-none absolute inset-x-0 bottom-[-385px] top-[-203px] -z-10 translate-y-12 opacity-0 transition duration-[400ms] ease-linear [mask-size:100%_50%] data-[loaded=true]:translate-y-0 data-[loaded=true]:opacity-100 sm:[mask-size:125%] xl:[mask-size:100%]" ,
114
+ className ,
115
+ ) }
106
116
style = { {
107
117
maskImage : `url(${ blurBean . src } )` ,
108
118
WebkitMaskImage : `url(${ blurBean . src } )` ,
109
- // maskSize: "100%", // todo: (very low priority) need the newly exported full blur bean with rotation to match the mobile design 1-1
110
119
maskRepeat : "no-repeat" ,
111
120
WebkitMaskRepeat : "no-repeat" ,
112
121
maskPosition : "center" ,
113
122
WebkitMaskPosition : "center" ,
114
123
} }
115
124
>
116
- < div
117
- className = "absolute inset-0 bg-[linear-gradient(180deg,hsl(var(--color-pri-light))_0%,hsl(319deg_100%_90%_/_0.2)_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-pri-dark))_0%,hsl(319_100%_20%_/_1)_100%)]"
118
- style = { {
119
- maskImage : maskEven ,
120
- WebkitMaskImage : maskEven ,
121
- } }
122
- />
123
- < div
124
- className = "absolute inset-0 bg-[linear-gradient(180deg,hsl(319deg_100%_90%_/_0.2)_0%,hsl(var(--color-pri-base))_100%)] dark:bg-[linear-gradient(180deg,hsl(319_100%_30%_/_1)_0%,hsl(var(--color-pri-dark))_100%)]"
125
- style = { {
126
- maskImage : maskOdd ,
127
- WebkitMaskImage : maskOdd ,
128
- } }
125
+ < StripesDecoration
126
+ evenClassName = "bg-[linear-gradient(180deg,hsl(var(--color-pri-light))_0%,hsl(319deg_100%_90%_/_0.2)_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-pri-dark))_0%,hsl(319_100%_20%_/_1)_100%)]"
127
+ oddClassName = "bg-[linear-gradient(180deg,hsl(319deg_100%_90%_/_0.2)_0%,hsl(var(--color-pri-base))_100%)] dark:bg-[linear-gradient(180deg,hsl(319_100%_30%_/_1)_0%,hsl(var(--color-pri-dark))_100%)]"
128
+ { ...rest }
129
129
/>
130
130
</ ImageLoaded >
131
131
)
0 commit comments