|
| 1 | +import { Navbar } from '@/components/navbar' |
| 2 | +import { generateOgImageUrl } from '@/lib/og-image' |
| 3 | +import { css } from '@/styled-system/css' |
| 4 | +import { Container, Grid, HStack, panda, Stack } from '@/styled-system/jsx' |
| 5 | +import { FooterSection } from '@/www/footer.section' |
| 6 | +import type { Metadata } from 'next' |
| 7 | +import Image from 'next/image' |
| 8 | +import Link from 'next/link' |
| 9 | +import { showcases } from '@/showcase' |
| 10 | + |
| 11 | +const ogTitle = 'See projects built with Panda CSS' |
| 12 | +const ogDescription = |
| 13 | + 'Explore the projects and applications built using Panda CSS' |
| 14 | + |
| 15 | +export const metadata: Metadata = { |
| 16 | + title: 'Showcase', |
| 17 | + description: |
| 18 | + 'Panda CSS is a powerful tool for building modern web applications.', |
| 19 | + openGraph: { |
| 20 | + title: ogTitle, |
| 21 | + description: ogDescription, |
| 22 | + type: 'website', |
| 23 | + images: [ |
| 24 | + generateOgImageUrl({ |
| 25 | + title: ogTitle, |
| 26 | + description: ogDescription, |
| 27 | + category: 'Showcase' |
| 28 | + }) |
| 29 | + ] |
| 30 | + }, |
| 31 | + twitter: { |
| 32 | + card: 'summary_large_image', |
| 33 | + title: ogTitle, |
| 34 | + description: ogDescription, |
| 35 | + images: [ |
| 36 | + generateOgImageUrl({ |
| 37 | + title: ogTitle, |
| 38 | + description: ogDescription, |
| 39 | + category: 'Showcase' |
| 40 | + }) |
| 41 | + ] |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +interface Showcase { |
| 46 | + name: string |
| 47 | + description: string |
| 48 | + url: string |
| 49 | + image: string |
| 50 | +} |
| 51 | + |
| 52 | +const cardStyles = css({ |
| 53 | + borderWidth: '1px', |
| 54 | + borderRadius: 'md', |
| 55 | + display: 'flex', |
| 56 | + flexDirection: 'column', |
| 57 | + overflow: 'hidden', |
| 58 | + transition: 'transform 0.2s', |
| 59 | + _hover: { |
| 60 | + transform: 'translateY(-4px)', |
| 61 | + shadow: 'lg' |
| 62 | + } |
| 63 | +}) |
| 64 | + |
| 65 | +const ShowcaseCard = ({ data }: { data: Showcase }) => { |
| 66 | + const { name, description, url, image } = data |
| 67 | + |
| 68 | + return ( |
| 69 | + <Link |
| 70 | + href={url} |
| 71 | + target="_blank" |
| 72 | + rel="noopener noreferrer" |
| 73 | + className={cardStyles} |
| 74 | + > |
| 75 | + <Image |
| 76 | + src={image} |
| 77 | + alt={name} |
| 78 | + width={400} |
| 79 | + height={300} |
| 80 | + className={css({ |
| 81 | + width: '100%', |
| 82 | + height: '200px', |
| 83 | + objectFit: 'cover', |
| 84 | + borderTopRadius: 'md' |
| 85 | + })} |
| 86 | + /> |
| 87 | + <Stack p="4" gap="2" bg="bg"> |
| 88 | + <panda.h3 fontSize="lg" fontWeight="semibold"> |
| 89 | + {name} |
| 90 | + </panda.h3> |
| 91 | + <panda.p fontSize="md" color="fg.muted"> |
| 92 | + {description} |
| 93 | + </panda.p> |
| 94 | + </Stack> |
| 95 | + </Link> |
| 96 | + ) |
| 97 | +} |
| 98 | + |
| 99 | +export default function ShowcasePage() { |
| 100 | + return ( |
| 101 | + <> |
| 102 | + <Navbar /> |
| 103 | + <panda.div bg="bg.muted" pt="20" minH="80dvh"> |
| 104 | + <Container py="20"> |
| 105 | + <Stack gap="6" align="center"> |
| 106 | + <Stack align="center" textAlign="center"> |
| 107 | + <panda.h1 |
| 108 | + fontSize={{ base: '3xl', md: '5xl' }} |
| 109 | + fontWeight="bold" |
| 110 | + letterSpacing="tight" |
| 111 | + > |
| 112 | + Showcase |
| 113 | + </panda.h1> |
| 114 | + </Stack> |
| 115 | + <panda.p |
| 116 | + fontSize={{ base: 'lg', md: 'xl' }} |
| 117 | + color="fg.muted" |
| 118 | + maxW="2xl" |
| 119 | + lineHeight="relaxed" |
| 120 | + textAlign="center" |
| 121 | + > |
| 122 | + Explore the projects built with Panda CSS by the community and get |
| 123 | + inspired for your next project. |
| 124 | + </panda.p> |
| 125 | + </Stack> |
| 126 | + </Container> |
| 127 | + |
| 128 | + <Container pb="20"> |
| 129 | + <Grid |
| 130 | + columns={{ base: 1, md: 2, lg: 3 }} |
| 131 | + gap={{ base: '4', md: '8' }} |
| 132 | + > |
| 133 | + {showcases.map(showcase => ( |
| 134 | + <ShowcaseCard key={showcase.name} data={showcase} /> |
| 135 | + ))} |
| 136 | + </Grid> |
| 137 | + </Container> |
| 138 | + </panda.div> |
| 139 | + <FooterSection /> |
| 140 | + </> |
| 141 | + ) |
| 142 | +} |
0 commit comments