Skip to content

Commit 48352a0

Browse files
committed
Add UseCases
1 parent 56c8268 commit 48352a0

File tree

2 files changed

+20
-34
lines changed

2 files changed

+20
-34
lines changed
Lines changed: 1 addition & 1 deletion
Loading

src/components/index-page/use-cases/index.tsx

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { useState } from "react"
55

66
import { Button } from "@/app/conf/_design-system/button"
77
import ArrowRightIcon from "./arrow-right.svg?svgr"
8+
import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration"
9+
10+
import blurBean from "./blur-bean.webp"
811

912
type UseCase = {
1013
label: string
@@ -64,36 +67,36 @@ export function UseCases({
6467
{...props}
6568
>
6669
<div className="mx-auto flex max-w-[1440px] *:basis-1/2 max-lg:flex-col 3xl:min-h-[800px]">
67-
<div className="relative flex flex-col border-sec-dark bg-sec-light p-4 lg:border-r lg:p-8 xl:p-16">
70+
<div className="relative flex flex-col bg-sec-light p-4 dark:bg-neu-50 dark:text-neu-900 lg:p-8 xl:p-16">
6871
<h2 className="typography-h2">Is GraphQL right for&nbsp;me?</h2>
69-
<p className="typography-body-lg mt-6 text-neu-800">
72+
<p className="typography-body-lg mt-6 text-balance text-neu-800">
7073
Choose a use case most relevant for your project and learn how
7174
GraphQL can help you build faster, modern solutions.
7275
</p>
7376

7477
<div className="3xl:flex-1" />
75-
<ul className="mt-8 divide-y divide-sec-dark border border-sec-dark">
78+
<ul className="mt-8 divide-y divide-sec-dark border border-sec-dark lg:mt-16">
7679
{USE_CASES.map((useCase, i) => (
7780
<li key={useCase.label}>
7881
<button
7982
type="button"
8083
onClick={() => setSelectedIndex(i)}
8184
aria-selected={i === selectedIndex ? "true" : undefined}
82-
className="flex w-full items-center justify-between gap-6 px-3 py-4 text-left transition-colors hover:bg-sec-lighter aria-selected:bg-sec-base aria-selected:hover:bg-sec-lighter"
85+
className="group flex w-full items-center justify-between gap-6 px-3 py-4 text-left transition-colors hover:bg-sec-lighter aria-selected:bg-sec-base aria-selected:hover:bg-sec-lighter hover:dark:bg-neu-100/25 dark:aria-selected:bg-sec-darker"
8386
>
8487
<span className="typography-body-lg">{useCase.label}</span>
85-
<ArrowRightIcon className="size-10 shrink-0 text-sec-dark opacity-0 group-aria-selected:opacity-100" />
88+
<ArrowRightIcon className="size-10 shrink-0 text-sec-dark opacity-0 transition-opacity group-hover:opacity-100 group-aria-selected:opacity-100 dark:text-neu-900" />
8689
</button>
8790
</li>
8891
))}
8992
</ul>
9093
<div className="3xl:flex-1" />
9194
</div>
9295

93-
<article className="relative flex h-auto flex-col bg-sec-base p-8 md:p-12 lg:p-16">
96+
<article className="relative flex h-auto flex-col bg-sec-base p-8 dark:bg-sec-darker md:p-12 lg:p-16">
9497
<Stripes />
9598
<div className="z-10 my-auto max-h-[528px] max-w-2xl">
96-
<h3 className="typography-body-lg text-sec-darker">
99+
<h3 className="typography-body-lg text-sec-darker dark:text-sec-lighter">
97100
{selected.label}
98101
</h3>
99102
<p className="typography-h3 mt-10 text-neu-800">
@@ -112,41 +115,24 @@ export function UseCases({
112115
)
113116
}
114117

115-
const maskEven =
116-
"repeating-linear-gradient(to right, transparent, transparent 12px, black 12px, black 24px)"
117-
const maskOdd =
118-
"repeating-linear-gradient(to right, black, black 12px, transparent 12px, transparent 24px)"
119-
120118
function Stripes() {
121-
const mask = "linear-gradient(125deg, transparent 68%, hsl(0 0 0 / 0.8))"
119+
const mask = `url(${blurBean.src})`
122120
return (
123121
<div
124122
role="presentation"
125-
className="pointer-events-none absolute inset-0 bottom-[-20px] -z-10 translate-x-0.5 translate-y-12 ease-linear max-lg:hidden"
123+
className="pointer-events-none absolute inset-0"
126124
style={{
127125
maskImage: mask,
128126
WebkitMaskImage: mask,
127+
maskPosition: "bottom 150% right 50%",
128+
WebkitMaskPosition: "bottom 150% right 50%",
129+
maskRepeat: "no-repeat",
130+
WebkitMaskRepeat: "no-repeat",
129131
}}
130132
>
131-
<div
132-
className="absolute inset-0"
133-
style={{
134-
maskImage: maskOdd,
135-
WebkitMaskImage: maskOdd,
136-
maskPosition: "right",
137-
backgroundImage:
138-
"linear-gradient(0deg, hsl(var(--color-sec-lighter)) 0%, rgba(133, 185, 19, 0.00) 100%)",
139-
}}
140-
/>
141-
<div
142-
className="absolute inset-0"
143-
style={{
144-
maskImage: maskEven,
145-
WebkitMaskImage: maskEven,
146-
maskPosition: "right",
147-
backgroundImage:
148-
"linear-gradient(0deg, hsl(var(--color-sec-dark)) 0%, hsl(var(--color-sec-base)) 100%)",
149-
}}
133+
<StripesDecoration
134+
evenClassName="bg-[linear-gradient(0deg,_hsl(var(--color-sec-dark))_0%,_hsl(var(--color-sec-base))_100%)] dark:bg-[linear-gradient(0deg,_hsl(var(--color-sec-dark))_0%,_hsl(var(--color-sec-darker))_100%)]"
135+
oddClassName="bg-[linear-gradient(0deg,_hsl(var(--color-sec-lighter))_0%,_hsl(79_81%_40%/0)_100%)] dark:bg-[linear-gradient(0deg,_hsl(var(--color-neu-dark))_0%,_rgba(133,185,19,0.00)_100%)]"
150136
/>
151137
</div>
152138
)

0 commit comments

Comments
 (0)