Neus 佈局 - 登陸頁
產生公開頁面外殼:固定頁首 + 主要內容區 + 頁尾。不含 AppTemplate,無側邊欄。
開始之前
以下「共享規則」區塊始終有效。此外,請閱讀:
.agents/skills/_shared/anti-slop.md— 強制性品質規則.agents/skills/_shared/prop-constraints.md— 禁止的 props 與不存在的元件.agents/skills/_shared/component-catalog.md— Button、Link 章節.agents/skills/_shared/theme-config.md— ThemeProvider 設定.agents/skills/_shared/checklist.md— P0/P1/P2 關卡.agents/skills/_shared/dark-surfaces.md— 深色模式 CSS 配方(當 Mode: dark 時閱讀).agents/skills/_shared/light-surfaces.md— 淺色模式 CSS 配方(當 Mode: light 時閱讀)
階段 0 — 收集資料
以自由文字詢問:
- 品牌/產品名稱(用於頁首的標誌)
- 頁首導覽項目(確切連結)
- 頁首 CTA?(按鈕文字 — 例如:「免費開始使用」)
- 頁尾:連結欄位或僅版權資訊
- 主要主題顏色
- 主題模式:淺色或深色?(預設:淺色)
階段 1 — 視覺解析
在撰寫任何程式碼之前,根據收集的答案解析視覺指令。
- 模式:
dark→ 閱讀dark-surfaces.md;使用暗色畫布#0a0a14、玻璃導覽列、玻璃表面 - 模式:
light→ 閱讀light-surfaces.md;使用var(--color-white)畫布、純白導覽列
宣告指令:
視覺指令
模式:dark | light
表面檔案:dark-surfaces.md | light-surfaces.md
階段 2 — 產生
按順序產生三個檔案:LandingLayout.types.ts → LandingLayout.tsx → LandingLayout.styles.css。
LandingLayout.types.ts
export type NavItem = {
label: string;
href: string;
};
export type LandingLayoutProps = {
children: React.ReactNode;
};
LandingLayout.tsx
import { Button, Link, ThemeProvider } from 'neus-ui';
import './LandingLayout.styles.css';
import type { LandingLayoutProps } from './LandingLayout.types';
export const LandingLayout = ({ children }: LandingLayoutProps) => (
<ThemeProvider initialTheme={{ primaryColor: '[從收集資料中取得的十六進位色碼]' }}>
<div className="landing-layout">
{/* 固定導覽頁首 */}
<header className="landing-layout__header">
<div className="landing-layout__header-inner">
<span className="landing-layout__brand">[品牌名稱]</span>
<nav className="landing-layout__nav">
{/* 從收集資料取得的導覽項目 — 白色頁首背景上使用 type="primary" */}
<Link label="[導覽項目1]" type="primary" href="#[區段]" />
</nav>
<Button label="[頁首 CTA]" variant="solid" color="primary" onClick={() => {}} />
</div>
</header>
{/* 頁面內容 */}
<main className="landing-layout__main">
{children}
</main>
{/* 頁尾 */}
<footer className="landing-layout__footer">
<span>[品牌名稱] © {new Date().getFullYear()}</span>
<div className="landing-layout__footer-links">
<Link label="服務條款" type="secondary" href="/terms" />
<Link label="隱私權政策" type="secondary" href="/privacy" />
</div>
</footer>
</div>
</ThemeProvider>
);
LandingLayout.styles.css
根據視覺指令套用模式。使用已解析的表面檔案中的表面配方。
淺色模式 (Mode: light):
.landing-layout { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-white); }
.landing-layout__header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--color-border-light);
}
.landing-layout__header-inner {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
}
.landing-layout__brand {
font-family: var(--font-display);
font-size: 1.25rem;
font-weight: 700;
color: var(--color-primary);
}
.landing-layout__nav { display: flex; gap: 1.5rem; align-items: center; }
.landing-layout__main { flex: 1; }
.landing-layout__footer {
padding: 1.5rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid var(--color-border-light);
font-size: 0.9rem;
color: var(--color-gray-500);
}
.landing-layout__footer-links { display: flex; gap: 1rem; }
深色模式 (Mode: dark) — 使用此規則取代淺色模式規則:
.landing-layout { min-height: 100vh; display: flex; flex-direction: column; background: #0a0a14; color: #e2e8f0; }
.landing-layout__header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(10, 10, 20, 0.8);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* (header-inner, brand, nav, main — 與淺色模式相同) */
.landing-layout__brand { color: #818cf8; }
.landing-layout__footer {
padding: 1.5rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid rgba(255, 255, 255, 0.08);
font-size: 0.9rem;
color: #64748b;
}
共享規則(內嵌)
這些規則始終有效。即使未讀取
_shared/檔案,它們仍然適用。
輸出 — 始終三個檔案
每個技能輸出:ComponentName.types.ts → ComponentName.tsx → ComponentName.styles.css。
無內聯樣式(style={{}})。無 <style> 標籤在元件內部。CSS 僅在 .styles.css 中。
匯入
import { Button, Card, Input, Badge, Link, Select, Modal, DataTable } from 'neus-ui';
絕不從內部路徑匯入,例如 ../../components/Button/Button。
類型
所有 type / interface 宣告 → ComponentName.types.ts。絕不在 .tsx 中宣告類型。
React 19 — 無 FormEvent
絕不 import { FormEvent } from 'react'。改用 <Button type="submit" onClick={...} />。
元件屬性約束
- Button
variant:"solid"|"outlined"|"text"—"ghost"不存在 - Button
color:"primary"|"success"|"error"|"info"|"white"—"white"僅用於深色畫布 - Button
size:"small"|"medium"|"large" - Card
variant:"default"|"glass"—"glass"用於深色畫布 - Badge
color:"primary"|"success"|"error"|"info"|"neutral" - Link
type:"primary"(品牌色)|"secondary"(低調灰色) - Select:無
required屬性 — 在外部處理驗證 - FormTemplate:僅
children、submitLabel、loading— 無onSubmit/onCancel
垃圾內容黑名單
- 無內聯樣式 /
style={{}}/<style>標籤 - 資料來自 API 時,無硬編碼資料陣列 — 使用 typed props
- 無虛構文案(假評價、佔位名稱、假指標)
- 無
anyTypeScript 類型 - 當 Neus UI 元件存在時,不使用原始
<a>、<span>、<input>、<button> - 無硬編碼字型堆疊 — 使用
var(--font-display)/var(--font-mono) - 在深色模式中:不使用
var(--color-primary-light)作為區塊背景;不使用原始 div 卡片 — 改用<Card variant="glass">