Skip to content

Commit aba3b54

Browse files
committed
Redo the Hero stripes in CSS
1 parent 484003a commit aba3b54

File tree

4 files changed

+71
-15
lines changed

4 files changed

+71
-15
lines changed
Binary file not shown.
Loading

src/app/conf/2025/components/hero/index.tsx

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,25 @@ import { CalendarIcon } from "../../pixelarticons/calendar-icon"
44
import { PinIcon } from "../../pixelarticons/pin-icon"
55
import { GET_TICKETS_LINK } from "../../links"
66
import { Button } from "../../../_design-system/button"
7-
import linesPng from "./lines.png"
87
import graphqlFoundationWordmarkSvg from "../../assets/graphql-foundation-wordmark.svg"
8+
import heroPhoto from "./hero-photo.jpeg"
9+
import blurBean from "./blur-bean-cropped.webp"
10+
11+
// - the background is made of even and odd stripes every 12px and a mask
12+
// - i can have two divs with repeating background image and a mask
913

1014
export function Hero() {
1115
return (
12-
<section className="bg-pri-base dark:bg-pri-darker text-neu-0 dark:text-neu-900 isolate flex flex-col justify-center">
13-
<div className="relative flex flex-col gap-12 p-4 pt-6 md:gap-12 md:bg-left md:px-24 xl:pb-16 xl:pt-24">
14-
<div
15-
className="pointer-events-none absolute inset-0 max-md:rotate-180 md:bg-left"
16-
style={{
17-
// todo: consider recreating this in CSS, so we can animate
18-
backgroundImage: `url(http://github.com/%3Cspan%20class=pl-s1%3E%3Cspan%20class=pl-kos%3E$%7B%3C/span%3E%3Cspan%20class=pl-s1%3ElinesPng%3C/span%3E%3Cspan%20class=pl-kos%3E.%3C/span%3E%3Cspan%20class=pl-c1%3Esrc%3C/span%3E%3Cspan%20class=pl-kos%3E%7D%3C/span%3E%3C/span%3E)`,
19-
backgroundSize: "cover",
20-
}}
21-
/>
22-
<div className="z-10 flex gap-10 max-md:flex-col md:justify-between">
23-
<h1 className="typography-d1 flex flex-wrap gap-2">
16+
<section className="isolate flex flex-col justify-center bg-pri-base text-neu-0 dark:bg-pri-darker dark:text-neu-900">
17+
<div className="relative mx-auto flex w-[90rem] max-w-full flex-col gap-12 overflow-hidden p-4 pt-6 md:gap-12 md:bg-left md:px-24 xl:pb-16 xl:pt-24">
18+
<Stripes />
19+
<div className="flex gap-10 max-md:flex-col md:justify-between">
20+
<h1 className="flex flex-wrap gap-2 typography-d1">
2421
<span>GraphQLConf</span>
2522
<span className="text-sec-base">2025</span>
2623
</h1>
2724
<div className="flex h-min items-center gap-4">
28-
<span className="typography-body-sm whitespace-pre">hosted by</span>
25+
<span className="whitespace-pre typography-body-sm">hosted by</span>
2926
<img
3027
src={graphqlFoundationWordmarkSvg.src}
3128
alt="GraphQL Foundation"
@@ -42,6 +39,15 @@ export function Hero() {
4239
</Button>
4340
</div>
4441
</div>
42+
<div className="bg-[#000]">
43+
<Image
44+
src={heroPhoto}
45+
width={1920}
46+
height={560}
47+
alt="five speakers at GraphQLConf 2024"
48+
className="mx-auto h-[560px] w-[1920px] max-w-full object-cover"
49+
/>
50+
</div>
4551
</section>
4652
)
4753
}
@@ -57,10 +63,60 @@ function DateAndLocation() {
5763
</div>
5864
<div className="flex items-center gap-2">
5965
<PinIcon className="size-6" />
60-
<address className="typography-body-md not-italic">
66+
<address className="not-italic typography-body-md">
6167
Amsterdam, Netherlands
6268
</address>
6369
</div>
6470
</div>
6571
)
6672
}
73+
74+
function Stripes() {
75+
const maskEven =
76+
"repeating-linear-gradient(to right, transparent, transparent 12px, black 12px, black 24px)"
77+
const maskOdd =
78+
"repeating-linear-gradient(to right, black, black 12px, transparent 12px, transparent 24px)"
79+
80+
// TODO: dark mode:
81+
// background: linear-gradient(180deg, var(--Primary-Dark, #990069) 0%, #660046 100%);
82+
// ^ the same one as with base
83+
// background: linear-gradient(180deg, #990069 0%, var(--Primary-Dark, #990069) 100%);
84+
// ^ the same one as with light
85+
86+
return (
87+
<div
88+
role="presentation"
89+
className="pointer-events-none absolute inset-x-0 bottom-[-385px] top-[-203px] -z-10"
90+
// todo: animate opacity up after the image is loaded
91+
style={{
92+
maskImage: `url(http://github.com/%3Cspan%20class=pl-s1%3E%3Cspan%20class=pl-kos%3E$%7B%3C/span%3E%3Cspan%20class=pl-s1%3EblurBean%3C/span%3E%3Cspan%20class=pl-kos%3E.%3C/span%3E%3Cspan%20class=pl-c1%3Esrc%3C/span%3E%3Cspan%20class=pl-kos%3E%7D%3C/span%3E%3C/span%3E)`,
93+
WebkitMaskImage: `url(http://github.com/%3Cspan%20class=pl-s1%3E%3Cspan%20class=pl-kos%3E$%7B%3C/span%3E%3Cspan%20class=pl-s1%3EblurBean%3C/span%3E%3Cspan%20class=pl-kos%3E.%3C/span%3E%3Cspan%20class=pl-c1%3Esrc%3C/span%3E%3Cspan%20class=pl-kos%3E%7D%3C/span%3E%3C/span%3E)`,
94+
maskSize: "100%",
95+
WebkitMaskSize: "100%",
96+
maskRepeat: "no-repeat",
97+
WebkitMaskRepeat: "no-repeat",
98+
maskPosition: "center",
99+
WebkitMaskPosition: "center",
100+
}}
101+
>
102+
<div
103+
className="absolute inset-0"
104+
style={{
105+
background:
106+
"linear-gradient(180deg, hsl(var(--color-pri-light)) 0%, hsl(319deg, 100%, 90%, 0.4) 100%)",
107+
maskImage: maskEven,
108+
WebkitMaskImage: maskEven,
109+
}}
110+
/>
111+
<div
112+
className="absolute inset-0"
113+
style={{
114+
background:
115+
"linear-gradient(180deg, hsl(319deg, 100%, 90%, 0.2) 0%, hsl(var(--color-pri-base)) 100%)",
116+
maskImage: maskOdd,
117+
WebkitMaskImage: maskOdd,
118+
}}
119+
/>
120+
</div>
121+
)
122+
}
-566 KB
Binary file not shown.

0 commit comments

Comments
 (0)