init
This commit is contained in:
commit
fe636432d0
154 files changed
+30381
No files matched your search
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Vadim Comanescu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
name: frontend-design
|
||||
description: "Create distinctive, production-grade frontend UI with a bold, intentional aesthetic direction, purposeful layouts, meaningful motion, and strong accessibility. Prefer React + Next.js (TypeScript), but support vanilla HTML/CSS/JS when appropriate."
|
||||
---
|
||||
|
||||
# Frontend Design
|
||||
|
||||
Build memorable, functional interfaces with a clear point-of-view (no generic templates). Commit to one aesthetic direction, define tokens, ship accessible + responsive UI, and keep changes scoped.
|
||||
|
||||
## Preferred Targets (choose the best fit)
|
||||
1) **Next.js (TypeScript)**: preferred for production app/marketing routes and design system work.
|
||||
2) **React (TypeScript)**: preferred for SPA/component libraries outside Next.js.
|
||||
3) **Vanilla HTML/CSS/JS**: great for static demos, prototypes, and standalone embeds.
|
||||
|
||||
## Quick Start (do this first)
|
||||
1) Ask up to 4 questions:
|
||||
- What user and job-to-be-done (what should feel “easy” after the change)?
|
||||
- Where does it live (component/route) and what stack? Prefer Next.js/React; vanilla is fine for standalone pages or prototypes.
|
||||
- In Next.js: assume App Router (`app/`). Any server/client constraints?
|
||||
- Any hard constraints (brand tokens, light/dark, motion limits, must-keep UI parts, perf budgets)?
|
||||
2) Pick an aesthetic direction + **one signature move**. If vague, propose 2–3 options from `references/aesthetic-playbook.md`.
|
||||
3) Define tokens (type, palette, spacing, radius, shadows, motion). Keep accents to 1–2.
|
||||
4) Build structure first (semantic markup + layout), then motion, then polish + QA.
|
||||
|
||||
## Guardrails (avoid footguns)
|
||||
- Keep scope tight: redesign only what the user asked for.
|
||||
- Reuse existing tokens/components if working in an existing repo; do not introduce a new global styling system unless requested.
|
||||
- Match complexity to the vision: refined minimalism needs restraint; maximalism needs deliberate structure (not random decoration).
|
||||
- Respect `prefers-reduced-motion` for all animations.
|
||||
- Avoid “AI slop” defaults. If the repo already uses a generic font, keep it unless the user explicitly wants new typography.
|
||||
- Enforce token semantics: error/success/warning colors are for meaning, not decoration; keep contrast accessible in light/dark.
|
||||
- Default to shipping code that is easy to maintain: small components, clear hierarchy, minimal dependencies.
|
||||
- Don’t add new packages (animation libs, UI kits, icon sets) unless the user explicitly asks or the repo already uses them.
|
||||
- Default to one primary CTA per view; demote the rest (secondary/tertiary) to avoid competing actions.
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1) Commit to a direction
|
||||
- Declare: aesthetic direction, palette mood, type pairing, and the signature move.
|
||||
- Write a 1–2 sentence design thesis that explains the hierarchy and vibe.
|
||||
- Use `references/anti-patterns.md` to avoid predictable layouts and cliched palettes.
|
||||
|
||||
### 1b) Design system rules (strict vs flexible)
|
||||
- **Strict**: semantic color meaning, readable type ramp, reduced motion, visible focus, and “human-in-control” for AI actions (undo/apply/confirm).
|
||||
- **Flexible**: brand accent hue, surface “temperature” in dark mode, and density preset (compact vs comfy).
|
||||
- **When to read more**: load `references/tokens-and-semantics.md` when defining tokens and `references/ai-native-ui-patterns.md` when adding AI surfaces.
|
||||
|
||||
### 1a) React/Next.js coding guidance (read when implementing)
|
||||
- **React fundamentals**: keep components pure; prefer event handlers over Effects for user-driven work; follow the Rules of Hooks.
|
||||
- **Next.js App Router**: keep Client Components small; use Server Components by default; mark `"use client"` only where you need state, effects, or browser APIs.
|
||||
- **Data fetching**: prefer server-side `fetch` and explicit cache/revalidate controls; avoid unnecessary client-side effects for data.
|
||||
- **When to read more**: load `references/react-next-best-practices.md` before writing complex React logic or introducing new data fetching patterns.
|
||||
|
||||
### 2) Plan tokens and layout (before details)
|
||||
- Define CSS variables (or a theme object) for:
|
||||
- Color: background/surface/ink/muted/accent(+optional accent2)
|
||||
- Type: display/body/mono, size scale, line-height
|
||||
- Shape: radius scale and border rules
|
||||
- Depth: shadow and outline rules
|
||||
- Motion: durations + easing + reveal stagger step
|
||||
- Lay out the page/component skeleton and content hierarchy.
|
||||
- Reference `references/implementation-patterns.md` for patterns and QA.
|
||||
|
||||
### 3) Implement (ship code, not moodboards)
|
||||
- Start with semantic structure and accessible interactions (keyboard + focus states).
|
||||
- Build macro layout with Grid; micro layout with Flexbox.
|
||||
- For Next.js/React, keep components small and composable; prefer CSS Modules or the repo’s existing styling approach.
|
||||
- Use “link for navigation, button for actions” to keep semantics and keyboard behavior correct.
|
||||
- Apply the signature move sparingly but decisively (one memorable thing, not ten).
|
||||
- Add motion as orchestration (one strong page-load + a few micro-interactions), not random flourishes.
|
||||
|
||||
### 3a) Next.js implementation notes (when applicable)
|
||||
- **App Router only**: assume `app/` routing (not `pages/`).
|
||||
- **Server vs Client**: default to Server Components; add `"use client"` only for interactive islands.
|
||||
- **Data + state**: keep data fetching on the server when possible; keep client state local and purposeful.
|
||||
- **Performance**: avoid layout shift (stable heights, predictable grids); keep blur/shadows paint-friendly on mobile.
|
||||
- **Platform primitives**: prefer `next/link` for navigation and `next/image` for real images when available.
|
||||
- **Fonts**: if changing typography in Next.js, prefer `next/font` to avoid FOIT/FOUT surprises.
|
||||
- **Styling**: keep it consistent—CSS Modules, Tailwind, or the existing system; don’t introduce a new one without asking.
|
||||
|
||||
### 3b) Content + states (don’t ship empty shells)
|
||||
- Define loading, empty, and error states for any data-driven UI.
|
||||
- Keep copy tight and purposeful; avoid placeholder lorem unless asked.
|
||||
- Preserve existing product terminology unless the user requests copy changes.
|
||||
|
||||
### 4) Polish and QA
|
||||
- Responsive pass: collapse grids, maintain padding, preserve CTA prominence on mobile.
|
||||
- Accessibility pass: landmarks, one `h1`, labels, contrast, focus order, skip link when relevant.
|
||||
- Performance pass: avoid expensive shadows on mobile, keep animation paint-friendly, avoid large images.
|
||||
|
||||
## Definition of Done
|
||||
- Layout looks intentional at mobile + desktop breakpoints (no cramped type, no orphan CTAs).
|
||||
- Focus states are visible, tab order is logical, and motion respects `prefers-reduced-motion`.
|
||||
- Tokens are centralized (CSS variables/theme), and the signature move is present but not overused.
|
||||
|
||||
## Deliverables (how to present results)
|
||||
- List files changed and what they do.
|
||||
- Explain the aesthetic direction + signature move (1–2 sentences).
|
||||
- Provide commands to validate (use the repo’s conventions; common ones include `npm run dev`, `npm run lint`, `npm test`).
|
||||
|
||||
## Bundled Resources
|
||||
- `references/aesthetic-playbook.md`: strong directions, type+color cues, signature moves.
|
||||
- `references/implementation-patterns.md`: layout/motion/a11y patterns for vanilla + React.
|
||||
- `references/anti-patterns.md`: quick “don’t do this” checklist to avoid generic output.
|
||||
- `references/react-next-best-practices.md`: React + Next.js coding guidelines (hooks, effects, server/client, data fetching).
|
||||
- `references/tokens-and-semantics.md`: token semantics, type ramp, dark mode, and density rules (strict vs flexible).
|
||||
- `references/ai-native-ui-patterns.md`: copilot panels, citations, disclosures, and human-in-the-loop UI patterns.
|
||||
- `assets/vanilla-starter/`: runnable vanilla starter you can copy + retheme via CSS variables.
|
||||
- `assets/react-component-starter/`: small React component + CSS module skeleton to retheme.
|
||||
- `assets/nextjs-app-router-starter/`: minimal Next.js App Router page + tokens you can copy and retheme.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# Next.js App Router Starter
|
||||
|
||||
Copy these files into an existing Next.js App Router project to bootstrap a strongly-themed, token-driven page.
|
||||
|
||||
- Files assume `app/` routing (not `pages/`).
|
||||
- Uses CSS variables + CSS Modules (no external styling dependencies).
|
||||
- Designed to be rethemed by editing `app/globals.css` tokens.
|
||||
- Includes an “Assistant Rail” component demonstrating AI-native UX patterns (AI disclosure, citations, and human-in-control apply/undo).
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
:root {
|
||||
--bg: #0b0d12;
|
||||
--surface: rgba(255, 255, 255, 0.06);
|
||||
--surface-2: rgba(255, 255, 255, 0.1);
|
||||
--ink: rgba(255, 255, 255, 0.92);
|
||||
--muted: rgba(255, 255, 255, 0.68);
|
||||
--accent: #6ee7ff;
|
||||
--danger: #ff5a7a;
|
||||
--warning: #ffcc66;
|
||||
--success: #55f2b1;
|
||||
--info: #6ea8ff;
|
||||
|
||||
--radius-sm: 10px;
|
||||
--radius-md: 16px;
|
||||
--radius-lg: 22px;
|
||||
|
||||
--shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.28);
|
||||
--shadow-md: 0 22px 70px rgba(0, 0, 0, 0.4);
|
||||
|
||||
--container: 1120px;
|
||||
--gutter: clamp(16px, 3vw, 28px);
|
||||
--grid-gap: clamp(14px, 2vw, 22px);
|
||||
|
||||
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--dur-1: 140ms;
|
||||
--dur-2: 240ms;
|
||||
--dur-3: 420ms;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: radial-gradient(1200px 900px at 18% -10%, rgba(110, 231, 255, 0.18), transparent 55%),
|
||||
radial-gradient(900px 700px at 78% 10%, rgba(255, 115, 224, 0.14), transparent 60%),
|
||||
var(--bg);
|
||||
color: var(--ink);
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid color-mix(in oklab, var(--accent), white 10%);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Frontend Design Starter",
|
||||
description: "Token-driven Next.js starter page for rapid retheming.",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{ children: ReactNode }>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
.page {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.skip {
|
||||
position: absolute;
|
||||
left: -999px;
|
||||
top: 12px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.skip:focus {
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
backdrop-filter: blur(18px);
|
||||
background: color-mix(in oklab, var(--bg), transparent 35%);
|
||||
border-bottom: 1px solid color-mix(in oklab, white, transparent 90%);
|
||||
}
|
||||
|
||||
.topbarInner {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 14px var(--gutter);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.mark {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 10px;
|
||||
background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 60%),
|
||||
linear-gradient(135deg, rgba(110, 231, 255, 0.85), rgba(255, 115, 224, 0.62));
|
||||
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
padding: 8px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.hero {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 54px var(--gutter) 28px;
|
||||
display: grid;
|
||||
grid-template-columns: 1.15fr 0.85fr;
|
||||
gap: clamp(18px, 3vw, 36px);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.headline {
|
||||
margin: 0;
|
||||
font-size: clamp(34px, 4vw, 56px);
|
||||
line-height: 1.03;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.lede {
|
||||
margin: 14px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: clamp(16px, 1.4vw, 18px);
|
||||
max-width: 58ch;
|
||||
}
|
||||
|
||||
.ctaRow {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 11px 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in oklab, white, transparent 85%);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out),
|
||||
border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-1px);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.btnPrimary {
|
||||
border-color: color-mix(in oklab, var(--accent), white 40%);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(110, 231, 255, 0.22),
|
||||
rgba(255, 255, 255, 0.06)
|
||||
);
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: var(--radius-lg);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
|
||||
border: 1px solid color-mix(in oklab, white, transparent 88%);
|
||||
box-shadow: var(--shadow-md);
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.rail {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.panelHeader {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.panelTitle {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
letter-spacing: 0.02em;
|
||||
color: color-mix(in oklab, var(--muted), white 18%);
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 12px;
|
||||
color: color-mix(in oklab, var(--accent), white 20%);
|
||||
background: rgba(110, 231, 255, 0.12);
|
||||
border: 1px solid rgba(110, 231, 255, 0.28);
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin: 14px 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.item {
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
padding: 12px 12px;
|
||||
}
|
||||
|
||||
.itemTitle {
|
||||
font-weight: 620;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.itemBody {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 28px var(--gutter) 64px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, 1fr);
|
||||
gap: var(--grid-gap);
|
||||
}
|
||||
|
||||
.card {
|
||||
grid-column: span 4;
|
||||
border-radius: var(--radius-lg);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.07);
|
||||
padding: 18px;
|
||||
transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 16px;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.card p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.card {
|
||||
grid-column: span 6;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.card {
|
||||
grid-column: span 12;
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
import styles from "./page.module.css";
|
||||
import { AssistantRail } from "../components/AssistantRail";
|
||||
|
||||
const quickWins = [
|
||||
{
|
||||
title: "Token-first styling",
|
||||
body: "Retheme fast by editing CSS variables in globals.css (palette, radii, shadows, motion).",
|
||||
},
|
||||
{
|
||||
title: "One signature move",
|
||||
body: "Commit to a single memorable gesture (light sweep, stripe, grain, or brutal border logic).",
|
||||
},
|
||||
{
|
||||
title: "Accessible by default",
|
||||
body: "Semantic structure, visible focus, and reduced-motion support are built in.",
|
||||
},
|
||||
];
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<a className={styles.skip} href="#content">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
<header className={styles.topbar}>
|
||||
<div className={styles.topbarInner}>
|
||||
<a className={styles.brand} href="#">
|
||||
<span aria-hidden className={styles.mark} />
|
||||
Frontend Design
|
||||
</a>
|
||||
<nav className={styles.nav} aria-label="Primary">
|
||||
<a href="#principles">Principles</a>
|
||||
<a href="#cards">Patterns</a>
|
||||
<a href="#cta">CTA</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="content">
|
||||
<section className={styles.hero} aria-labelledby="headline">
|
||||
<div>
|
||||
<h1 id="headline" className={styles.headline}>
|
||||
A token-driven page that looks intentional on day one.
|
||||
</h1>
|
||||
<p className={styles.lede}>
|
||||
Build structure first, then motion, then polish. Keep the UI memorable with one
|
||||
signature move—not ten random decorations.
|
||||
</p>
|
||||
<div className={styles.ctaRow} id="cta">
|
||||
<a className={`${styles.btn} ${styles.btnPrimary}`} href="#">
|
||||
Start a redesign <span aria-hidden>→</span>
|
||||
</a>
|
||||
<a className={styles.btn} href="#cards">
|
||||
See patterns
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside className={styles.panel} aria-label="Quick Wins" id="principles">
|
||||
<div className={styles.panelHeader}>
|
||||
<h2 className={styles.panelTitle}>Quick Wins</h2>
|
||||
<span className={styles.badge}>Next.js App Router</span>
|
||||
</div>
|
||||
<ul className={styles.list}>
|
||||
{quickWins.map((item) => (
|
||||
<li key={item.title} className={styles.item}>
|
||||
<p className={styles.itemTitle}>{item.title}</p>
|
||||
<p className={styles.itemBody}>{item.body}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<div className={styles.rail}>
|
||||
<AssistantRail />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className={styles.content} aria-labelledby="cards" id="cards">
|
||||
<div className={styles.grid}>
|
||||
<article className={styles.card}>
|
||||
<h2>Hierarchy</h2>
|
||||
<p>Make the primary action obvious, then design the supporting rails.</p>
|
||||
</article>
|
||||
<article className={styles.card}>
|
||||
<h2>Texture</h2>
|
||||
<p>Use subtle grain/mesh/stripe logic to avoid flat UI without clutter.</p>
|
||||
</article>
|
||||
<article className={styles.card}>
|
||||
<h2>Motion</h2>
|
||||
<p>Orchestrate a few meaningful reveals and micro-interactions—guarded by settings.</p>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
.wrap {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: var(--radius-lg);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.07),
|
||||
rgba(255, 255, 255, 0.03)
|
||||
);
|
||||
border: 1px solid color-mix(in oklab, white, transparent 88%);
|
||||
box-shadow: var(--shadow-md);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
letter-spacing: 0.02em;
|
||||
color: color-mix(in oklab, var(--muted), white 18%);
|
||||
}
|
||||
|
||||
.disclosure {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 12px;
|
||||
color: color-mix(in oklab, var(--accent), white 18%);
|
||||
background: rgba(110, 231, 255, 0.12);
|
||||
border: 1px solid rgba(110, 231, 255, 0.28);
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.promptRow {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(0, 0, 0, 0.12);
|
||||
color: var(--ink);
|
||||
padding: 10px 12px;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.input::placeholder {
|
||||
color: color-mix(in oklab, var(--muted), transparent 10%);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in oklab, white, transparent 85%);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--ink);
|
||||
padding: 10px 12px;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out),
|
||||
border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-1px);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.btnPrimary {
|
||||
border-color: color-mix(in oklab, var(--accent), white 40%);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(110, 231, 255, 0.2),
|
||||
rgba(255, 255, 255, 0.06)
|
||||
);
|
||||
}
|
||||
|
||||
.output {
|
||||
margin-top: 12px;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.typing {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 999px;
|
||||
background: color-mix(in oklab, var(--accent), white 15%);
|
||||
opacity: 0.6;
|
||||
animation: pulse 900ms var(--ease-out) infinite;
|
||||
}
|
||||
|
||||
.dot:nth-child(2) {
|
||||
animation-delay: 120ms;
|
||||
}
|
||||
|
||||
.dot:nth-child(3) {
|
||||
animation-delay: 240ms;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: 0.45;
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-1px);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
margin: 0;
|
||||
color: color-mix(in oklab, var(--ink), white 2%);
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.citations {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 10px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.chipNumber {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 999px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(110, 231, 255, 0.14);
|
||||
border: 1px solid rgba(110, 231, 255, 0.26);
|
||||
color: color-mix(in oklab, var(--accent), white 20%);
|
||||
font-weight: 650;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.controlRow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.whyRow {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.statusStrong {
|
||||
color: color-mix(in oklab, var(--success), white 18%);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.dot {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import styles from "./AssistantRail.module.css";
|
||||
|
||||
type Suggestion = {
|
||||
id: string;
|
||||
text: string;
|
||||
citations: Array<{ title: string; href: string }>;
|
||||
};
|
||||
|
||||
const seededSuggestions: Suggestion[] = [
|
||||
{
|
||||
id: "cta",
|
||||
text: "Reduce competing CTAs: keep one primary action, demote the rest to secondary to sharpen hierarchy.",
|
||||
citations: [
|
||||
{ title: "Design System: CTA hierarchy", href: "#" },
|
||||
{ title: "UX principle: one primary per view", href: "#" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "motion",
|
||||
text: "Use motion only as feedback (hover, state changes, subtle reveal). Respect reduced-motion automatically.",
|
||||
citations: [
|
||||
{ title: "Motion guidelines", href: "#" },
|
||||
{ title: "Reduced motion support", href: "#" },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function AssistantRail() {
|
||||
const [prompt, setPrompt] = useState("Summarize how to improve this page’s hierarchy.");
|
||||
const [isGenerating, setIsGenerating] = useState(false);
|
||||
const [active, setActive] = useState<Suggestion | null>(seededSuggestions[0]);
|
||||
const [appliedIds, setAppliedIds] = useState<string[]>([]);
|
||||
const [lastAppliedId, setLastAppliedId] = useState<string | null>(null);
|
||||
const [showWhy, setShowWhy] = useState(false);
|
||||
|
||||
const appliedSet = useMemo(() => new Set(appliedIds), [appliedIds]);
|
||||
|
||||
function run() {
|
||||
setIsGenerating(true);
|
||||
window.setTimeout(() => {
|
||||
const promptLower = prompt.toLowerCase();
|
||||
const keywordMatch =
|
||||
promptLower.includes("motion") || promptLower.includes("animation")
|
||||
? "motion"
|
||||
: promptLower.includes("cta") || promptLower.includes("button")
|
||||
? "cta"
|
||||
: null;
|
||||
|
||||
const next =
|
||||
(keywordMatch ? seededSuggestions.find((s) => s.id === keywordMatch) : null) ??
|
||||
(() => {
|
||||
const currentIndex = seededSuggestions.findIndex((s) => s.id === (active?.id ?? seededSuggestions[0].id));
|
||||
const nextIndex = (currentIndex + 1) % seededSuggestions.length;
|
||||
return seededSuggestions[nextIndex];
|
||||
})();
|
||||
setActive(next);
|
||||
setShowWhy(false);
|
||||
setIsGenerating(false);
|
||||
}, 700);
|
||||
}
|
||||
|
||||
function apply() {
|
||||
if (!active || appliedSet.has(active.id)) return;
|
||||
setAppliedIds((prev) => [...prev, active.id]);
|
||||
setLastAppliedId(active.id);
|
||||
}
|
||||
|
||||
function undo() {
|
||||
if (!lastAppliedId) return;
|
||||
setAppliedIds((prev) => prev.filter((id) => id !== lastAppliedId));
|
||||
setLastAppliedId(null);
|
||||
}
|
||||
|
||||
function resetApplied() {
|
||||
if (!appliedIds.length) return;
|
||||
const ok = window.confirm("Clear applied items? This is just a demo of confirmation UI.");
|
||||
if (!ok) return;
|
||||
setAppliedIds([]);
|
||||
setLastAppliedId(null);
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.panel} aria-label="AI Assistant">
|
||||
<div className={styles.header}>
|
||||
<h2 className={styles.title}>Assistant Rail</h2>
|
||||
<div className={styles.disclosure}>
|
||||
<span className={styles.badge} title="This content is generated by AI. Review before applying.">
|
||||
AI-generated
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className={styles.hint}>
|
||||
Human-in-control: you can apply or undo changes. This is a starter UI pattern, not a full chatbot.
|
||||
</p>
|
||||
|
||||
<div className={styles.promptRow}>
|
||||
<input
|
||||
className={styles.input}
|
||||
value={prompt}
|
||||
onChange={(e) => setPrompt(e.target.value)}
|
||||
placeholder="Ask for a UI change…"
|
||||
aria-label="Prompt"
|
||||
/>
|
||||
<button className={`${styles.btn} ${styles.btnPrimary}`} type="button" onClick={run}>
|
||||
Ask
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className={styles.output} aria-live="polite">
|
||||
{isGenerating ? (
|
||||
<div className={styles.typing} aria-label="Generating">
|
||||
<span>Thinking</span>
|
||||
<span className={styles.dot} />
|
||||
<span className={styles.dot} />
|
||||
<span className={styles.dot} />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<p className={styles.text}>{active?.text}</p>
|
||||
<div className={styles.citations} aria-label="Citations">
|
||||
{(active?.citations ?? []).map((c, idx) => (
|
||||
<span key={c.title} className={styles.chip} title={c.title}>
|
||||
<span className={styles.chipNumber}>{idx + 1}</span>
|
||||
<a href={c.href}>{c.title}</a>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.whyRow}>
|
||||
<button className={styles.btn} type="button" onClick={() => setShowWhy((v) => !v)}>
|
||||
Why this?
|
||||
</button>
|
||||
</div>
|
||||
{showWhy ? (
|
||||
<p className={styles.hint}>
|
||||
This suggestion targets high-leverage UX: clearer hierarchy reduces cognitive load and makes the
|
||||
primary action obvious. It also reduces regret by keeping changes easy to apply/undo.
|
||||
</p>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.controls}>
|
||||
<div className={styles.controlRow}>
|
||||
<button className={styles.btn} type="button" onClick={apply} disabled={!active || appliedSet.has(active.id)}>
|
||||
Apply
|
||||
</button>
|
||||
<button className={styles.btn} type="button" onClick={undo} disabled={!lastAppliedId}>
|
||||
Undo
|
||||
</button>
|
||||
<button className={styles.btn} type="button" onClick={resetApplied} disabled={!appliedIds.length}>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className={styles.status} aria-live="polite">
|
||||
Applied:{" "}
|
||||
<span className={appliedIds.length ? styles.statusStrong : undefined}>{appliedIds.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
:root {
|
||||
--fd-bg: #0b0d10;
|
||||
--fd-surface: rgba(255, 255, 255, 0.06);
|
||||
--fd-ink: rgba(245, 244, 240, 0.96);
|
||||
--fd-muted: rgba(245, 244, 240, 0.66);
|
||||
--fd-accent: #d7ff3f;
|
||||
--fd-accent2: #68e0ff;
|
||||
--fd-radius: 20px;
|
||||
--fd-stroke: rgba(245, 244, 240, 0.14);
|
||||
--fd-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
|
||||
--fd-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
|
||||
}
|
||||
|
||||
.shell {
|
||||
position: relative;
|
||||
color: var(--fd-ink);
|
||||
border: 1px solid var(--fd-stroke);
|
||||
border-radius: var(--fd-radius);
|
||||
background:
|
||||
radial-gradient(1000px 300px at 20% 0%, rgba(104, 224, 255, 0.14), transparent 60%),
|
||||
radial-gradient(800px 340px at 85% 20%, rgba(215, 255, 63, 0.14), transparent 55%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
|
||||
box-shadow: var(--fd-shadow);
|
||||
overflow: clip;
|
||||
padding: 22px 20px;
|
||||
}
|
||||
|
||||
.shell::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
background:
|
||||
repeating-linear-gradient(
|
||||
135deg,
|
||||
rgba(245, 244, 240, 0.05),
|
||||
rgba(245, 244, 240, 0.05) 1px,
|
||||
transparent 1px,
|
||||
transparent 9px
|
||||
);
|
||||
opacity: 0.35;
|
||||
mix-blend-mode: soft-light;
|
||||
}
|
||||
|
||||
.head {
|
||||
position: relative;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid var(--fd-stroke);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.kicker {
|
||||
display: inline-flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
color: var(--fd-muted);
|
||||
}
|
||||
|
||||
.kicker::before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 999px;
|
||||
background: radial-gradient(circle at 35% 35%, var(--fd-accent), rgba(215, 255, 63, 0.2));
|
||||
box-shadow: 0 0 0 2px rgba(215, 255, 63, 0.12);
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 10px 0 6px;
|
||||
font-size: 28px;
|
||||
line-height: 1.05;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 0;
|
||||
max-width: 62ch;
|
||||
color: var(--fd-muted);
|
||||
line-height: 1.35;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid rgba(245, 244, 240, 0.12);
|
||||
border-radius: 16px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 14px 14px 12px;
|
||||
transform: translateY(0);
|
||||
transition: transform 280ms var(--fd-ease), border-color 280ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: rgba(215, 255, 63, 0.35);
|
||||
}
|
||||
|
||||
.cardTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.cardLabel {
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(245, 244, 240, 0.72);
|
||||
}
|
||||
|
||||
.cardHint {
|
||||
font-size: 12px;
|
||||
color: rgba(104, 224, 255, 0.8);
|
||||
}
|
||||
|
||||
.cardValue {
|
||||
margin-top: 12px;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.foot {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.cta {
|
||||
appearance: none;
|
||||
border: 1px solid rgba(245, 244, 240, 0.18);
|
||||
color: var(--fd-ink);
|
||||
background: rgba(0, 0, 0, 0.18);
|
||||
border-radius: 999px;
|
||||
padding: 12px 14px;
|
||||
display: inline-flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
transition: transform 220ms var(--fd-ease), border-color 220ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.cta:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(245, 244, 240, 0.34);
|
||||
}
|
||||
|
||||
.cta:focus-visible {
|
||||
outline: 3px solid rgba(104, 224, 255, 0.45);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.ctaText {
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.ctaIcon {
|
||||
color: var(--fd-accent);
|
||||
transform: translateX(0);
|
||||
transition: transform 220ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.cta:hover .ctaIcon {
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.title {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.card,
|
||||
.cta,
|
||||
.ctaIcon {
|
||||
transition: none;
|
||||
}
|
||||
.card:hover,
|
||||
.cta:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
import styles from "./DesignPanel.module.css";
|
||||
|
||||
type Stat = { label: string; value: string; hint?: string };
|
||||
|
||||
const defaultStats: Stat[] = [
|
||||
{ label: "Uptime", value: "99.98%", hint: "30d" },
|
||||
{ label: "Latency", value: "84ms", hint: "p95" },
|
||||
{ label: "Migrations", value: "12", hint: "this week" },
|
||||
];
|
||||
|
||||
export function DesignPanel({
|
||||
title = "System Brief",
|
||||
subtitle = "A compact panel designed for strong hierarchy and quick scanning.",
|
||||
stats = defaultStats,
|
||||
ctaLabel = "View details",
|
||||
}: {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
stats?: Stat[];
|
||||
ctaLabel?: string;
|
||||
}) {
|
||||
return (
|
||||
<section className={styles.shell} aria-label={title}>
|
||||
<div className={styles.head}>
|
||||
<div className={styles.kicker}>Field Report</div>
|
||||
<h2 className={styles.title}>{title}</h2>
|
||||
<p className={styles.subtitle}>{subtitle}</p>
|
||||
</div>
|
||||
|
||||
<div className={styles.grid} role="list">
|
||||
{stats.map((s) => (
|
||||
<article key={s.label} className={styles.card} role="listitem">
|
||||
<div className={styles.cardTop}>
|
||||
<div className={styles.cardLabel}>{s.label}</div>
|
||||
{s.hint ? <div className={styles.cardHint}>{s.hint}</div> : null}
|
||||
</div>
|
||||
<div className={styles.cardValue}>{s.value}</div>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className={styles.foot}>
|
||||
<button className={styles.cta} type="button">
|
||||
<span className={styles.ctaText}>{ctaLabel}</span>
|
||||
<span className={styles.ctaIcon} aria-hidden="true">
|
||||
→
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Avant Studio</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700&family=Newsreader:opsz,wght@6..72,400;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Skip to content</a>
|
||||
<div class="grain"></div>
|
||||
<header class="top-bar">
|
||||
<div class="logo">Avant Studio</div>
|
||||
<nav>
|
||||
<a href="#main">Work</a>
|
||||
<a href="#process">Process</a>
|
||||
<a href="#contact">Contact</a>
|
||||
</nav>
|
||||
<button class="cta">Start a project</button>
|
||||
</header>
|
||||
|
||||
<main id="main">
|
||||
<section class="hero">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Design lab</p>
|
||||
<h1>Striking, production-ready frontends without the generic glaze.</h1>
|
||||
<p class="lede">We craft visceral digital spaces that move fast, feel tactile, and stay memorable. Built with intent, tuned for launch.</p>
|
||||
<div class="actions">
|
||||
<button class="cta primary">See capabilities</button>
|
||||
<button class="ghost">View a live concept</button>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div><span>42</span> shipped sites</div>
|
||||
<div><span>95%</span> lighthouse perf</div>
|
||||
<div><span>0</span> generic templates</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-card reveal">
|
||||
<div class="tag">Now launching</div>
|
||||
<div class="card-body">
|
||||
<h2>Neon Observatory</h2>
|
||||
<p>A retro-futurist control room with live telemetry, aurora gradients, and glitch hover states.</p>
|
||||
<div class="pill">CSS Grid</div>
|
||||
<div class="pill">Framer Motion</div>
|
||||
<div class="pill">ARIA-first</div>
|
||||
<div class="line"></div>
|
||||
<div class="meta">
|
||||
<span>ETA: 2 weeks</span>
|
||||
<span>Visual QA locked</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid" id="process">
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">01 / Intent</p>
|
||||
<h3>Pick a bold narrative, define the signature move, lock the palette.</h3>
|
||||
<p>We interrogate purpose, audience, and constraints. Each build commits to one unmistakable gesture—stripe, glow, or grain—and sticks to it.</p>
|
||||
</article>
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">02 / Build</p>
|
||||
<h3>Real code: semantic HTML, layered CSS, purposeful motion.</h3>
|
||||
<p>CSS variables for theming, responsive grids, progressive enhancement. Animations gated by prefers-reduced-motion.</p>
|
||||
</article>
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">03 / Polish</p>
|
||||
<h3>Accessibility, performance, and tactile interactions.</h3>
|
||||
<p>Contrast checks, keyboard navigation, tuned shadows, intentional hover states. We avoid boilerplate aesthetics at all costs.</p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="timeline" id="contact">
|
||||
<div class="timeline-head">
|
||||
<p class="eyebrow">Field notes</p>
|
||||
<h3>Recent drops</h3>
|
||||
</div>
|
||||
<div class="timeline-rail">
|
||||
<div class="dot"></div>
|
||||
<div class="dot"></div>
|
||||
<div class="dot"></div>
|
||||
</div>
|
||||
<div class="timeline-items">
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2024</p>
|
||||
<h4>Aerial atlas</h4>
|
||||
<p>Editorial map portal with split-screen narrative and scroll-synced chapters.</p>
|
||||
</div>
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2023</p>
|
||||
<h4>Glassfoundry</h4>
|
||||
<p>Industrial dashboard with translucent panels, border glows, and live system vitals.</p>
|
||||
</div>
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2022</p>
|
||||
<h4>Islands</h4>
|
||||
<p>Pastel travel companion with hand-drawn dividers, slow float animations, and tactile cards.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="marquee" aria-hidden="true">
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
</div>
|
||||
<div class="footer-grid">
|
||||
<div>
|
||||
<p class="eyebrow">Contact</p>
|
||||
<a href="mailto:hello@avant.studio">hello@avant.studio</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="eyebrow">Social</p>
|
||||
<a href="#">Are.na</a>
|
||||
<a href="#">Behance</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="eyebrow">Collab</p>
|
||||
<p>We ship components, pages, systems, and microsites.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="./script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
const observer = new IntersectionObserver(
|
||||
entries => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('visible');
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: 0.2 }
|
||||
);
|
||||
|
||||
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
|
||||
@@ -0,0 +1,425 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700&family=Newsreader:opsz,wght@6..72,400;600&display=swap');
|
||||
|
||||
:root {
|
||||
--bg: #0b0c10;
|
||||
--fg: #f6f1e6;
|
||||
--muted: #a7acba;
|
||||
--accent: #ff6b4a;
|
||||
--accent-2: #6b9bff;
|
||||
--card: rgba(255, 255, 255, 0.03);
|
||||
--stroke: rgba(255, 255, 255, 0.12);
|
||||
--radius: 18px;
|
||||
--shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
|
||||
--ease: cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Newsreader', 'Times New Roman', serif;
|
||||
color: var(--fg);
|
||||
background: var(--bg);
|
||||
min-height: 100vh;
|
||||
line-height: 1.7;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background-image:
|
||||
radial-gradient(1200px at 15% 20%, rgba(107, 155, 255, 0.25), transparent 50%),
|
||||
radial-gradient(1400px at 80% 0%, rgba(255, 107, 74, 0.2), transparent 50%),
|
||||
linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
|
||||
}
|
||||
|
||||
.grain {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
background:
|
||||
radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 35%),
|
||||
repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 3px);
|
||||
mix-blend-mode: soft-light;
|
||||
opacity: 0.7;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: -999px;
|
||||
top: 0;
|
||||
padding: 12px 16px;
|
||||
background: var(--accent);
|
||||
color: #0b0c10;
|
||||
border-radius: 8px;
|
||||
font-weight: 700;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
left: 16px;
|
||||
top: 16px;
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 18px 36px;
|
||||
backdrop-filter: blur(10px);
|
||||
background: rgba(11, 12, 16, 0.75);
|
||||
border-bottom: 1px solid var(--stroke);
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: 'Bricolage Grotesque', 'Arial Black', sans-serif;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
gap: 18px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
nav a {
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid transparent;
|
||||
transition: border-color 220ms var(--ease), color 220ms var(--ease);
|
||||
}
|
||||
|
||||
nav a:hover,
|
||||
nav a:focus-visible {
|
||||
border-color: var(--stroke);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
button {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-weight: 700;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cta {
|
||||
padding: 12px 18px;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(120deg, var(--accent), var(--accent-2));
|
||||
color: #0b0c10;
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
|
||||
transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
|
||||
}
|
||||
|
||||
.cta:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.hero {
|
||||
display: grid;
|
||||
grid-template-columns: 1.2fr 0.8fr;
|
||||
gap: 32px;
|
||||
padding: 96px 36px 48px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hero-copy h1 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-size: clamp(2.4rem, 5vw, 3.6rem);
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.03em;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.hero .lede {
|
||||
max-width: 56ch;
|
||||
color: var(--muted);
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.18em;
|
||||
font-size: 0.78rem;
|
||||
color: var(--accent);
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 24px 0 18px;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
padding: 12px 16px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
border: 1.5px solid var(--stroke);
|
||||
color: var(--fg);
|
||||
transition: border-color 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease);
|
||||
}
|
||||
|
||||
.ghost:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 20px;
|
||||
color: var(--muted);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.stats span {
|
||||
display: block;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-size: 1.5rem;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.hero-card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: 22px;
|
||||
padding: 24px;
|
||||
box-shadow: var(--shadow);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero-card::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -30%;
|
||||
background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.04), transparent 45%);
|
||||
transform: rotate(8deg);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.hero-card .tag {
|
||||
display: inline-block;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
color: var(--accent);
|
||||
font-size: 0.85rem;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-card .card-body {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-card h2 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
margin: 12px 0 8px;
|
||||
}
|
||||
|
||||
.hero-card p {
|
||||
color: var(--muted);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.pill {
|
||||
display: inline-block;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid var(--stroke);
|
||||
margin: 4px 6px 4px 0;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 16px 0;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, var(--accent), transparent);
|
||||
}
|
||||
|
||||
.meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 18px;
|
||||
padding: 48px 36px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: var(--radius);
|
||||
padding: 22px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
|
||||
}
|
||||
|
||||
.panel h3 {
|
||||
margin: 6px 0 10px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
}
|
||||
|
||||
.panel p {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.timeline {
|
||||
padding: 24px 36px 80px;
|
||||
border-top: 1px solid var(--stroke);
|
||||
}
|
||||
|
||||
.timeline-head h3 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
margin: 8px 0 16px;
|
||||
}
|
||||
|
||||
.timeline-rail {
|
||||
position: relative;
|
||||
height: 3px;
|
||||
background: var(--stroke);
|
||||
border-radius: 999px;
|
||||
margin: 24px 0 32px;
|
||||
}
|
||||
|
||||
.timeline-rail .dot {
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
background: var(--accent);
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0 6px rgba(255, 107, 74, 0.15);
|
||||
}
|
||||
|
||||
.timeline-rail .dot:nth-child(1) { left: 8%; }
|
||||
.timeline-rail .dot:nth-child(2) { left: 50%; }
|
||||
.timeline-rail .dot:nth-child(3) { left: 88%; }
|
||||
|
||||
.timeline-items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.timeline-card {
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.timeline-card .label {
|
||||
font-size: 0.9rem;
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--accent);
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.timeline-card h4 {
|
||||
margin: 4px 0 8px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
}
|
||||
|
||||
.timeline-card p {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid var(--stroke);
|
||||
padding: 28px 36px 48px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.marquee {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
gap: 16px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.14em;
|
||||
color: var(--muted);
|
||||
animation: scroll 18s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes scroll {
|
||||
from { transform: translateX(0); }
|
||||
to { transform: translateX(-50%); }
|
||||
}
|
||||
|
||||
.footer-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.footer-grid a {
|
||||
display: block;
|
||||
color: var(--fg);
|
||||
text-decoration: underline;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.reveal {
|
||||
opacity: 0;
|
||||
transform: translateY(22px);
|
||||
transition: transform 320ms var(--ease), opacity 320ms var(--ease);
|
||||
}
|
||||
|
||||
.reveal.visible {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
padding-top: 72px;
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.actions {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
# Aesthetic Playbook
|
||||
|
||||
Pick ONE direction and commit. Swap colors/fonts if needed, but keep the intent. Choose a single **signature move** that someone will remember.
|
||||
|
||||
## Font Rule (avoid default vibes)
|
||||
- If the repo already has a font system, stay consistent unless asked to change it.
|
||||
- Otherwise: pick a characterful display font + a legible body font. Avoid overused “default tech” pairings.
|
||||
|
||||
## Brutalist Raw (high-contrast, rule-heavy)
|
||||
- Fonts: Display `Bricolage Grotesque` / `Fraunces`; Body `Atkinson Hyperlegible` / `IBM Plex Sans`; Mono `IBM Plex Mono`.
|
||||
- Colors: Ink/ivory with one acidic accent (e.g. tomato, chartreuse).
|
||||
- Signature moves: oversized numeric index badges; thick 2px rules; hard invert hover.
|
||||
- Backgrounds: checkerboard corner, dotted matrix, a single diagonal stripe.
|
||||
|
||||
## Editorial / Magazine (luxury, typographic hierarchy)
|
||||
- Fonts: Display `Instrument Serif` / `Cormorant Garamond`; Body `Source Serif 4` / `Newsreader`; Mono `DM Mono`.
|
||||
- Colors: warm off-white, deep ink, one burnt accent (rust/saffron).
|
||||
- Signature moves: pull-quote rail; hairline rules; “issue number” metadata strip.
|
||||
- Backgrounds: subtle paper grain, soft vignette.
|
||||
|
||||
## Techno-Gothic (dark, minimal, sharp accents)
|
||||
- Fonts: Display `Unbounded` / `Syne`; Body `Work Sans` / `Barlow`; Mono `JetBrains Mono`.
|
||||
- Colors: near-black base with cold accent (cyan/acid green) + muted steel.
|
||||
- Signature moves: corner ticks, scanline sheen on hover, “system status” chips.
|
||||
- Backgrounds: diagonal hatch, faint grid, tiny starfield.
|
||||
|
||||
## Neo-Poster (bold blocks, loud hierarchy)
|
||||
- Fonts: Display `Bebas Neue` / `Archivo Black`; Body `Noto Sans`; Mono `Space Mono` (only if it fits the concept).
|
||||
- Colors: high-sat primaries on warm neutral, with black rules.
|
||||
- Signature moves: torn-paper edge (CSS mask vibe); huge headline with tight tracking; sticker CTA.
|
||||
- Backgrounds: halftone dot field, off-register shadows.
|
||||
|
||||
## Soft Craft (warm, tactile, friendly)
|
||||
- Fonts: Display `Sora` / `Epilogue`; Body `Alegreya Sans` / `Manrope`; Mono optional.
|
||||
- Colors: warm cream, terracotta accent, sage secondary.
|
||||
- Signature moves: stitched borders; stacked cards; gentle floating blobs (reduced-motion safe).
|
||||
- Backgrounds: irregular gradient blobs + low-opacity noise.
|
||||
|
||||
## Industrial / Utilitarian (labeled panels, measured density)
|
||||
- Fonts: Display `Archivo` / `Anton`; Body `Barlow` / `IBM Plex Sans`; Mono `JetBrains Mono`.
|
||||
- Colors: cold neutrals with hazard accent (amber) and a secondary teal.
|
||||
- Signature moves: panel labels; coordinate tags; “spec table” sectioning.
|
||||
- Backgrounds: repeating hatch, soft inner glows for depth.
|
||||
|
||||
## How to Choose (fast)
|
||||
1) Choose the emotional goal (luxe, raw, calm, severe, playful).
|
||||
2) Pick type first (display sets the tone).
|
||||
3) Pick one signature move and apply it in 2–3 places max.
|
||||
4) Keep everything else quiet and supportive.
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# AI-native UI Patterns (trust + control)
|
||||
|
||||
AI UI should feel like a product feature, not a bolt-on chatbot. Prioritize clarity, trust, and user control.
|
||||
|
||||
## Core patterns
|
||||
|
||||
### Copilot side panel (assistive AI)
|
||||
- Persistent panel (often right rail) with:
|
||||
- header + **AI disclosure**
|
||||
- prompt input (or command chips/templates)
|
||||
- output stream area
|
||||
- actions (apply, copy, discard)
|
||||
|
||||
### AI-generated labeling (strict)
|
||||
- AI output must not be visually confused with user-authored content.
|
||||
- Use a badge/label (“AI-generated”) with tooltip text and/or subtle tinting.
|
||||
|
||||
### Citations / sources (recommended for factual outputs)
|
||||
- Render as chips or footnotes under the relevant block.
|
||||
- Make them clickable and scannable (title + optional section anchor).
|
||||
|
||||
### “Why this?” affordance
|
||||
- Provide a short “why this suggestion?” expansion with neutral language.
|
||||
- Prefer concrete reasons (policy, data, heuristic) over anthropomorphic phrasing.
|
||||
|
||||
## Human-in-the-loop (strict)
|
||||
- Provide at least one of:
|
||||
- **Apply / Undo**
|
||||
- **Accept / Reject**
|
||||
- confirmation for destructive actions
|
||||
- Never silently perform irreversible changes.
|
||||
|
||||
## AI loading and motion
|
||||
- Use subtle, purposeful indicators:
|
||||
- typing dots, shimmer skeleton, progressive reveal
|
||||
- Respect `prefers-reduced-motion` (no endless animated flourish).
|
||||
|
||||
## Signature move ideas (pick one)
|
||||
- Citation rail (chips aligned to the right edge of the answer)
|
||||
- Apply stack (queued changes with an “apply all” + per-item undo)
|
||||
- Confidence capsule (uncertainty/assumptions shown as compact pills)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Anti-Patterns (avoid “AI slop”)
|
||||
|
||||
Use this as a quick filter before shipping.
|
||||
|
||||
## Visual clichés
|
||||
- Generic purple-on-white gradients with soft glass cards everywhere.
|
||||
- Samey startup landing layout: centered hero, 3 cards, logo wall, FAQ, identical CTA band.
|
||||
- Indiscriminate glow + blur layers that reduce legibility.
|
||||
|
||||
## Typography defaults
|
||||
- Unintentional type: no scale, no rhythm, headings too close in size to body.
|
||||
- Mixing too many fonts “because it looks cool” (unless the direction is explicitly chaotic).
|
||||
- Defaulting to the same trendy “safe” font pairings (e.g., the usual modern grotesks) when the project calls for a stronger voice.
|
||||
|
||||
## Motion mistakes
|
||||
- Random micro-animations everywhere instead of one orchestrated sequence.
|
||||
- No `prefers-reduced-motion` handling.
|
||||
- Hover-only affordances (mobile users get nothing).
|
||||
|
||||
## UX/a11y misses
|
||||
- Weak focus states, low contrast, tiny hit targets.
|
||||
- Buttons styled as links (or vice versa) without correct semantics.
|
||||
- Missing labels on inputs, icon-only actions without accessible names.
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
# Implementation Patterns
|
||||
|
||||
Use these patterns to move quickly while keeping the aesthetic sharp. Prefer real code and real semantics over “design vibes”.
|
||||
|
||||
## Decision: Vanilla vs React
|
||||
- Use **vanilla** for quick concepts, single pages, marketing-style layouts.
|
||||
- Use **React** when the UI lives inside an app, needs state, routes, or reusable components.
|
||||
|
||||
## Vanilla HTML/CSS/JS Workflow
|
||||
- Start with semantic structure: `header`, `main`, `section`, `article`, `footer`.
|
||||
- Add skip links when there’s a nav/header: `a.skip-nav` → `#main`.
|
||||
- Define theme tokens up top:
|
||||
```css
|
||||
:root {
|
||||
--bg: #0b0c10;
|
||||
--surface: #10131a;
|
||||
--fg: #f7f2e9;
|
||||
--muted: #9aa1b5;
|
||||
--accent: #ff6b4a;
|
||||
--radius: 18px;
|
||||
--shadow: 0 18px 40px rgba(0,0,0,0.35);
|
||||
--ease: cubic-bezier(.2,.9,.2,1);
|
||||
}
|
||||
```
|
||||
- Layout: Grid for macro, Flexbox for clusters. Break the grid deliberately but preserve reading order.
|
||||
- Motion: prefer CSS keyframes + `transition`. Orchestrate a few moments (load + hover), not everything.
|
||||
- Reveal animations: use IntersectionObserver to toggle classes (small JS only).
|
||||
|
||||
## React Patterns (TypeScript)
|
||||
- Keep components small: `Hero`, `FeatureList`, `SpecsRail`, `CTA`.
|
||||
- Use data arrays for repeated UI (cards/steps/metrics) and map to components.
|
||||
- Styling: prefer the repo’s existing approach. If unknown, CSS Modules is a safe default.
|
||||
- Motion: keep durations < 500ms; stagger by 80–140ms; gate everything with reduced-motion.
|
||||
|
||||
## Motion & Reduced Motion
|
||||
- Always include a reduced-motion fallback:
|
||||
```css
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
|
||||
}
|
||||
```
|
||||
- Keep animations paint-friendly (transform/opacity). Avoid animating large blur shadows.
|
||||
|
||||
## Layout & Spacing
|
||||
- Use a spacing scale (4/8 base). Keep prose line-length ~68–76ch.
|
||||
- If maximalist: constrain chaos inside frames. If minimal: increase margins and tighten hierarchy.
|
||||
|
||||
## Texture & Backgrounds (CSS-only)
|
||||
- Use layered gradients and subtle noise-like patterns (no heavy assets by default).
|
||||
- Prefer subtle grain overlays over full-page blur.
|
||||
|
||||
## QA Checklist
|
||||
- One `h1`, logical heading order, landmarks present.
|
||||
- Focus visible, keyboard usable, contrast AA+.
|
||||
- Tap targets 44px minimum for primary interactions.
|
||||
- Mobile layout feels intentional (not just “stack everything”).
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# React + Next.js Best Practices (concise)
|
||||
|
||||
## React component design
|
||||
- Keep components and Hooks pure: compute UI from props/state without side effects in render.
|
||||
- Run side effects outside render (event handlers or Effects).
|
||||
- Prefer event handlers for user-driven work; avoid “Effect for everything.”
|
||||
- Follow the Rules of Hooks (top-level only; consistent call order; only in React functions).
|
||||
- Don’t call component functions directly; use JSX so React controls rendering.
|
||||
- Split large components into small, focused pieces; keep props stable and typed.
|
||||
|
||||
## Next.js App Router
|
||||
- Server Components by default; add `"use client"` only when you need state, effects, or browser APIs.
|
||||
- Keep Client Components small and isolated (UI islands).
|
||||
- Use `next/link` for navigation and `next/image` for real images.
|
||||
- Prefer `next/font` when changing typography to avoid layout shift/FOIT.
|
||||
|
||||
## Data fetching and caching
|
||||
- Prefer server-side `fetch` and explicit caching with `cache`/`revalidate`.
|
||||
- Avoid client-side fetch inside `useEffect` unless you truly need client-only data.
|
||||
- Keep loading/error states explicit and user-friendly.
|
||||
|
||||
## State and performance
|
||||
- Minimize global state; lift only when necessary.
|
||||
- Memoize expensive calculations; keep derived state computed, not stored.
|
||||
- Avoid unnecessary re-renders by splitting components and using stable props.
|
||||
Reference in new issue
Block a user