Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 6x 6x 6x 30x 30x 30x 90x 30x 30x 30x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 18x 18x 18x 18x 18x 18x 18x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 12x 6x 6x 6x 6x 6x 6x 6x 6x 1x 1x | 'use client'
import { css } from '@styled/css'
import { useTranslations } from 'next-intl'
import { CreateToolCard } from '@/components/create/CreateToolCard'
import { PageWithNav } from '@/components/PageWithNav'
import { type CreateToolMeta, getCreateToolsByTier } from '@/lib/create-tools/createToolList'
const PRIMARY_TOOLS = getCreateToolsByTier('primary')
const SECONDARY_TOOLS = getCreateToolsByTier('secondary')
/**
* The /create hub.
*
* `PageWithNav` is used WITHOUT `navTitle` on purpose: that path applies the
* `var(--app-nav-height)` offset for us (so no magic `pt: 20` here) and skips
* lazy-loading the ~100KB arcade `GameNavContent` branch, which this page has
* no use for.
*/
export function CreateHubContent() {
const t = useTranslations('create.hub')
const cardCopy = (tool: CreateToolMeta) => ({
title: t(`${tool.i18nKey}.title`),
description: t(`${tool.i18nKey}.description`),
features: Array.from({ length: tool.featureCount }, (_, i) =>
t(`${tool.i18nKey}.feature${i + 1}`)
),
buttonText: t(`${tool.i18nKey}.button`),
})
return (
<PageWithNav>
<div
data-component="create-hub"
className={css({
minHeight: '100vh',
bg: 'bg.canvas',
pt: { base: 6, md: 10 },
pb: { base: 10, md: 16 },
px: { base: 4, sm: 6, md: 8 },
})}
>
{/* Hero */}
<header
className={css({
textAlign: 'center',
maxWidth: '800px',
mx: 'auto',
mb: { base: 8, md: 12 },
})}
>
<div aria-hidden="true" className={css({ fontSize: { base: '4xl', md: '5xl' }, mb: 2 })}>
✨
</div>
<h1
className={css({
fontSize: { base: '2xl', sm: '3xl', md: '4xl', lg: '5xl' },
fontWeight: 'extrabold',
mb: { base: 3, md: 4 },
color: 'text.primary',
letterSpacing: 'tight',
})}
>
{t('pageTitle')}
</h1>
<p
className={css({
fontSize: { base: 'md', sm: 'lg', md: 'xl' },
color: 'text.secondary',
lineHeight: '1.7',
})}
>
{t('pageSubtitle')}
</p>
</header>
{/* Primary row — the abacus trio */}
<div className={css({ display: 'flex', justifyContent: 'center' })}>
<div
data-element="create-tool-grid"
data-tier="primary"
className={css({
display: 'grid',
gridTemplateColumns: {
base: '1fr',
sm: 'repeat(2, 1fr)',
lg: 'repeat(3, 1fr)',
},
gap: { base: 4, sm: 5, md: 6, lg: 8 },
maxWidth: '1200px',
width: '100%',
// the flagship spans the full width at sm (2-up), then settles
// into a normal third at lg (3-up)
'& > :first-child': {
sm: { gridColumn: 'span 2' },
lg: { gridColumn: 'span 1' },
},
})}
>
{PRIMARY_TOOLS.map((tool, index) => (
<CreateToolCard
key={tool.id}
tool={tool}
variant={index === 0 ? 'flagship' : 'default'}
eyebrow={index === 0 ? t('flagshipEyebrow') : undefined}
{...cardCopy(tool)}
/>
))}
</div>
</div>
{/* Secondary row — more printables */}
<div
className={css({
display: 'flex',
justifyContent: 'center',
mt: { base: 10, md: 16 },
})}
>
<section className={css({ maxWidth: '1200px', width: '100%' })}>
<h2
className={css({
fontSize: { base: 'lg', md: 'xl' },
fontWeight: 'bold',
color: 'text.primary',
letterSpacing: 'tight',
})}
>
{t('moreHeading')}
</h2>
<p
className={css({
fontSize: { base: 'sm', md: 'md' },
color: 'text.secondary',
mt: 1,
mb: { base: 4, md: 6 },
})}
>
{t('moreSubheading')}
</p>
<div
data-element="create-tool-grid"
data-tier="secondary"
className={css({
display: 'grid',
gridTemplateColumns: { base: '1fr', sm: 'repeat(2, 1fr)' },
gap: { base: 4, md: 6 },
})}
>
{SECONDARY_TOOLS.map((tool) => (
<CreateToolCard key={tool.id} tool={tool} variant="compact" {...cardCopy(tool)} />
))}
</div>
</section>
</div>
</div>
</PageWithNav>
)
}
export default CreateHubContent
|