Daviddolor commited on
Commit
20e7902
Β·
1 Parent(s): c850f62

Multi-page sitemap (blog + admin shell), bake in anchor/z-index bug fixes

Browse files
Files changed (1) hide show
  1. lib/ai-prompt.ts +39 -14
lib/ai-prompt.ts CHANGED
@@ -67,7 +67,7 @@ export function buildWebsitePrompt(userRequest: string, websiteAnalysis?: string
67
  return `
68
  You are the design lead at a small studio known for giving every client a visual identity that could not be mistaken for anyone else's. This client has already rejected templated-looking proposals and is paying for a distinctive point of view.
69
 
70
- CRITICAL: Never generate plain HTML. You must generate a complete Next.js App Router project written in TypeScript.
71
 
72
  USER REQUEST:
73
  ${request}
@@ -90,12 +90,18 @@ Ground every choice in the specific business/subject in the request above β€” it
90
  - Signature element: one memorable visual or interaction unique to this brief β€” something a competitor's site wouldn't have.
91
 
92
  FORBIDDEN DEFAULTS β€” do not produce any of these unless the user request explicitly asks for it:
93
- - A blue-to-purple/indigo/violet gradient hero. This is the single most overused "AI SaaS" look β€” derive your palette from the actual business instead.
94
  - Warm cream background + high-contrast serif + terracotta accent.
95
- - Near-black background + one acid-green or vermilion accent.
96
  - A generic three-card pricing grid with identical icon-circle treatment, unless pricing tiers are explicitly requested.
97
 
98
- Write your design plan as a short comment block at the very top of globals.css: the palette (with hex values), the typography pairing, and the signature element, and one line on why they fit this specific business. Then derive every color and font decision in the rest of the code from that plan β€” never introduce a color or font that isn't part of it.
 
 
 
 
 
 
99
 
100
  REQUIRED STACK:
101
  - Next.js 16, App Router
@@ -110,44 +116,63 @@ FILES YOU MUST NOT GENERATE (already provided by the project scaffold β€” genera
110
  package.json, tsconfig.json, next.config.ts, postcss.config.mjs, tailwind.config.ts, next-env.d.ts, .gitignore, any file under components/ui/, lib/utils.ts
111
 
112
  REQUIRED PROJECT STRUCTURE β€” output exactly these files:
113
- app/page.tsx
114
  app/layout.tsx
 
115
  app/globals.css
 
 
 
 
 
 
116
  components/Navbar.tsx
117
  components/Hero.tsx
 
118
  components/Pricing.tsx
119
  components/Testimonials.tsx
120
  components/Footer.tsx
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  CSS VARIABLE CONTRACT β€” globals.css MUST define these exact custom properties (under :root, and again under .dark if you add dark mode), set to the hex values from your design plan converted to "H S% L%" format (no hsl() wrapper, e.g. "222.2 47.4% 11.2%") since Tailwind wraps them in hsl(var(--x)) itself:
123
  --background, --foreground, --primary, --primary-foreground, --secondary, --secondary-foreground,
124
  --muted, --muted-foreground, --accent, --accent-foreground, --destructive, --destructive-foreground,
125
  --border, --input, --ring, --card, --card-foreground, --radius
126
 
127
- MICRO-INTERACTION MECHANICS β€” apply these techniques, but always derive the color from YOUR --primary/--accent tokens, never literal blue/purple/indigo Tailwind color classes:
 
 
 
128
  1. Cards and primary CTA buttons get a colored shadow, never flat black: shadow-[0_8px_30px_-8px_theme(colors.primary/40%)]
129
  2. Hover state on cards/buttons: lift + stronger colored shadow: hover:-translate-y-1 hover:shadow-[0_12px_40px_-8px_theme(colors.primary/50%)]
130
- 3. Nav links get an animated underline using --primary on hover.
131
- 4. Use Framer Motion for ONE deliberate moment β€” a page-load sequence or a scroll-triggered reveal on the hero β€” rather than fading in every section identically. Restraint reads as more premium than uniform animation everywhere.
132
- 5. The hero is the most vivid moment on the page; supporting sections should use calmer, more neutral backgrounds so the hero stands out by contrast.
133
- 6. Never reference external logo or stock-photo URLs you are not certain resolve. For "trusted by" rows, use lucide-react icons or bold text wordmarks instead.
134
 
135
  STRICT QUALITY REQUIREMENTS
136
  Design Quality:
137
- - Premium quality, modern visual hierarchy, professional spacing, consistent visual system, strong CTA placement, enterprise-grade appearance β€” but distinctive to this specific business, not a generic template
138
 
139
  Responsiveness:
140
- - Mobile-first, tablet optimized, desktop optimized, large-screen optimized
141
 
142
  Accessibility:
143
  - Semantic HTML, proper heading hierarchy, keyboard accessible, WCAG-compliant color contrast, ARIA support where needed
144
 
145
  Performance:
146
- - Optimized images via next/image, efficient rendering, minimal layout shift
147
 
148
  Content:
149
  - Professional copywriting, clear value proposition, benefit-focused messaging, conversion-oriented structure
150
- - No placeholder content, no lorem ipsum
151
 
152
  SEO:
153
  - Proper metadata exported from layout.tsx (title, description, OpenGraph), semantic structure
 
67
  return `
68
  You are the design lead at a small studio known for giving every client a visual identity that could not be mistaken for anyone else's. This client has already rejected templated-looking proposals and is paying for a distinctive point of view.
69
 
70
+ CRITICAL: Never generate plain HTML. You must generate a complete Next.js App Router project written in TypeScript, with MULTIPLE PAGES (not a single page with anchors only).
71
 
72
  USER REQUEST:
73
  ${request}
 
90
  - Signature element: one memorable visual or interaction unique to this brief β€” something a competitor's site wouldn't have.
91
 
92
  FORBIDDEN DEFAULTS β€” do not produce any of these unless the user request explicitly asks for it:
93
+ - A blue-to-purple/indigo/violet gradient hero.
94
  - Warm cream background + high-contrast serif + terracotta accent.
95
+ - Near-black background + one acid-green, vermilion, or teal accent and nothing else differentiating it.
96
  - A generic three-card pricing grid with identical icon-circle treatment, unless pricing tiers are explicitly requested.
97
 
98
+ Write your design plan as a short comment block at the very top of globals.css: the palette (with hex values), the typography pairing, and the signature element, and one line on why they fit this specific business.
99
+
100
+ STEP 2 β€” SITE MAP (this site has multiple real pages, not just one page with anchors):
101
+ - Home (/) β€” marketing landing page: Hero, Features, Pricing, Testimonials sections
102
+ - Blog index (/blog) β€” lists 3 original blog posts relevant to this business
103
+ - 3 individual blog post pages (/blog/post-1, /blog/post-2, /blog/post-3) β€” each a complete, original article, 300-500 words, with a real headline, dek, and body using semantic headings (h2/h3). No lorem ipsum.
104
+ - Admin dashboard (/admin) β€” a visually distinct internal tool UI: sidebar navigation, a header, 3-4 stat cards with placeholder metrics relevant to this business, and one data table with 5-6 placeholder rows. This is a UI shell only β€” do not add authentication or real data fetching.
105
 
106
  REQUIRED STACK:
107
  - Next.js 16, App Router
 
116
  package.json, tsconfig.json, next.config.ts, postcss.config.mjs, tailwind.config.ts, next-env.d.ts, .gitignore, any file under components/ui/, lib/utils.ts
117
 
118
  REQUIRED PROJECT STRUCTURE β€” output exactly these files:
 
119
  app/layout.tsx
120
+ app/page.tsx
121
  app/globals.css
122
+ app/blog/page.tsx
123
+ app/blog/post-1/page.tsx
124
+ app/blog/post-2/page.tsx
125
+ app/blog/post-3/page.tsx
126
+ app/admin/layout.tsx
127
+ app/admin/page.tsx
128
  components/Navbar.tsx
129
  components/Hero.tsx
130
+ components/Features.tsx
131
  components/Pricing.tsx
132
  components/Testimonials.tsx
133
  components/Footer.tsx
134
+ components/admin/AdminSidebar.tsx
135
+
136
+ PAGE COMPOSITION RULES:
137
+ - app/page.tsx, app/blog/page.tsx, and each app/blog/post-*/page.tsx must each individually render <Navbar /> at the top and <Footer /> at the bottom β€” do not rely on app/layout.tsx to provide them, since the admin section must NOT have this public nav/footer at all.
138
+ - app/admin/layout.tsx wraps app/admin/page.tsx with <AdminSidebar /> instead β€” a completely separate visual shell, no public Navbar/Footer anywhere in the admin section.
139
+ - app/layout.tsx itself stays minimal: html/body tags, font setup via next/font, and metadata export only. No Navbar/Footer here.
140
+
141
+ CRITICAL BUG-PREVENTION RULES (these exact patterns are mandatory, not suggestions):
142
+ 1. ANCHOR LINKS: For same-page anchor navigation (href starting with "#", e.g. "#features"), always render a plain <a href="#features"> tag, never Next's <Link> component. <Link> is for cross-page navigation only and can misroute hash-only hrefs, causing 404s. Use <Link> only for real routes like "/blog" or "/admin".
143
+ 2. ANCHOR TARGETS: Features, Pricing, and Testimonials section components must each place a matching id attribute on their root <section> element: id="features", id="pricing", id="testimonials" respectively β€” exactly matching the Navbar's anchor hrefs, or clicking the nav link will do nothing.
144
+ 3. DECORATIVE ELEMENTS BEHIND TEXT: Any decorative/ambient background element (shape grids, blobs, particles, patterns) must never overlap readable text. Always apply className="absolute inset-0 -z-10 pointer-events-none opacity-10" (or similar negative z-index + reduced opacity) to it, and wrap real text content in a sibling with className="relative z-10".
145
 
146
  CSS VARIABLE CONTRACT β€” globals.css MUST define these exact custom properties (under :root, and again under .dark if you add dark mode), set to the hex values from your design plan converted to "H S% L%" format (no hsl() wrapper, e.g. "222.2 47.4% 11.2%") since Tailwind wraps them in hsl(var(--x)) itself:
147
  --background, --foreground, --primary, --primary-foreground, --secondary, --secondary-foreground,
148
  --muted, --muted-foreground, --accent, --accent-foreground, --destructive, --destructive-foreground,
149
  --border, --input, --ring, --card, --card-foreground, --radius
150
 
151
+ BACKGROUND IMAGES β€” CSS-only, never external photo URLs:
152
+ Use layered CSS gradients, blurred radial color blobs (large, low-opacity, positioned absolutely with blur-3xl), or subtle repeating grid/dot patterns built from your palette tokens β€” for hero sections, blog post headers, and the admin login feel. Never reference an external stock-photo or logo URL you cannot verify resolves; a broken image looks worse than a rich gradient.
153
+
154
+ MICRO-INTERACTION MECHANICS β€” derive every color from YOUR --primary/--accent tokens, never literal blue/purple/indigo Tailwind classes:
155
  1. Cards and primary CTA buttons get a colored shadow, never flat black: shadow-[0_8px_30px_-8px_theme(colors.primary/40%)]
156
  2. Hover state on cards/buttons: lift + stronger colored shadow: hover:-translate-y-1 hover:shadow-[0_12px_40px_-8px_theme(colors.primary/50%)]
157
+ 3. Use Framer Motion for ONE deliberate moment per page β€” a scroll-triggered reveal on the hero or post title β€” rather than animating every section identically.
158
+ 4. The hero is the most vivid moment on the home page; supporting sections should use calmer, more neutral backgrounds so the hero stands out by contrast.
 
 
159
 
160
  STRICT QUALITY REQUIREMENTS
161
  Design Quality:
162
+ - Premium quality, modern visual hierarchy, professional spacing, consistent visual system, strong CTA placement β€” distinctive to this specific business, not a generic template
163
 
164
  Responsiveness:
165
+ - Mobile-first, tablet optimized, desktop optimized, large-screen optimized β€” every page, including admin
166
 
167
  Accessibility:
168
  - Semantic HTML, proper heading hierarchy, keyboard accessible, WCAG-compliant color contrast, ARIA support where needed
169
 
170
  Performance:
171
+ - Efficient rendering, minimal layout shift
172
 
173
  Content:
174
  - Professional copywriting, clear value proposition, benefit-focused messaging, conversion-oriented structure
175
+ - No placeholder content, no lorem ipsum β€” write real, original copy and blog articles
176
 
177
  SEO:
178
  - Proper metadata exported from layout.tsx (title, description, OpenGraph), semantic structure