+ ```
+
+2. **Add Breadcrumb Navigation**
+ ```tsx
+
+ ```
+
+3. **Convert Export to Click-Triggered Dropdown with Animation**
+ - Use Radix UI or Headless UI for accessible dropdowns
+ - Add scale and fade animations on open/close
+
+4. **Add Status Indicator**
+ ```tsx
+
+ ```
+
+### Toolbar (Floating)
+
+**Current Issues:**
+- Good glassmorphism base but could be more refined
+- Tool icons lack visual distinction when inactive
+- Zoom controls feel disconnected
+
+**Recommendations:**
+
+1. **Enhanced Glass Effect**
+ ```tsx
+
+ ```
+
+2. **Animated Tool Selection**
+ ```tsx
+ // Add spring animation for tool selection indicator
+
+ ```
+
+3. **Tooltips with Shortcuts**
+ - Add tooltips that show on hover with keyboard shortcut badges
+ - Use consistent tooltip styling across the app
+
+4. **Group Visual Separators**
+ - Use subtle vertical dividers with gradient fade
+
+### Layers Panel
+
+**Current Issues:**
+- Minimal visual hierarchy
+- Layer items lack drag handles or reordering indication
+- Empty state is too plain
+
+**Recommendations:**
+
+1. **Add Drag & Drop Reordering**
+ - Use `@dnd-kit/sortable` for accessible drag-and-drop
+ - Add ghost element preview during drag
+ - Show insertion indicator line
+
+2. **Enhanced Layer Item Design**
+ ```tsx
+
+ {/* Drag handle - visible on hover */}
+
+
+
+
+ {/* Layer thumbnail preview */}
+
+ {/* Mini preview of element */}
+
+
+ {/* Content */}
+
+
+ {element.name}
+
+
+ {element.type}
+
+
+
+ ```
+
+3. **Beautiful Empty State**
+ ```tsx
+
+
+
+
+
No layers yet
+
+ Click on the canvas or use
+ C
+ T
+ A
+ to add elements
+
+
+ ```
+
+### Inspector Panel
+
+**Current Issues:**
+- Dense information without clear sections
+- Form controls need modernization
+- No collapsible sections
+
+**Recommendations:**
+
+1. **Collapsible Accordion Sections**
+ ```tsx
+
+
+
+ Appearance
+
+
+
+ {/* Content */}
+
+
+
+ ```
+
+2. **Modern Input Fields**
+ ```tsx
+ // Enhanced number input with stepper
+
+ ```
+
+3. **Enhanced Color Picker**
+ ```tsx
+ // Modern color picker with swatches and opacity
+
+
+
+ {/* Checkerboard background for transparency */}
+
+
+
+
+
+
+
+
+
+ {/* Recent colors */}
+
+ {recentColors.map(c => (
+
+ ))}
+
+
+ ```
+
+4. **Slider with Value Display**
+ ```tsx
+
+
+ Border Radius
+ {value}px
+
+
+
+ ```
+
+### Canvas Area
+
+**Current Issues:**
+- Basic checkered or solid background
+- No visual indicators for safe zones
+- Selection handles could be more refined
+
+**Recommendations:**
+
+1. **Subtle Canvas Background Pattern**
+ ```tsx
+ // Add subtle dot grid pattern to canvas workspace
+
+ ```
+
+2. **Enhanced Selection Handles**
+ ```tsx
+ // Modern corner handles
+
+ ```
+
+3. **Canvas Info Badge**
+ ```tsx
+ // Show canvas size in corner
+
+ {width} ร {height}
+
+ ```
+
+---
+
+## โจ Micro-Interactions & Animations
+
+### 1. Button Press Effects
+
+```tsx
+// Add satisfying press feedback
+
+```
+
+### 2. Panel Transitions
+
+```tsx
+// Smooth panel content transitions
+
+```
+
+### 3. Loading States
+
+```tsx
+// Skeleton loading for async operations
+
+```
+
+### 4. Success Feedback
+
+```tsx
+// Toast notification for exports
+
+
+ Image exported successfully!
+
+```
+
+---
+
+## ๐ Feature Enhancements
+
+### 1. Onboarding Experience
+
+**First-time user tooltip tour:**
+- Highlight each major area with spotlight effect
+- Short, contextual tips
+- Skip option
+
+```tsx
+
+ {/* Spotlight cutout */}
+
+ {/* Tooltip */}
+
+
Create & Export
+
Start a new project or export your creation in multiple formats.
+
+
+
+```
+
+### 2. Command Palette (โK)
+
+Add a spotlight-style command palette for power users:
+
+```tsx
+
+
+
+
+ {/* Command results */}
+
+
+
+```
+
+### 3. Quick Actions Contextual Menu
+
+Right-click context menus with modern styling:
+
+```tsx
+
+
+
+ Duplicate
+ โD
+
+
+```
+
+### 4. Preview Mode
+
+Full-screen distraction-free preview:
+
+```tsx
+
+
+
+
+
+ {/* Canvas preview at actual size */}
+
+ {/* Rendered canvas */}
+
+
+```
+
+---
+
+## ๐ฑ Responsive Considerations
+
+### Breakpoint Strategy
+
+```css
+/* Collapse side panels to bottom sheets on tablet */
+@media (max-width: 1024px) {
+ .layers-panel,
+ .inspector-panel {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 40vh;
+ border-radius: 24px 24px 0 0;
+ transform: translateY(calc(100% - 48px));
+ transition: transform 0.3s ease;
+ }
+
+ .panel-open {
+ transform: translateY(0);
+ }
+}
+
+/* Hide panels completely on mobile - show as modals */
+@media (max-width: 768px) {
+ .side-panels {
+ display: none;
+ }
+}
+```
+
+---
+
+## ๐ฏ Implementation Priority
+
+### Phase 1: Quick Wins (1-2 days)
+1. โ
Update color palette and CSS variables
+2. โ
Enhance button/input hover states
+3. โ
Add micro-animations (scale, transitions)
+4. โ
Improve empty states
+
+### Phase 2: Component Polish (3-5 days)
+1. ๐ฒ Redesign Inspector panel with collapsible sections
+2. ๐ฒ Enhance Layers panel with drag-and-drop
+3. ๐ฒ Modernize all form controls
+4. ๐ฒ Add toast notifications
+
+### Phase 3: Advanced Features (1-2 weeks)
+1. ๐ฒ Command palette (โK)
+2. ๐ฒ Onboarding tour
+3. ๐ฒ Context menus
+4. ๐ฒ Preview mode
+5. ๐ฒ Responsive adaptations
+
+---
+
+## ๐ ๏ธ Recommended Libraries
+
+| Purpose | Library | Why |
+|---------|---------|-----|
+| Animations | `framer-motion` | Smooth, spring-based animations |
+| UI Primitives | `@radix-ui/react-*` | Accessible, unstyled components |
+| Drag & Drop | `@dnd-kit/core` | Modern, accessible DnD |
+| Icons | `lucide-react` | Consistent, customizable icons |
+| Tooltips | `@radix-ui/react-tooltip` | Accessible tooltips |
+| Toasts | `sonner` | Beautiful toast notifications |
+| Command Palette | `cmdk` | โK style command menu |
+
+---
+
+## ๐ Visual Reference
+
+### Inspiration Sources
+- [Figma](https://figma.com) - Panel organization, inspector design
+- [Linear](https://linear.app) - Command palette, animations
+- [Raycast](https://raycast.com) - Glass effects, dark theme
+- [Arc Browser](https://arc.net) - Sidebar design, animations
+- [Vercel Dashboard](https://vercel.com) - Cards, buttons, clean typography
+
+---
+
+## Summary
+
+The current YvCode UI has a solid foundation with its dark theme and component organization. The key improvements focus on:
+
+1. **Visual Polish** - Enhanced glass effects, refined colors, better shadows
+2. **Interaction Design** - Micro-animations, better feedback, modern controls
+3. **Information Architecture** - Collapsible sections, better empty states, contextual help
+4. **Power User Features** - Command palette, keyboard shortcuts display, context menus
+
+Implementing these changes will transform YvCode into a professional-grade design tool that feels modern, responsive, and delightful to use.
diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx
index 6426f72..3bb161f 100644
--- a/src/components/TopBar.tsx
+++ b/src/components/TopBar.tsx
@@ -11,7 +11,9 @@ interface TopBarProps {
const TopBar: React.FC = ({ stageRef }) => {
const [showRecentSnaps, setShowRecentSnaps] = useState(false);
+ const [showExportMenu, setShowExportMenu] = useState(false);
const recentButtonRef = useRef(null);
+ const exportButtonRef = useRef(null);
const {
snap,
@@ -76,7 +78,9 @@ const TopBar: React.FC = ({ stageRef }) => {
link.download = `${snap.meta.title || 'canvas'}.${format}`;
link.href = dataUrl;
link.click();
- }, [stageRef, snap.meta]);
+ setShowExportMenu(false);
+ addRecentSnap(snap);
+ }, [stageRef, snap, addRecentSnap]);
const handleExportJSON = useCallback(() => {
const json = exportSnap();
@@ -88,6 +92,7 @@ const TopBar: React.FC = ({ stageRef }) => {
link.click();
URL.revokeObjectURL(url);
+ setShowExportMenu(false);
// Save to recent snaps when exporting
addRecentSnap(snap);
}, [exportSnap, snap, addRecentSnap]);
@@ -120,81 +125,88 @@ const TopBar: React.FC = ({ stageRef }) => {
}, []);
return (
-
- {/* Left section: Logo & Actions */}
-
-
+ <>
+ {/* Overlay for closing export menu */}
+ {showExportMenu && (
+
setShowExportMenu(false)}
+ />
+ )}
-
-
-
-
-
-
-
-
-
-
-
-
- {/* Recent Snaps Button */}
-
+
+ {/* Left section: Logo & Actions */}
+
+
+
+
-
+
-
setShowRecentSnaps(false)}
- anchorRef={recentButtonRef as React.RefObject}
- />
+
+
+
+
+
+
+
+
+
+
+
+
+
setShowRecentSnaps(false)}
+ anchorRef={recentButtonRef as React.RefObject}
+ />
+
-
- {/* Center section: Title & Tools */}
-
-
+ {/* Center section: Title & Tools */}
+
updateMeta({ title: e.target.value })}
- className="bg-transparent text-sm font-medium text-center text-neutral-200 focus:text-white px-2 py-1 outline-none rounded hover:bg-white/5 focus:bg-white/10 transition-colors placeholder-neutral-600 w-48"
+ className="bg-transparent text-sm font-medium text-center text-neutral-200 focus:text-white px-3 py-1.5 outline-none rounded-md hover:bg-white/5 focus:bg-white/10 transition-colors placeholder-neutral-600 w-48 border border-transparent focus:border-white/10"
placeholder="Untitled Project"
/>
-
-
+
+
{ASPECT_RATIOS.map((ratio) => (
@@ -204,71 +216,120 @@ const TopBar: React.FC = ({ stageRef }) => {
-
- {/* Right section: History & Export */}
-
-
-
-
-
-
-
- Export
-
-
-
-
+ {/* Right section: History & Export */}
+
+
-
-
Format
+
+
+
handleExportImage('png', 2)}
- className="w-full text-left px-3 py-2 text-sm text-neutral-300 hover:text-white hover:bg-white/10 rounded-lg transition-colors flex justify-between group/item"
+ ref={exportButtonRef}
+ onClick={() => setShowExportMenu(!showExportMenu)}
+ className={`flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200 border group ${
+ showExportMenu
+ ? 'bg-blue-600/10 text-blue-400 border-blue-500/50 shadow-[0_0_20px_rgba(37,99,235,0.3)]'
+ : 'bg-white/5 text-neutral-300 hover:text-white hover:bg-white/10 border-white/5 hover:border-white/10'
+ }`}
>
- PNG Image
- 2x
-
-
handleExportImage('jpeg', 2)}
- className="w-full text-left px-3 py-2 text-sm text-neutral-300 hover:text-white hover:bg-white/10 rounded-lg transition-colors"
- >
- JPEG Image
-
-
-
- Save Project JSON
+ Export
+
+
+ {showExportMenu && (
+
+
+ Download Image
+
+
+
+
handleExportImage('png', 2)}
+ className="w-full flex items-center justify-between px-4 py-3 rounded-xl bg-white/[0.03] hover:bg-white/[0.08] border border-white/[0.02] hover:border-white/10 transition-all group active:scale-[0.98]"
+ >
+
+
+ PNG
+
+
+ PNG Image
+ High quality (2x)
+
+
+
+
+
handleExportImage('jpeg', 2)}
+ className="w-full flex items-center justify-between px-4 py-3 rounded-xl bg-white/[0.03] hover:bg-white/[0.08] border border-white/[0.02] hover:border-white/10 transition-all group active:scale-[0.98]"
+ >
+
+
+ JPG
+
+
+ JPEG Image
+ Standard quality
+
+
+
+
+
+
+
+
+ Project File
+
+
+
+
+
+
+
+ Save Project
+ Edit later (.json)
+
+
+
+
+
+ )}
-
+ >
);
};
diff --git a/src/index.css b/src/index.css
index c9e690f..cf1295e 100644
--- a/src/index.css
+++ b/src/index.css
@@ -3,12 +3,6 @@
@import "tailwindcss";
-* {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
-}
-
html, body, #root {
height: 100%;
width: 100%;