Skip to content

Commit a762d38

Browse files
committed
Make the stripes green and fix dark mode
1 parent 6549aee commit a762d38

File tree

2 files changed

+35
-28
lines changed

2 files changed

+35
-28
lines changed

src/app/conf/2025/code-of-conduct/page.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { Button } from "@/app/conf/_design-system/button"
77

88
import { NavbarPlaceholder } from "../components/navbar"
99
import "../resources/prose.css"
10+
import { Hero, HeroStripes } from "../components/hero"
1011

1112
import markdown from "./code-of-conduct.mdx?raw"
12-
import { Hero } from "../components/hero"
1313

1414
export const metadata: Metadata = {
1515
title: "Code of Conduct | GraphQLConf 2025",
@@ -18,11 +18,18 @@ export const metadata: Metadata = {
1818
export default function ResourcesPage() {
1919
return (
2020
<>
21-
<NavbarPlaceholder className="top-0 bg-neu-100 before:bg-white/30 dark:bg-neu-0 dark:before:bg-blk/40" />
21+
<NavbarPlaceholder className="top-0 bg-neu-100 before:bg-white/30 dark:bg-[#181A12] dark:before:bg-blk/40" />
2222
<Hero
2323
pageName="Code of conduct"
2424
subtitle="The Linux Foundation"
2525
colorScheme="neutral"
26+
stripes={
27+
<HeroStripes
28+
className="-scale-x-100 dark:data-[loaded=true]:opacity-80"
29+
evenClassName="bg-[linear-gradient(180deg,hsl(var(--color-sec-light))_0%,hsl(319deg_100%_90%_/_0.2)_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-sec-dark))_0%,hsl(var(--color-neu-100))_100%)]"
30+
oddClassName="bg-[linear-gradient(180deg,hsl(319deg_100%_90%_/_0.2)_0%,hsl(var(--color-sec-base))_100%)] dark:bg-[linear-gradient(180deg,hsl(var(--color-sec-dark))_0%,hsl(var(--color-neu-0))_100%)]"
31+
/>
32+
}
2633
>
2734
<Button
2835
href="https://events.linuxfoundation.org/about/code-of-conduct/"
@@ -56,7 +63,7 @@ export default function ResourcesPage() {
5663
{...props}
5764
className={clsx(
5865
props.className,
59-
"gql-prose-inner -mx-4 w-fit border border-neu-300 bg-neu-50 p-4 xl:my-4",
66+
"gql-prose-inner -mx-4 w-fit border border-neu-300 bg-neu-50 p-4 dark:border-neu-100 dark:bg-neu-50/50 xl:my-4",
6067
)}
6168
/>
6269
)

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ReactNode } from "react"
2+
13
import { CalendarIcon } from "@/app/conf/_design-system/pixelarticons/calendar-icon"
24
import { PinIcon } from "@/app/conf/_design-system/pixelarticons/pin-icon"
35

@@ -6,12 +8,17 @@ import GraphQLFoundationWordmark from "../../assets/graphql-foundation-wordmark.
68
import { ImageLoaded } from "../image-loaded"
79
import blurBean from "./blur-bean-cropped.webp"
810
import clsx from "clsx"
11+
import {
12+
StripesDecoration,
13+
StripesDecorationProps,
14+
} from "@/app/conf/_design-system/stripes-decoration"
915

1016
export type HeroProps = {
1117
pageName?: string
1218
children: React.ReactNode
1319
bottom?: React.ReactNode
1420
colorScheme?: "primary" | "neutral"
21+
stripes?: ReactNode
1522
} & (
1623
| { year: string | number; subtitle?: never }
1724
| { year?: never; subtitle: string }
@@ -23,19 +30,21 @@ export function Hero(props: HeroProps) {
2330
return (
2431
<article
2532
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",
2837
)}
2938
>
3039
<article className="relative">
31-
<HeroStripes />
40+
{props.stripes || <HeroStripes />}
3241
<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">
3342
<div className="flex gap-10 max-md:flex-col md:justify-between">
3443
{props.pageName ? (
3544
<div>
3645
<span
3746
className={clsx(
38-
"typography-h3",
47+
"typography-body-lg lg:typography-h3",
3948
colorScheme === "primary"
4049
? "text-sec-base"
4150
: "text-pri-base",
@@ -92,40 +101,31 @@ export function HeroDateAndLocation() {
92101
)
93102
}
94103

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) {
101108
return (
102109
<ImageLoaded
103110
role="presentation"
104111
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+
)}
106116
style={{
107117
maskImage: `url(${blurBean.src})`,
108118
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
110119
maskRepeat: "no-repeat",
111120
WebkitMaskRepeat: "no-repeat",
112121
maskPosition: "center",
113122
WebkitMaskPosition: "center",
114123
}}
115124
>
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}
129129
/>
130130
</ImageLoaded>
131131
)

0 commit comments

Comments
 (0)