picasso-skill 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,174 @@
1
+ # Color and Contrast Reference
2
+
3
+ ## Table of Contents
4
+ 1. Color Space and Manipulation
5
+ 2. Palette Construction
6
+ 3. Tinted Neutrals
7
+ 4. Dark Mode
8
+ 5. Accessibility
9
+ 6. CSS Variables Pattern
10
+ 7. Common Mistakes
11
+
12
+ ---
13
+
14
+ ## 1. Color Space and Manipulation
15
+
16
+ Use OKLCH for perceptually uniform color. Unlike HSL, OKLCH ensures that colors at the same lightness value actually appear equally bright to the human eye.
17
+
18
+ ```css
19
+ /* OKLCH: lightness (0-1), chroma (0-0.4), hue (0-360) */
20
+ --accent: oklch(0.65 0.25 25); /* vibrant red-orange */
21
+ --accent-hover: oklch(0.60 0.28 25); /* darker, more saturated */
22
+ --accent-muted: oklch(0.75 0.08 25); /* same hue, much less chroma */
23
+ ```
24
+
25
+ For programmatic palette generation, adjust lightness for tints/shades, chroma for saturation, and hue for variation. OKLCH makes this predictable.
26
+
27
+ ---
28
+
29
+ ## 2. Palette Construction
30
+
31
+ ### The 60-30-10 Rule
32
+ - 60% dominant (surface/background)
33
+ - 30% secondary (cards, sections, supporting elements)
34
+ - 10% accent (CTAs, active states, highlights)
35
+
36
+ ### Building a Palette
37
+ 1. Start with the accent color (the brand or action color)
38
+ 2. Derive a surface color: very low chroma version of the accent hue
39
+ 3. Build neutral scale: tinted toward the accent hue (never pure gray)
40
+ 4. Add a semantic layer: success (green family), warning (amber), error (red), info (blue)
41
+ 5. Generate dark mode variants by inverting the lightness scale, not the colors
42
+
43
+ ### Token Structure
44
+ ```css
45
+ :root {
46
+ /* Surfaces */
47
+ --surface-0: oklch(0.99 0.005 80); /* page background */
48
+ --surface-1: oklch(0.97 0.008 80); /* card background */
49
+ --surface-2: oklch(0.94 0.01 80); /* elevated/hover surface */
50
+ --surface-3: oklch(0.90 0.012 80); /* active/selected surface */
51
+
52
+ /* Text */
53
+ --text-primary: oklch(0.15 0.02 80);
54
+ --text-secondary: oklch(0.40 0.02 80);
55
+ --text-tertiary: oklch(0.55 0.015 80);
56
+
57
+ /* Accent */
58
+ --accent: oklch(0.55 0.25 30);
59
+ --accent-hover: oklch(0.50 0.28 30);
60
+ --accent-subtle: oklch(0.92 0.04 30);
61
+
62
+ /* Borders */
63
+ --border: oklch(0.88 0.01 80);
64
+ --border-strong: oklch(0.78 0.015 80);
65
+
66
+ /* Semantic */
67
+ --success: oklch(0.55 0.18 145);
68
+ --warning: oklch(0.65 0.18 70);
69
+ --error: oklch(0.55 0.22 25);
70
+ }
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 3. Tinted Neutrals
76
+
77
+ Never use pure gray (#808080, rgb(128,128,128), etc.). Always tint neutrals toward the dominant hue of the palette. This creates warmth and cohesion.
78
+
79
+ **Warm neutrals** (tinted toward amber/brown): suited for editorial, luxury, organic brands
80
+ **Cool neutrals** (tinted toward blue/slate): suited for tech, data, professional tools
81
+ **Neutral neutrals** (tinted toward the accent hue at very low chroma): the most versatile approach
82
+
83
+ ```css
84
+ /* Instead of #333333 */
85
+ --text-primary: oklch(0.25 0.015 260); /* cool-tinted dark */
86
+
87
+ /* Instead of #f5f5f5 */
88
+ --surface-bg: oklch(0.97 0.005 260); /* cool-tinted light */
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 4. Dark Mode
94
+
95
+ Dark mode is not "invert everything." Follow these rules:
96
+
97
+ 1. Surface colors get darker but retain their hue tint
98
+ 2. Text colors flip but never become pure white (use oklch lightness 0.93-0.97)
99
+ 3. Accent colors often need a lightness bump (+0.05 to +0.10) to maintain contrast
100
+ 4. Shadows become less visible on dark surfaces; use subtle inner glows or border effects instead
101
+ 5. Elevation in dark mode goes lighter (higher surfaces are lighter), opposite of light mode
102
+ 6. Images and illustrations may need reduced brightness/contrast (`filter: brightness(0.9)`)
103
+
104
+ ```css
105
+ [data-theme="dark"] {
106
+ --surface-0: oklch(0.13 0.01 260);
107
+ --surface-1: oklch(0.17 0.012 260);
108
+ --surface-2: oklch(0.21 0.015 260);
109
+ --text-primary: oklch(0.93 0.01 260);
110
+ --text-secondary: oklch(0.70 0.01 260);
111
+ --border: oklch(0.25 0.01 260);
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 5. Accessibility
118
+
119
+ ### Contrast Requirements (WCAG 2.2)
120
+ - Normal text (<24px or <18.66px bold): 4.5:1 minimum
121
+ - Large text (>=24px or >=18.66px bold): 3:1 minimum
122
+ - UI components and graphical objects: 3:1 minimum
123
+ - Focus indicators: 3:1 against adjacent colors
124
+
125
+ ### Testing
126
+ Use OKLCH lightness difference as a quick heuristic: a difference of 0.40+ between text and background lightness values usually passes AA. For precise checking, use the APCA (Advanced Perceptual Contrast Algorithm) when possible, as it better represents human perception than WCAG 2.x contrast ratios.
127
+
128
+ ### Color Blindness
129
+ Never use color as the only way to convey information. Pair color with icons, patterns, or text labels. Test palettes with a deuteranopia/protanopia simulator.
130
+
131
+ ---
132
+
133
+ ## 6. CSS Variables Pattern
134
+
135
+ Define all colors as CSS custom properties. Group by function, not by color name.
136
+
137
+ ```css
138
+ /* Good: semantic naming */
139
+ --color-surface: ...;
140
+ --color-text: ...;
141
+ --color-accent: ...;
142
+ --color-border: ...;
143
+
144
+ /* Bad: literal naming */
145
+ --blue: ...;
146
+ --dark-gray: ...;
147
+ --light-blue: ...;
148
+ ```
149
+
150
+ For component-level overrides:
151
+ ```css
152
+ .card {
153
+ --card-bg: var(--surface-1);
154
+ --card-border: var(--border);
155
+ background: var(--card-bg);
156
+ border: 1px solid var(--card-border);
157
+ }
158
+ .card.highlighted {
159
+ --card-bg: var(--accent-subtle);
160
+ --card-border: var(--accent);
161
+ }
162
+ ```
163
+
164
+ ---
165
+
166
+ ## 7. Common Mistakes
167
+
168
+ - Using pure black (#000) for text (use tinted near-black instead)
169
+ - Using gray text on colored backgrounds (low contrast, hard to read)
170
+ - Applying opacity to achieve lighter colors (makes elements look washed out; use chroma reduction instead)
171
+ - Using too many accent colors (one primary accent, one secondary maximum)
172
+ - Forgetting to test dark mode after building light mode
173
+ - Using brand colors at full saturation for large surfaces (they vibrate and cause eye strain; reserve full chroma for small accents)
174
+ - Not providing hover/focus states with visible color change
@@ -0,0 +1,113 @@
1
+ # Component Patterns Reference
2
+
3
+ Standard component taxonomy, naming conventions, and state patterns drawn from 90+ real-world design systems and 2,500+ implementations (sourced from component.gallery).
4
+
5
+ ## Standard Component Names
6
+
7
+ Use these names consistently. When building a component, check this list first. Do not invent new names for solved patterns.
8
+
9
+ ### Navigation
10
+ - **Navbar / Navigation Bar**: Top-level site navigation. Contains logo, links, actions.
11
+ - **Sidebar / Side Navigation**: Vertical navigation panel, typically on the left.
12
+ - **Breadcrumb**: Shows the user's location in a hierarchy. e.g., Home > Products > Shoes.
13
+ - **Tabs**: Horizontal set of toggles for switching between views within a section.
14
+ - **Pagination**: Controls for navigating between pages of content.
15
+ - **Bottom Navigation / Tab Bar**: Mobile-only bottom navigation with 3-5 icon+label items.
16
+ - **Menu / Dropdown Menu**: A list of options revealed on click, typically from a button.
17
+ - **Command Palette / Command Menu**: Keyboard-driven search-and-action overlay (Cmd+K pattern).
18
+
19
+ ### Content
20
+ - **Card**: A bounded container for a unit of content (image, title, description, action).
21
+ - **Accordion / Disclosure**: Expandable/collapsible sections in a vertical stack.
22
+ - **Carousel / Slider**: Multiple slides navigated via swipe, scroll, or buttons.
23
+ - **Table / Data Table**: Structured rows and columns for tabular data.
24
+ - **List / List Item**: Ordered or unordered vertical sequence of items.
25
+ - **Tree View**: Nested hierarchical content (file explorer, category browser).
26
+ - **Timeline**: Chronological sequence of events.
27
+ - **Empty State**: Placeholder shown when a section has no content yet.
28
+
29
+ ### Input
30
+ - **Text Input / Text Field**: Single-line text entry.
31
+ - **Textarea**: Multi-line text entry.
32
+ - **Select / Dropdown**: Choose one option from a list.
33
+ - **Combobox / Autocomplete**: Text input with filtered dropdown suggestions.
34
+ - **Checkbox**: Binary on/off selection (multiple selections allowed).
35
+ - **Radio / Radio Group**: Select exactly one option from a set.
36
+ - **Toggle / Switch**: Binary on/off with immediate effect (no form submission needed).
37
+ - **Slider / Range**: Select a value within a numeric range by dragging.
38
+ - **Date Picker**: Calendar-based date selection.
39
+ - **File Upload**: Interface for selecting and uploading files.
40
+ - **Search Input**: Text input with search semantics (clear button, submit on enter).
41
+
42
+ ### Feedback
43
+ - **Alert / Banner**: Non-interactive message at the top of a page or section.
44
+ - **Toast / Snackbar**: Temporary notification that auto-dismisses. Bottom of screen.
45
+ - **Modal / Dialog**: Overlay requiring user attention before returning to the page.
46
+ - **Popover**: Small overlay anchored to a trigger element, often for contextual info.
47
+ - **Tooltip**: Brief label shown on hover/focus, never interactive.
48
+ - **Progress Bar**: Linear indicator of completion (determinate or indeterminate).
49
+ - **Spinner / Loading Indicator**: Circular animation indicating a pending operation.
50
+ - **Skeleton / Placeholder**: Gray shapes matching expected content layout during load.
51
+ - **Badge / Tag / Chip**: Small label for status, category, or count.
52
+
53
+ ### Actions
54
+ - **Button**: Primary interactive element for triggering actions.
55
+ - **Icon Button**: Button with only an icon (must have aria-label).
56
+ - **Button Group**: Set of related buttons displayed together.
57
+ - **Floating Action Button (FAB)**: Prominent circular button for the primary action (mobile).
58
+ - **Link / Anchor**: Navigation to another page or resource.
59
+
60
+ ### Layout
61
+ - **Container**: Max-width wrapper centering content on the page.
62
+ - **Divider / Separator**: Visual line separating content sections.
63
+ - **Grid**: Multi-column layout system.
64
+ - **Stack**: Vertical or horizontal arrangement with consistent spacing.
65
+ - **Aspect Ratio**: Container maintaining a fixed width:height ratio.
66
+
67
+ ## Component State Matrix
68
+
69
+ Every interactive component needs these states defined:
70
+
71
+ | State | Visual Treatment |
72
+ |---|---|
73
+ | Default | Base appearance |
74
+ | Hover | Subtle change: background lightens/darkens, cursor changes |
75
+ | Focus | High-contrast outline (2px accent, 2px offset) |
76
+ | Active / Pressed | Slight scale-down (0.97-0.98), darkened background |
77
+ | Disabled | 50% opacity, cursor: not-allowed, no hover/focus effects |
78
+ | Loading | Spinner or skeleton replacing content, pointer-events: none |
79
+ | Error | Error-colored border, inline error message |
80
+ | Selected / Active | Accent background or border, checkmark indicator |
81
+ | Dragging | Elevated shadow, slight rotation, reduced opacity on source |
82
+
83
+ ## Compound Component Pattern
84
+
85
+ For components with multiple sub-parts, use the dot notation compound pattern:
86
+
87
+ ```tsx
88
+ <Dialog>
89
+ <Dialog.Trigger>Open</Dialog.Trigger>
90
+ <Dialog.Content>
91
+ <Dialog.Title>Confirm</Dialog.Title>
92
+ <Dialog.Description>Are you sure?</Dialog.Description>
93
+ <Dialog.Footer>
94
+ <Dialog.Close>Cancel</Dialog.Close>
95
+ <Button>Confirm</Button>
96
+ </Dialog.Footer>
97
+ </Dialog.Content>
98
+ </Dialog>
99
+ ```
100
+
101
+ This pattern appears in: Radix UI, shadcn/ui, Headless UI, Reach UI, Ark UI.
102
+
103
+ ## Component Sizing Convention
104
+
105
+ Use a consistent sizing scale across all components:
106
+
107
+ | Size | Height | Font Size | Padding | Use Case |
108
+ |---|---|---|---|---|
109
+ | xs | 28px | 12px | 4px 8px | Dense UIs, inline tags |
110
+ | sm | 32px | 13px | 6px 12px | Secondary actions, compact forms |
111
+ | md | 40px | 14px | 8px 16px | Default for most components |
112
+ | lg | 48px | 16px | 12px 24px | Primary actions, hero sections |
113
+ | xl | 56px | 18px | 16px 32px | Landing page CTAs |
@@ -0,0 +1,176 @@
1
+ # Design System Reference
2
+
3
+ ## Table of Contents
4
+ 1. DESIGN.md Format
5
+ 2. Theme Generation
6
+ 3. Token Structure
7
+ 4. Pre-Built Themes
8
+
9
+ ---
10
+
11
+ ## 1. DESIGN.md Format
12
+
13
+ When generating a design system document, follow this structure (derived from the Google Stitch DESIGN.md format, extended by VoltAgent):
14
+
15
+ ```markdown
16
+ # DESIGN.md
17
+
18
+ ## 1. Visual Theme & Atmosphere
19
+ Describe the mood, density, and design philosophy. Is this minimal or dense?
20
+ Warm or cold? Playful or serious? What existing products or aesthetics does it
21
+ reference?
22
+
23
+ ## 2. Color Palette & Roles
24
+ | Token | Hex | Role |
25
+ |---|---|---|
26
+ | surface-primary | #fafaf9 | Page background |
27
+ | surface-secondary | #f5f5f4 | Card/section background |
28
+ | text-primary | #1c1917 | Headings and body text |
29
+ | text-secondary | #57534e | Supporting text, labels |
30
+ | accent | #dc2626 | CTAs, active states, links |
31
+ | accent-hover | #b91c1c | Hover state for accent |
32
+ | accent-subtle | #fef2f2 | Accent-tinted background |
33
+ | border | #e7e5e4 | Default borders |
34
+ | success | #16a34a | Success states |
35
+ | warning | #d97706 | Warning states |
36
+ | error | #dc2626 | Error states |
37
+
38
+ ## 3. Typography Rules
39
+ | Level | Font | Size | Weight | Line Height | Letter Spacing |
40
+ |---|---|---|---|---|---|
41
+ | Display | [Display Font] | 3rem | 700 | 1.1 | -0.02em |
42
+ | H1 | [Display Font] | 2.25rem | 700 | 1.15 | -0.01em |
43
+ | H2 | [Display Font] | 1.875rem | 600 | 1.2 | -0.01em |
44
+ | H3 | [Body Font] | 1.5rem | 600 | 1.25 | 0 |
45
+ | Body | [Body Font] | 1rem | 400 | 1.6 | 0 |
46
+ | Small | [Body Font] | 0.875rem | 400 | 1.5 | 0 |
47
+ | Caption | [Body Font] | 0.75rem | 500 | 1.4 | 0.02em |
48
+ | Code | [Mono Font] | 0.875rem | 400 | 1.6 | 0 |
49
+
50
+ ## 4. Component Styling
51
+ ### Buttons
52
+ | Variant | Background | Text | Border | Radius | Padding |
53
+ |---|---|---|---|---|---|
54
+ | Primary | accent | white | none | 8px | 12px 24px |
55
+ | Secondary | transparent | text-primary | 1px border | 8px | 12px 24px |
56
+ | Ghost | transparent | text-secondary | none | 8px | 12px 24px |
57
+ | Destructive | error | white | none | 8px | 12px 24px |
58
+
59
+ States: hover (darken bg 5%), active (darken 10%, scale 0.98), disabled (opacity 0.5), focus (2px accent outline, 2px offset).
60
+
61
+ ### Cards
62
+ Background: surface-secondary. Border: 1px border. Radius: 12px.
63
+ Padding: 24px. Shadow: 0 1px 3px rgba(0,0,0,0.05).
64
+ Hover: shadow increases to 0 4px 12px rgba(0,0,0,0.08).
65
+
66
+ ### Inputs
67
+ Height: 44px. Border: 1px border. Radius: 8px. Padding: 0 12px.
68
+ Focus: 2px accent border, subtle accent glow.
69
+ Error: error border, error message below.
70
+ Disabled: opacity 0.5, cursor not-allowed.
71
+
72
+ ### Navigation
73
+ Describe the navigation pattern (sidebar, top bar, tabs) with specific dimensions,
74
+ colors, and active/hover states.
75
+
76
+ ## 5. Layout Principles
77
+ Spacing scale: 4, 8, 12, 16, 24, 32, 48, 64, 96.
78
+ Max content width: [value]px.
79
+ Grid: [columns] columns with [gap]px gaps.
80
+ Page margins: [value]px on desktop, [value]px on mobile.
81
+
82
+ ## 6. Depth & Elevation
83
+ | Level | Shadow | Use |
84
+ |---|---|---|
85
+ | 0 | none | Flat elements, inline content |
86
+ | 1 | 0 1px 2px rgba(0,0,0,0.05) | Cards, dropdowns |
87
+ | 2 | 0 4px 12px rgba(0,0,0,0.08) | Floating elements, hover cards |
88
+ | 3 | 0 8px 24px rgba(0,0,0,0.12) | Modals, dialogs |
89
+ | 4 | 0 16px 48px rgba(0,0,0,0.16) | Popovers, overlays |
90
+
91
+ ## 7. Do's and Don'ts
92
+ ### Do
93
+ - [specific guidance for this design system]
94
+
95
+ ### Don't
96
+ - [specific anti-patterns to avoid]
97
+
98
+ ## 8. Responsive Behavior
99
+ Breakpoints: [values].
100
+ Mobile navigation: [pattern].
101
+ Column collapse strategy: [how grids simplify].
102
+ Touch target minimum: 48px.
103
+
104
+ ## 9. Agent Prompt Guide
105
+ Quick reference for AI agents building with this system:
106
+ - Primary color: [hex]
107
+ - Background: [hex]
108
+ - Font family: [name]
109
+ - Border radius: [value]
110
+ - Spacing unit: [value]
111
+ ```
112
+
113
+ ---
114
+
115
+ ## 2. Theme Generation
116
+
117
+ When creating a custom theme, follow this process:
118
+
119
+ 1. **Start with the accent color.** This is usually the brand color or the primary action color.
120
+ 2. **Derive surfaces.** Take the accent hue, reduce chroma to near-zero, and create a lightness scale.
121
+ 3. **Build the text scale.** Tint near-black toward the accent hue for warmth.
122
+ 4. **Choose fonts.** Match the emotional register (serif for editorial/luxury, sans for tech/modern, mono for developer/terminal).
123
+ 5. **Set border radius.** 0px for brutalist, 4-8px for professional, 12-16px for friendly, 999px for pill-shaped.
124
+ 6. **Define shadows.** Match the overall aesthetic (no shadows for flat designs, layered shadows for elevated designs).
125
+
126
+ ---
127
+
128
+ ## 3. Token Structure
129
+
130
+ Organize tokens by function, not by value:
131
+
132
+ ```
133
+ --color-surface-{0-3} Backgrounds, from page to elevated
134
+ --color-text-{primary,secondary,tertiary} Text hierarchy
135
+ --color-accent Primary action color
136
+ --color-accent-{hover,subtle} Accent variants
137
+ --color-border Default borders
138
+ --color-{success,warning,error,info} Semantic states
139
+ --space-{1-24} Spacing scale
140
+ --radius-{sm,md,lg,full} Border radius
141
+ --shadow-{sm,md,lg,xl} Elevation
142
+ --font-{display,body,mono} Font families
143
+ --text-{xs,sm,base,lg,xl,2xl,3xl,4xl} Type scale
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 4. Pre-Built Themes
149
+
150
+ ### Midnight Terminal
151
+ Dark background, green accent, monospace-forward. Suited for developer tools.
152
+ - Surface: oklch(0.12 0.01 150) to oklch(0.20 0.015 150)
153
+ - Accent: oklch(0.70 0.20 150) (terminal green)
154
+ - Font: JetBrains Mono + IBM Plex Sans
155
+ - Radius: 4px
156
+
157
+ ### Warm Editorial
158
+ Cream background, serif headings, generous whitespace. Suited for content-heavy sites.
159
+ - Surface: oklch(0.97 0.01 60) to oklch(0.93 0.015 60)
160
+ - Accent: oklch(0.45 0.15 25) (warm red)
161
+ - Font: Instrument Serif + Source Sans 3
162
+ - Radius: 2px
163
+
164
+ ### Swiss Precision
165
+ White background, strict grid, no decoration. Suited for professional tools.
166
+ - Surface: oklch(0.99 0.002 0) to oklch(0.95 0.005 0)
167
+ - Accent: oklch(0.50 0.25 250) (blue)
168
+ - Font: Helvetica Neue / Outfit + DM Sans
169
+ - Radius: 0px
170
+
171
+ ### Soft Pastel
172
+ Light pastel background, rounded elements, friendly. Suited for consumer apps.
173
+ - Surface: oklch(0.97 0.02 280) to oklch(0.93 0.03 280)
174
+ - Accent: oklch(0.60 0.20 280) (soft purple)
175
+ - Font: Nunito + Nunito Sans
176
+ - Radius: 16px
@@ -0,0 +1,54 @@
1
+ # Generative Art Reference
2
+
3
+ ## Process
4
+
5
+ ### Step 1: Algorithmic Philosophy
6
+ Before writing code, write a manifesto (4-6 paragraphs) that describes the computational aesthetic. Name the movement (1-2 words). Describe how the philosophy manifests through computational processes, noise functions, particle behaviors, temporal evolution, and parametric variation.
7
+
8
+ ### Step 2: Implementation
9
+ Express the philosophy through p5.js with seeded randomness. The algorithm should be 90% generative, 10% parameters.
10
+
11
+ ### Core Technical Requirements
12
+
13
+ **Seeded Randomness:**
14
+ ```javascript
15
+ let seed = 12345;
16
+ randomSeed(seed);
17
+ noiseSeed(seed);
18
+ ```
19
+ Same seed always produces the same output. Different seeds reveal different facets.
20
+
21
+ **Parameter Structure:**
22
+ ```javascript
23
+ let params = {
24
+ seed: 12345,
25
+ particleCount: 1000,
26
+ noiseScale: 0.005,
27
+ speed: 1.5,
28
+ // Add parameters specific to the algorithm
29
+ };
30
+ ```
31
+
32
+ **Single-File HTML:**
33
+ Everything inline, no external files except p5.js CDN:
34
+ ```html
35
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
36
+ ```
37
+
38
+ ### Required UI Features
39
+ 1. **Seed navigation**: prev/next/random buttons, seed display, jump-to-seed input
40
+ 2. **Parameter controls**: sliders for numeric values, color pickers for palette
41
+ 3. **Actions**: regenerate, reset defaults, download PNG
42
+
43
+ ### Philosophy Examples
44
+
45
+ **Flow Fields**: Layered Perlin noise driving particle trails. Thousands of particles follow vector forces, accumulating into organic density maps.
46
+
47
+ **Quantum Harmonics**: Particles on a grid with phase values evolving through sine waves. Constructive/destructive interference creates emergent patterns.
48
+
49
+ **Stochastic Crystallization**: Randomized circle packing or Voronoi tessellation. Random points evolve through relaxation algorithms until equilibrium.
50
+
51
+ **Recursive Whispers**: Branching structures that subdivide recursively, constrained by golden ratios with noise perturbations.
52
+
53
+ ### Quality Bar
54
+ The output should look like it was refined by a computational artist over hundreds of iterations. Every parameter should feel carefully tuned. The result should reward sustained viewing.
@@ -0,0 +1,162 @@
1
+ # Interaction Design Reference
2
+
3
+ ## Table of Contents
4
+ 1. Form Design
5
+ 2. Focus Management
6
+ 3. Loading Patterns
7
+ 4. Empty States
8
+ 5. Error Handling
9
+ 6. UX Writing
10
+ 7. Common Mistakes
11
+
12
+ ---
13
+
14
+ ## 1. Form Design
15
+
16
+ ### Input Fields
17
+ - Use visible labels above inputs, not placeholder-only labels (placeholders disappear on focus)
18
+ - Input height: 40-48px for desktop, 48px minimum for touch
19
+ - Group related fields visually (name + email, street + city + zip)
20
+ - Show validation inline, not in an alert after submission
21
+ - Use `inputmode` attribute for mobile keyboards: `inputmode="email"`, `inputmode="numeric"`, `inputmode="tel"`
22
+ - Auto-focus the first field on page load when the form is the primary task
23
+
24
+ ### Field States
25
+ Every input needs four visible states:
26
+ 1. **Default**: subtle border, neutral background
27
+ 2. **Focus**: accent border (2px), subtle glow or shadow
28
+ 3. **Error**: error-colored border, inline error message below the field
29
+ 4. **Disabled**: reduced opacity (0.5), `cursor: not-allowed`
30
+
31
+ ### Buttons
32
+ - Primary action: filled, high contrast (accent color)
33
+ - Secondary action: outlined or ghost (border only)
34
+ - Destructive action: red/error color, requires confirmation for irreversible actions
35
+ - Button text: verb-first ("Save changes", "Create project"), never "Submit" or "Click here"
36
+ - Loading state: replace text with spinner or use `aria-busy="true"`, disable the button to prevent double-submission
37
+
38
+ ---
39
+
40
+ ## 2. Focus Management
41
+
42
+ ### Focus Indicators
43
+ Never remove focus outlines without replacement. Use a visible, high-contrast focus ring:
44
+ ```css
45
+ :focus-visible {
46
+ outline: 2px solid var(--accent);
47
+ outline-offset: 2px;
48
+ }
49
+ ```
50
+
51
+ Use `:focus-visible` (not `:focus`) to show focus rings only for keyboard navigation, not mouse clicks.
52
+
53
+ ### Focus Trapping
54
+ Modal dialogs must trap focus within them. When a modal opens:
55
+ 1. Move focus to the first focusable element inside
56
+ 2. Tab cycles within the modal
57
+ 3. Escape closes the modal
58
+ 4. Focus returns to the trigger element on close
59
+
60
+ ### Skip Links
61
+ Add a skip-to-content link as the first focusable element:
62
+ ```html
63
+ <a href="#main-content" class="skip-link">Skip to content</a>
64
+ ```
65
+ ```css
66
+ .skip-link {
67
+ position: absolute;
68
+ top: -100%;
69
+ left: 0;
70
+ }
71
+ .skip-link:focus {
72
+ top: 0;
73
+ z-index: 1000;
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## 3. Loading Patterns
80
+
81
+ ### Skeleton Screens
82
+ Replace content with gray shapes that match the expected layout. This feels faster than a spinner because the user can see the structure forming.
83
+
84
+ ### Progressive Loading
85
+ Show content as it arrives. Do not wait for everything to load before showing anything. Use `Suspense` boundaries in React to show parts of the page while others load.
86
+
87
+ ### Optimistic Updates
88
+ For user-initiated actions (like, save, delete), update the UI immediately and reconcile with the server response. Show a subtle undo option if the server rejects the action.
89
+
90
+ ### Spinner vs. Skeleton
91
+ - **Spinner**: Use for actions that take 1-3 seconds (button submissions, API calls). Place inside the triggering element.
92
+ - **Skeleton**: Use for content areas that take 0.5-5 seconds to load. Match the shape of the expected content.
93
+ - **Progress bar**: Use for operations that take 5+ seconds with measurable progress (file uploads, multi-step processes).
94
+
95
+ ---
96
+
97
+ ## 4. Empty States
98
+
99
+ Empty states are an opportunity, not a placeholder. They should:
100
+ 1. Explain what this area will contain once populated
101
+ 2. Provide a clear action to get started
102
+ 3. Optionally include an illustration or icon for warmth
103
+
104
+ ```
105
+ No projects yet.
106
+ Create your first project to get started.
107
+ [+ Create Project]
108
+ ```
109
+
110
+ Never show a blank page, an error message, or raw "null" / "undefined" in place of empty content.
111
+
112
+ ---
113
+
114
+ ## 5. Error Handling
115
+
116
+ ### Inline Errors
117
+ Show errors next to the element that caused them, not in a modal or toast. Use the error color for the field border and display the message directly below.
118
+
119
+ ### Error Messages
120
+ - Be specific: "Email address must include an @ symbol" not "Invalid input"
121
+ - Be helpful: suggest the fix, not just the problem
122
+ - Be human: "We couldn't find that page" not "404 Not Found"
123
+
124
+ ### Network Errors
125
+ Show a non-blocking banner or inline message with a retry action. Never show a raw error object or stack trace.
126
+
127
+ ### Form Validation
128
+ Validate on blur (when the user leaves a field), not on every keystroke. Show success indicators for valid fields (subtle checkmark or green border).
129
+
130
+ ---
131
+
132
+ ## 6. UX Writing
133
+
134
+ ### Buttons
135
+ - Use action verbs: "Save", "Send", "Create", "Delete"
136
+ - Be specific: "Save changes" > "Save", "Send message" > "Send"
137
+ - Match the action to the context: "Place order" not "Submit"
138
+
139
+ ### Labels
140
+ - Clear and concise: "Full name" not "Please enter your full name"
141
+ - Avoid jargon: "Phone number" not "Primary contact number"
142
+
143
+ ### Confirmations
144
+ - State what happened: "Project created successfully"
145
+ - Provide next step if relevant: "Project created. Add your first task?"
146
+
147
+ ### Destructive Actions
148
+ - State what will happen: "This will permanently delete 3 files"
149
+ - Require explicit confirmation: "Type DELETE to confirm"
150
+ - Provide an out: "Cancel" should be more prominent than "Delete"
151
+
152
+ ---
153
+
154
+ ## 7. Common Mistakes
155
+
156
+ - Placeholder text as the only label (disappears on focus, inaccessible)
157
+ - Disabling the submit button before all fields are filled (users do not know which field is missing)
158
+ - Using toast notifications for errors (the user may not see them, they disappear)
159
+ - No loading feedback after clicking a button (user clicks again, causing duplicate submissions)
160
+ - Custom scrollbars that break native scroll behavior
161
+ - Hover-only interactions with no keyboard or touch equivalent
162
+ - Alert/confirm dialogs that block the entire page for minor confirmations