Spaces:
Build error
Build error
File size: 9,748 Bytes
09fa60b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | # π¨ AudioForge Creative UI System
## Philosophy
**"Make users feel something, not just do something."**
This UI system is built on the principle that **personality drives engagement**. Every animation, every piece of copy, every color choice is intentional and designed to create an emotional connection.
---
## π― Core Components
### 1. **SoundWaveBackground**
```tsx
<SoundWaveBackground />
```
- Canvas-based animated sine waves
- Three layers with different frequencies
- Subtle, atmospheric, non-intrusive
- Auto-resizes on window change
**Use when**: You want ambient motion in the background
---
### 2. **PromptSuggestions**
```tsx
<PromptSuggestions onSelectPrompt={(prompt) => setValue("prompt", prompt)} />
```
- 6 pre-built prompt templates
- Emoji + title + full prompt
- Hover effects: scale + color shift
- Reduces friction for new users
**Use when**: You have a text input that could benefit from examples
---
### 3. **MiniVisualizer**
```tsx
{showVisualizer && <MiniVisualizer />}
```
- Animated audio bars with gradients
- 20 bars that pulse randomly
- Appears on hover for completed items
- Canvas-based for performance
**Use when**: You want to show "this has audio" without playing it
---
### 4. **FooterStats**
```tsx
<FooterStats />
```
- Live statistics from API
- Gradient counters with hover effects
- Model badges with pulse indicators
- Responsive grid layout
**Use when**: You want to showcase usage/activity
---
### 5. **FloatingNotes** (Optional)
```tsx
<FloatingNotes />
```
- Musical notes that float upward
- Randomized positions and durations
- Very subtle, low opacity
- Pure atmosphere
**Use when**: You want extra ambient motion
---
## π¨ Animation System
### Entrance Animations
```tsx
className="animate-fade-in" // Smooth fade + slight upward
className="animate-slide-in-left" // Slide from left
className="animate-slide-in-right" // Slide from right (with delay)
```
### Continuous Animations
```tsx
className="animate-gradient" // Animated gradient background
className="animate-pulse-glow" // Glowing pulse effect
className="animate-bounce-subtle" // Gentle bounce
className="animate-float-up" // Float upward (for notes)
```
### Staggered Lists
```tsx
{items.map((item, index) => (
<div
key={item.id}
style={{ animationDelay: `${index * 50}ms` }}
className="animate-fade-in"
>
<ItemCard item={item} />
</div>
))}
```
---
## π Copy Writing Patterns
### β Before (Technical)
```
"Generate professional-quality music from text descriptions"
"No generations found"
"Processing..."
```
### β
After (Emotional)
```
"Turn your imagination into sound. Describe it, and we'll compose it."
"Your Canvas Awaits β Time to create your first masterpiece!"
"Forging your masterpiece... π΅"
```
### Randomized Messages
```tsx
const messages = [
"π΅ Your masterpiece is being forged!",
"πΈ The AI musicians are tuning up!",
"πΊ The orchestra is assembling!",
];
const randomMessage = messages[Math.floor(Math.random() * messages.length)];
```
---
## π¨ Color System
### Gradients
```tsx
// Primary gradient (blue β purple)
className="bg-gradient-to-r from-primary to-purple-500"
// Success gradient (green β emerald)
className="bg-gradient-to-r from-green-500 to-emerald-500"
// Accent gradient (blue β cyan)
className="bg-gradient-to-r from-blue-500 to-cyan-500"
```
### Status Colors
```tsx
// Processing
className="text-primary bg-primary/10"
// Completed
className="text-green-600 bg-green-100 dark:bg-green-900/20"
// Failed
className="text-destructive bg-destructive/10"
// Pending
className="text-muted-foreground bg-muted"
```
---
## π― Hover Effects
### Scale + Shadow
```tsx
className="hover:scale-105 hover:shadow-lg transition-all duration-300"
```
### Glow Effect
```tsx
className="hover:shadow-[0_0_30px_rgba(99,102,241,0.5)] transition-shadow"
```
### Color Shift
```tsx
className="text-muted-foreground hover:text-primary transition-colors"
```
### Rotate Icon
```tsx
className="group-hover:rotate-12 transition-transform"
```
---
## π΅ Empty States
### Structure
1. **Large Emoji** (text-6xl, animate-bounce-subtle)
2. **Bold Headline** (gradient text, text-2xl)
3. **Descriptive Text** (text-muted-foreground)
4. **Call to Action** (pointer with emoji)
### Example
```tsx
<div className="text-center py-16 bg-gradient-to-br from-secondary/30 to-secondary/10 border border-dashed border-primary/30 rounded-lg">
<div className="text-6xl mb-4 animate-bounce-subtle">π΅</div>
<p className="text-2xl font-bold mb-2 bg-gradient-to-r from-primary to-purple-500 bg-clip-text text-transparent">
Your Canvas Awaits
</p>
<p className="text-muted-foreground mb-4">
No generations yet. Time to create your first masterpiece!
</p>
<div className="flex items-center justify-center gap-2 text-sm text-muted-foreground">
<span>π</span>
<span>Start by describing your music on the left</span>
</div>
</div>
```
---
## π¨ Loading States
### Spinner + Pulse
```tsx
<div className="relative">
<Loader2 className="h-12 w-12 animate-spin text-primary" />
<div className="absolute inset-0 h-12 w-12 rounded-full bg-primary/20 animate-ping" />
</div>
<p className="text-sm text-muted-foreground animate-pulse">
Loading your creations...
</p>
```
### Progress Bar (Indeterminate)
```tsx
<Progress value={undefined} className="h-1" />
// Automatically shows animated gradient when value is undefined
```
---
## π― Form Enhancements
### Emoji Labels
```tsx
<Label className="flex items-center gap-2">
<span className="text-2xl">πΌ</span>
Describe your music
</Label>
```
### Pro Tips
```tsx
<p className="text-xs text-muted-foreground mt-2">
π‘ Tip: Be specific about instruments, mood, tempo, and style
</p>
```
### Enhanced Placeholders
```tsx
placeholder="Try: 'A dreamy lo-fi hip-hop beat with vinyl crackle and soft piano melodies' or 'Epic orchestral soundtrack with soaring strings'"
```
---
## π¨ Typography System
### Display Headings
```tsx
className="font-display text-6xl font-bold bg-gradient-to-r from-primary via-purple-500 to-primary/60 bg-clip-text text-transparent animate-gradient"
```
### Section Headings
```tsx
<div className="flex items-center gap-2">
<div className="w-1 h-8 bg-gradient-to-b from-primary to-purple-500 rounded-full" />
<h2 className="font-display text-2xl font-bold">Section Title</h2>
</div>
```
---
## π― Status Badges
### Structure
```tsx
<div className={cn("p-1.5 rounded-full", bgColor)}>
<StatusIcon className={cn("h-4 w-4", color)} />
</div>
<span className={cn("text-sm font-medium", color)}>
{label}
</span>
```
### Config Pattern
```tsx
const statusConfig = {
processing: {
icon: Loader2,
label: "Processing",
color: "text-primary",
bgColor: "bg-primary/10",
},
completed: {
icon: CheckCircle2,
label: "Completed",
color: "text-green-600",
bgColor: "bg-green-100 dark:bg-green-900/20",
},
};
```
---
## π¨ Tag System
### Gradient Tags with Emojis
```tsx
<span className="px-3 py-1 text-xs bg-gradient-to-r from-primary/10 to-purple-500/10 border border-primary/20 rounded-full font-medium hover:scale-105 transition-transform">
πΈ Rock
</span>
```
---
## π― Button Enhancements
### Gradient Hover
```tsx
<Button className="relative overflow-hidden group/btn">
<span className="absolute inset-0 bg-gradient-to-r from-primary via-purple-500 to-primary opacity-0 group-hover/btn:opacity-100 transition-opacity duration-500" />
<span className="relative flex items-center justify-center">
<Sparkles className="mr-2 h-5 w-5 group-hover/btn:animate-bounce-subtle" />
Generate Music
</span>
</Button>
```
---
## π¨ Header Pattern
### Sticky with Blur
```tsx
<header className="sticky top-0 z-50 border-b bg-background/80 backdrop-blur-xl supports-[backdrop-filter]:bg-background/60 shadow-sm">
```
### Logo with Sparkle
```tsx
<div className="relative">
<Music className="h-7 w-7 text-primary group-hover:scale-110 transition-transform" />
<Sparkles className="h-3 w-3 text-primary absolute -top-1 -right-1 animate-pulse" />
</div>
```
---
## π― Performance Tips
1. **Use CSS animations** over JS when possible
2. **Canvas animations** run on separate thread
3. **Debounce** hover effects with `transition-all duration-300`
4. **Lazy load** heavy components (visualizers, confetti)
5. **Use `will-change`** sparingly for GPU acceleration
---
## π¨ Accessibility
- All animations respect `prefers-reduced-motion`
- Canvas elements have `aria-hidden="true"`
- Status badges use semantic colors + icons
- Keyboard navigation maintained
- Focus states preserved
---
## π Quick Wins Checklist
- [ ] Replace "Submit" with "Generate Music β¨"
- [ ] Add emoji to all form labels
- [ ] Create 3-6 prompt suggestions
- [ ] Enhance empty state with emoji + gradient
- [ ] Add hover scale to all cards
- [ ] Add gradient to main heading
- [ ] Create status badges with colors
- [ ] Add loading message with personality
- [ ] Add contextual tips below inputs
- [ ] Create footer stats dashboard
---
**Remember**: Every pixel should spark joy. Every interaction should feel intentional. Every animation should have purpose.
πΌβ‘ **Now go make something beautiful.**
|