Spaces:
Build error
Build error
π¨ 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
<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
<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
{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
<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)
<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
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
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
{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
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
// 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
// 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
className="hover:scale-105 hover:shadow-lg transition-all duration-300"
Glow Effect
className="hover:shadow-[0_0_30px_rgba(99,102,241,0.5)] transition-shadow"
Color Shift
className="text-muted-foreground hover:text-primary transition-colors"
Rotate Icon
className="group-hover:rotate-12 transition-transform"
π΅ Empty States
Structure
- Large Emoji (text-6xl, animate-bounce-subtle)
- Bold Headline (gradient text, text-2xl)
- Descriptive Text (text-muted-foreground)
- Call to Action (pointer with emoji)
Example
<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
<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)
<Progress value={undefined} className="h-1" />
// Automatically shows animated gradient when value is undefined
π― Form Enhancements
Emoji Labels
<Label className="flex items-center gap-2">
<span className="text-2xl">πΌ</span>
Describe your music
</Label>
Pro Tips
<p className="text-xs text-muted-foreground mt-2">
π‘ Tip: Be specific about instruments, mood, tempo, and style
</p>
Enhanced Placeholders
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
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
<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
<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
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
<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
<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
<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
<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
- Use CSS animations over JS when possible
- Canvas animations run on separate thread
- Debounce hover effects with
transition-all duration-300 - Lazy load heavy components (visualizers, confetti)
- Use
will-changesparingly 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.