Skip to content

Commit 7d3d7fd

Browse files
committed
refactor(landing): visual rework
1 parent b5ad6ce commit 7d3d7fd

11 files changed

Lines changed: 2095 additions & 756 deletions

landing/bun.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

landing/components/code-example-panel.tsx

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ interface CodeExamplePanelProps {
1818
supportingText?: string
1919
}
2020

21+
const colors = {
22+
cream: '#FAF7F2',
23+
creamDark: '#F0EBE3',
24+
ink: '#1a1816',
25+
inkLight: '#3d3835',
26+
inkMuted: '#6b6460',
27+
coral: '#E85D4C',
28+
sage: '#7D9F8E'
29+
}
30+
2131
export default function CodeExamplePanel({
2232
title = 'Example Code',
2333
defaultOpen = false,
@@ -33,13 +43,11 @@ export default function CodeExamplePanel({
3343

3444
const activeCode = tabs.find((tab) => tab.value === activeTab)?.code || ''
3545

36-
// Handle when content refs update
3746
const updateTabHeight = (
3847
tabValue: string,
3948
element: HTMLDivElement | null
4049
) => {
4150
if (element) {
42-
// Small delay to ensure content has fully rendered
4351
setTimeout(() => {
4452
const height = element.scrollHeight
4553
setTabHeights((prev) => ({
@@ -50,7 +58,6 @@ export default function CodeExamplePanel({
5058
}
5159
}
5260

53-
// Update heights when tab changes or content loads
5461
useEffect(() => {
5562
const currentRef = contentRefs.current[activeTab]
5663
if (currentRef && highlighterLoadedRef.current[activeTab]) {
@@ -67,43 +74,89 @@ export default function CodeExamplePanel({
6774
return (
6875
<div className="w-full">
6976
<Collapsible.Root open onOpenChange={setOpen} className="w-full">
70-
<Collapsible.Trigger className="flex w-full items-center justify-between p-3 rounded-t-lg bg-zinc-900/80 hover:bg-zinc-900 border border-zinc-800/80 transition-colors">
77+
<Collapsible.Trigger
78+
className="flex w-full items-center justify-between p-3 rounded-t-sm transition-colors"
79+
style={{
80+
backgroundColor: colors.ink,
81+
border: `1px solid ${colors.ink}`
82+
}}
83+
>
7184
<div className="flex items-center gap-2">
72-
<Code className="h-4 w-4 text-zinc-400" />
73-
<span className="text-sm font-medium text-zinc-300">{title}</span>
85+
<Code
86+
className="h-4 w-4"
87+
style={{ color: 'rgba(255,255,255,0.6)' }}
88+
/>
89+
<span
90+
className="text-sm font-medium"
91+
style={{ color: 'rgba(255,255,255,0.9)' }}
92+
>
93+
{title}
94+
</span>
7495
</div>
7596
<div
7697
className={`transition-transform duration-200 ${open ? 'rotate-90' : ''}`}
7798
>
78-
<ChevronRight className="h-4 w-4 text-zinc-400" />
99+
<ChevronRight
100+
className="h-4 w-4"
101+
style={{ color: 'rgba(255,255,255,0.6)' }}
102+
/>
79103
</div>
80104
</Collapsible.Trigger>
81105

82106
<Collapsible.Content className="overflow-hidden data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up">
83-
<div className="border-x border-b border-zinc-800/80 rounded-b-lg overflow-hidden">
107+
<div
108+
className="rounded-b-sm overflow-hidden"
109+
style={{ border: `1px solid ${colors.ink}25`, borderTop: 'none' }}
110+
>
84111
<Tabs.Root value={activeTab} onValueChange={setActiveTab}>
85-
<Tabs.List className="flex border-b border-zinc-800/80 bg-black/20">
112+
<Tabs.List
113+
className="flex"
114+
style={{
115+
borderBottom: `1px solid ${colors.ink}20`,
116+
backgroundColor: `${colors.inkLight}40`
117+
}}
118+
>
86119
{tabs.map((tab) => (
87120
<Tabs.Trigger
88121
key={tab.value}
89122
value={tab.value}
90-
className="px-4 py-2 text-sm transition-colors data-[state=active]:text-violet-400 data-[state=active]:border-b-2 data-[state=active]:border-violet-500 data-[state=active]:-mb-px text-zinc-500 hover:text-zinc-400 font-medium"
123+
className="px-4 py-2 text-sm transition-colors font-medium data-[state=active]:-mb-px"
124+
style={{
125+
color:
126+
activeTab === tab.value
127+
? colors.coral
128+
: colors.inkMuted,
129+
borderBottom:
130+
activeTab === tab.value
131+
? `2px solid ${colors.coral}`
132+
: 'none'
133+
}}
91134
>
92135
{tab.label}
93136
</Tabs.Trigger>
94137
))}
95138
</Tabs.List>
96139

97-
<div className="relative bg-black/30">
140+
<div className="relative" style={{ backgroundColor: colors.ink }}>
98141
<button
99142
onClick={handleCopy}
100-
className="absolute top-3 right-3 text-xs flex items-center gap-1.5 text-zinc-500 px-2.5 py-1 rounded-md bg-zinc-800/80 hover:bg-zinc-800 hover:text-zinc-300 transition-colors border border-zinc-700/50 z-10"
143+
className="absolute top-3 right-3 text-xs flex items-center gap-1.5 px-2.5 py-1 rounded-sm transition-colors z-10"
144+
style={{
145+
color: 'rgba(255,255,255,0.4)',
146+
backgroundColor: 'rgba(255,255,255,0.05)',
147+
border: '1px solid rgba(255,255,255,0.1)'
148+
}}
101149
aria-label="Copy code to clipboard"
102150
>
103151
{copied ? (
104152
<span className="flex items-center gap-1.5">
105-
<Check className="h-3 w-3 text-emerald-400" />
106-
<span>Copied</span>
153+
<Check
154+
className="h-3 w-3"
155+
style={{ color: colors.sage }}
156+
/>
157+
<span style={{ color: 'rgba(255,255,255,0.7)' }}>
158+
Copied
159+
</span>
107160
</span>
108161
) : (
109162
<span className="flex items-center gap-1.5">
@@ -132,7 +185,6 @@ export default function CodeExamplePanel({
132185
load={() =>
133186
import('../components/shiki-highlighter').then(
134187
(m) => {
135-
// Mark this highlighter as loaded
136188
highlighterLoadedRef.current[tab.value] = true
137189
return m.default
138190
}
@@ -141,12 +193,12 @@ export default function CodeExamplePanel({
141193
fallback={
142194
<div className="flex items-start p-5">
143195
<div className="w-full animate-pulse">
144-
{/* Generate lines based on code length */}
145196
{tab.code.split('\n').map((_, i) => (
146197
<div
147198
key={i}
148-
className="h-[21px] bg-zinc-800/50 rounded mb-1.5"
199+
className="h-[21px] rounded mb-1.5"
149200
style={{
201+
backgroundColor: 'rgba(255,255,255,0.1)',
150202
width: `${Math.min(100, 30 + Math.random() * 70)}%`
151203
}}
152204
></div>
@@ -170,7 +222,14 @@ export default function CodeExamplePanel({
170222
</Tabs.Root>
171223

172224
{supportingText && (
173-
<div className="p-3 text-xs text-zinc-400 border-t border-zinc-800/50 bg-black/20">
225+
<div
226+
className="p-3 text-xs"
227+
style={{
228+
color: colors.inkMuted,
229+
borderTop: `1px solid ${colors.ink}15`,
230+
backgroundColor: colors.creamDark
231+
}}
232+
>
174233
{supportingText}
175234
</div>
176235
)}

landing/components/component-showcase-dialog.tsx

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ interface ComponentShowcaseDialogProps {
1919
docsLink?: string
2020
}
2121

22+
const colors = {
23+
cream: '#FAF7F2',
24+
creamDark: '#F0EBE3',
25+
ink: '#1a1816',
26+
inkMuted: '#6b6460',
27+
coral: '#E85D4C'
28+
}
29+
2230
export default function ComponentShowcaseDialog({
2331
title,
2432
description,
@@ -33,20 +41,45 @@ export default function ComponentShowcaseDialog({
3341
<Dialog.Root open={open} onOpenChange={setOpen}>
3442
<Dialog.Trigger asChild>
3543
{trigger || (
36-
<button className="inline-flex items-center gap-2 bg-zinc-900/60 hover:bg-zinc-900/80 border border-zinc-800/80 px-3 py-2 rounded-md text-sm text-zinc-300 transition-colors focus:outline-none focus:ring-2 focus:ring-violet-500/40">
44+
<button
45+
className="inline-flex items-center gap-2 px-3 py-2 rounded-sm text-sm transition-colors"
46+
style={{
47+
backgroundColor: colors.creamDark,
48+
color: colors.ink,
49+
border: `1px solid ${colors.ink}15`
50+
}}
51+
>
3752
<Maximize2 className="h-4 w-4" />
3853
<span>View demo & code</span>
3954
</button>
4055
)}
4156
</Dialog.Trigger>
4257

4358
<Dialog.Portal>
44-
<Dialog.Overlay className="bg-black/60 backdrop-blur-sm fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
59+
<Dialog.Overlay
60+
className="fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
61+
style={{
62+
backgroundColor: 'rgba(26,24,22,0.6)',
63+
backdropFilter: 'blur(4px)'
64+
}}
65+
/>
4566

46-
<Dialog.Content className="fixed left-[50%] top-[50%] z-50 grid w-[90vw] max-w-5xl max-h-[85vh] translate-x-[-50%] translate-y-[-50%] gap-6 bg-zinc-950 shadow-lg shadow-black/10 border border-zinc-800/80 rounded-xl p-1 overflow-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]">
67+
<Dialog.Content
68+
className="fixed left-[50%] top-[50%] z-50 grid w-[90vw] max-w-5xl max-h-[85vh] translate-x-[-50%] translate-y-[-50%] gap-6 shadow-lg rounded-sm p-1 overflow-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
69+
style={{
70+
backgroundColor: colors.cream,
71+
border: `1px solid ${colors.ink}15`
72+
}}
73+
>
4774
<div className="flex flex-col max-h-[85vh]">
48-
<div className="flex items-center justify-between px-5 py-4 border-b border-zinc-800/80">
49-
<Dialog.Title className="text-lg font-medium text-white">
75+
<div
76+
className="flex items-center justify-between px-5 py-4"
77+
style={{ borderBottom: `1px solid ${colors.ink}15` }}
78+
>
79+
<Dialog.Title
80+
className="text-lg font-serif"
81+
style={{ color: colors.ink }}
82+
>
5083
{title}
5184
</Dialog.Title>
5285

@@ -56,15 +89,17 @@ export default function ComponentShowcaseDialog({
5689
href={docsLink}
5790
target="_blank"
5891
rel="noopener noreferrer"
59-
className="inline-flex items-center gap-1.5 text-zinc-400 hover:text-white text-sm transition-colors"
92+
className="inline-flex items-center gap-1.5 text-sm transition-colors hover:opacity-80"
93+
style={{ color: colors.inkMuted }}
6094
>
6195
<span>Docs</span>
6296
<ExternalLink className="h-3.5 w-3.5" />
6397
</a>
6498
)}
6599
<Dialog.Close asChild>
66100
<button
67-
className="inline-flex h-8 w-8 items-center justify-center rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors focus:outline-none focus:ring-2 focus:ring-violet-500/40"
101+
className="inline-flex h-8 w-8 items-center justify-center rounded-sm transition-colors hover:opacity-80"
102+
style={{ color: colors.inkMuted }}
68103
aria-label="Close"
69104
>
70105
<X className="h-4 w-4" />
@@ -75,13 +110,25 @@ export default function ComponentShowcaseDialog({
75110

76111
<div className="flex-1 overflow-y-auto">
77112
{description && (
78-
<div className="px-6 py-4 text-zinc-400 text-sm border-b border-zinc-800/80">
113+
<div
114+
className="px-6 py-4 text-sm"
115+
style={{
116+
color: colors.inkMuted,
117+
borderBottom: `1px solid ${colors.ink}15`
118+
}}
119+
>
79120
{description}
80121
</div>
81122
)}
82123

83124
<div className="p-6 flex flex-col">
84-
<div className="bg-black/30 p-8 border border-zinc-800/80 rounded-lg mb-6 flex justify-center">
125+
<div
126+
className="p-8 rounded-sm mb-6 flex justify-center"
127+
style={{
128+
backgroundColor: colors.ink,
129+
border: `1px solid ${colors.ink}25`
130+
}}
131+
>
85132
<div className="w-full max-w-md">
86133
<DemoComponent />
87134
</div>

0 commit comments

Comments
 (0)