@@ -3,11 +3,12 @@ import { glob } from "node:fs/promises"
33import { readFile } from "node:fs/promises"
44import matter from "gray-matter"
55
6- import { clsx } from "clsx"
76import { Button } from "@/app/conf/_design-system/button"
7+ import blurCorner from "./blur-corner.webp"
88import { Eyebrow } from "@/_design-system/eyebrow"
99import slugMap from "@/code/slug-map.json"
1010import { type Topic } from "@/resources/types"
11+ import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration"
1112
1213interface LibraryEntry {
1314 name : string
@@ -78,78 +79,93 @@ export async function CategoryToolsLibrariesSection({
7879 )
7980 . slice ( 0 , 20 ) ,
8081 } ) )
81- . sort ( ( a , b ) => a . name . localeCompare ( b . name , "en" , { sensitivity : "base" } ) )
82+ . sort ( ( a , b ) => b . items . length - a . items . length )
8283
8384 if ( grouped . length === 0 ) {
8485 return null
8586 }
8687
87- const desktopLayoutClass =
88- grouped . length > 2 ? "lg:grid lg:grid-cols-1 lg:gap-6" : "lg:grid lg:grid-cols-2 lg:gap-6"
89-
9088 return (
91- < section
92- id = "tools-and-libraries"
93- className = "flex flex-col gap-8 border border-sec-base bg-sec-lighter p-6 dark:border-sec-darker dark:bg-sec-darker/15 lg:gap-10 lg:p-10"
94- >
95- < div className = "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between" >
96- < div className = "flex flex-col gap-3" >
97- < Eyebrow className = "!text-sec-darker dark:!text-sec-light" >
98- key tools & libraries
99- </ Eyebrow >
100- < h2 className = "typography-h3 text-pretty" >
101- Build GraphQL with tools and libraries
102- </ h2 >
103- < p className = "typography-body-md text-neu-800" >
104- Explore language and platform tooling to ship production-ready
105- graphs.
106- </ p >
107- </ div >
108- < Button href = "/code" variant = "tertiary" className = "w-fit" >
109- See all Tools & Libraries
110- </ Button >
111- </ div >
112-
113- < div
114- className = { clsx (
115- "flex gap-4 overflow-x-auto pb-2 lg:overflow-visible" ,
116- desktopLayoutClass ,
117- ) }
89+ < div className = "relative bg-neu-100 dark:bg-neu-50/25" >
90+ < Stripes />
91+ < section
92+ id = "tools-and-libraries"
93+ className = "gql-container gql-section relative flex flex-col gap-8 overflow-hidden"
11894 >
119- { grouped . map ( group => (
120- < div
121- key = { group . id }
122- className = "min-w-[280px] shrink-0 border border-neu-200 bg-neu-0 shadow-[0_1px_0_#E5E7EB] dark:border-neu-100 dark:bg-neu-0/60 lg:min-w-0"
123- >
124- < div className = "flex items-center gap-3 border-b border-neu-200 px-4 py-3 text-neu-900 dark:border-neu-100" >
125- < span className = "font-mono text-sm uppercase text-neu-700" >
95+ < div className = "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between" >
96+ < div className = "flex flex-col gap-3" >
97+ < Eyebrow className = "!text-pri-base dark:!text-pri-light" >
98+ key tools & libraries
99+ </ Eyebrow >
100+ < h2 className = "typography-h3 text-pretty" >
101+ Build GraphQL with tools and libraries
102+ </ h2 >
103+ < p className = "typography-body-md text-neu-700 dark:text-neu-100" >
104+ Explore language and platform tooling to ship production-ready
105+ graphs.
106+ </ p >
107+ </ div >
108+ < Button href = "/code" variant = "primary" className = "w-fit" >
109+ See all Tools & Libraries
110+ </ Button >
111+ </ div >
112+
113+ < div className = "flex flex-wrap gap-4 pb-2 lg:overflow-visible" >
114+ { grouped . map ( group => (
115+ < div
116+ key = { group . id }
117+ className = "min-w-[480px] shrink-0 grow border border-neu-200 bg-neu-50 dark:bg-neu-50/50 lg:w-1/3 lg:min-w-0"
118+ >
119+ < div className = "typography-body-lg flex items-center gap-3 border-b border-inherit bg-neu-50 px-4 py-3 text-neu-900" >
120+ { /* todo: we should have an icon here */ }
126121 { group . name }
127- </ span >
128- </ div >
129- < ul className = "divide-y divide-neu-200 dark:divide-neu-100" >
130- { group . items . map ( item => (
131- < li key = { `${ group . id } -${ item . name } ` } >
132- { item . href ? (
133- < a
134- href = { item . href }
135- className = "flex items-center justify-between px-4 py-3 text-neu-900 transition-colors hover:bg-neu-50 dark:hover:bg-neu-50/50"
136- >
137- < span > { item . name } </ span >
138- < span aria-hidden className = "text-neu-500" >
139- →
122+ </ div >
123+ < ul className = "divide-y divide-neu-200 dark:divide-neu-100" >
124+ { group . items . map ( item => (
125+ < li key = { `${ group . id } -${ item . name } ` } >
126+ { item . href ? (
127+ < a
128+ href = { item . href }
129+ className = "flex items-center justify-between bg-neu-0/40 px-4 py-3 text-neu-900 transition-colors hover:bg-neu-0 hover:duration-0"
130+ >
131+ { item . name }
132+ </ a >
133+ ) : (
134+ < span className = "flex items-center justify-between bg-neu-50 px-4 py-3 text-neu-900" >
135+ { item . name }
140136 </ span >
141- </ a >
142- ) : (
143- < span className = "flex items-center justify-between px-4 py-3 text-neu-900" >
144- < span > { item . name } </ span >
145- </ span >
146- ) }
147- </ li >
148- ) ) }
149- </ ul >
150- </ div >
151- ) ) }
152- </ div >
153- </ section >
137+ ) }
138+ </ li >
139+ ) ) }
140+ </ ul >
141+ </ div >
142+ ) ) }
143+ </ div >
144+ </ section >
145+ </ div >
146+ )
147+ }
148+
149+ function Stripes ( ) {
150+ return (
151+ < div
152+ className = "pointer-events-none absolute inset-x-0 top-0 h-[542px]"
153+ style = { {
154+ maskImage : `url(${ blurCorner . src } )` ,
155+ WebkitMaskImage : `url(${ blurCorner . src } )` ,
156+ maskSize : "62% 62%" ,
157+ WebkitMaskSize : "62% 62%" ,
158+ maskPosition : "top right" ,
159+ WebkitMaskPosition : "top right" ,
160+ maskRepeat : "no-repeat" ,
161+ WebkitMaskRepeat : "no-repeat" ,
162+ } }
163+ >
164+ < StripesDecoration
165+ evenClassName = "bg-[linear-gradient(90deg,hsl(var(--color-pri-lighter))_0_12px,hsl(var(--color-pri-light))_12px_24px)] dark:bg-[linear-gradient(90deg,hsl(var(--color-sec-dark)/0.22)_0_12px,hsl(var(--color-sec-base)/0.22)_12px_24px)]"
166+ oddClassName = "bg-[linear-gradient(90deg,hsl(var(--color-pri-light))_0_12px,hsl(var(--color-pri-base)/0)_12px_24px)] dark:bg-[linear-gradient(90deg,hsl(var(--color-sec-base)/0.14)_0_12px,hsl(var(--color-sec-light)/0.14)_12px_24px)]"
167+ angle = "-90deg"
168+ />
169+ </ div >
154170 )
155171}
0 commit comments