Skip to content

Commit 2747de2

Browse files
committed
feat: update accordion layout to 2:1 column ratio
- Change grid from 2 columns to 3 columns (lg:grid-cols-3) - Left column (description + code) now spans 2 columns (lg:col-span-2) = 2/3 width - Right column (live preview) spans 1 column (lg:col-span-1) = 1/3 width - Maintains responsive design with single column on mobile - Better space allocation for content-heavy left side vs visual preview This gives more space to the description and code content while keeping the live preview frame appropriately sized for the mobile frame display.
1 parent 91daf8e commit 2747de2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/ui/LivePreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const LivePreview = ({ title, children, className = '' }: LivePreviewProps) => {
1717
</h5>
1818
<div className="flex justify-center">
1919
{/* Mobile Frame with 9:16 ratio (vertical phone) */}
20-
<div className="w-[200px] bg-black rounded-[1.5rem] p-1 shadow-2xl">
21-
<div className="bg-muted/20 rounded-[1.25rem] h-[400px] flex items-center justify-center" style={{ aspectRatio: '9/16' }}>
20+
<div className="bg-black rounded-[1.5rem] p-1 shadow-2xl">
21+
<div className="rounded-[1.25rem] h-[400px] flex items-center justify-center" style={{ aspectRatio: '9/18' }}>
2222
{children ? (
2323
<div className="w-full h-full flex items-center justify-center">
2424
{children}

src/components/ui/PatternAccordion.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ const PatternAccordion = ({ patterns, className = '' }: PatternAccordionProps) =
6666
className="overflow-hidden"
6767
>
6868
<div className="px-4 pb-4">
69-
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
69+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
7070
{/* Left Column - Description, Tags, and Code */}
71-
<div className="space-y-4">
71+
<div className="space-y-4 lg:col-span-2">
7272
{/* Description */}
7373
<div className="space-y-3">
7474
<h5 className="text-sm font-medium text-white">
@@ -101,7 +101,9 @@ const PatternAccordion = ({ patterns, className = '' }: PatternAccordionProps) =
101101
</div>
102102

103103
{/* Right Column - Live Preview */}
104-
<LivePreview title={pattern.title} />
104+
<div className="lg:col-span-1">
105+
<LivePreview title={pattern.title} />
106+
</div>
105107
</div>
106108
</div>
107109
</motion.div>

0 commit comments

Comments
 (0)