Build a Mac-style dock with icon magnification on hover, draggable reordering, active…
- User
Build a Mac-style dock with icon magnification on hover, draggable reordering, active indicators, bouncing launch animation, and folder stacks.
Assistant
I'll build an immersive macOS-style desktop with a fully interactive dock. Let me first explore the project setup.
Let me read the existing configuration files.
Tailwind v4 with React 19. Now I'll install the animation and icon libraries, and generate a macOS-style wallpaper in parallel.
Now I'll build the project structure. Starting with the global styles and the dock data definitions.
Now the icon visuals — squircle app icons, folder glyphs, calendar with live date, and the trash.
Let me fix the conditional hook usage in the calendar icon to keep React hooks unconditional.
Now the DockIcon — the heart of the magnification physics, bounce animations, tooltips, and active indicators.
Now the Dock itself — cursor-tracked magnification, pointer-based drag-to-reorder physics, click detection, and bounce orchestration.
Quick fix for the unused parameter:
Now the FolderStack — macOS-style fan and grid views that unfold from the dock.
Now the window contents — fully functional app windows (working calculator, music player with animated EQ, live calendar, photo lightbox with shared-element transitions, terminal, and more).
Fixing the removed Lucide brand icons with generic glyphs:
Both fixes applied. Now the window layer — draggable, focusable, minimizable, maximizable windows with macOS traffic lights.
Let me simplify the AnimatePresence child structure:
Now the MenuBar with live clock and the Apple menu dropdown:
Now the main App — desktop orchestration: window manager, wallpaper, desktop icons, lock screen, hints, and everything wired together.
Updating the page title, then building:
Two refinements needed: the shared
dragXmotion value would incorrectly move all icons during a drag, and magnification doesn't restore after a click until the mouse moves. Fixing both:One more polish: only restore magnification if the pointer is actually over the dock. Adding a marker attribute and refining:
Let me verify the final state of the dock files to catch any remaining issues:
Let me verify the FolderStack anchor clamping logic:
Fixing the clamp logic:
Now let me rebuild to verify everything compiles:
Build passes. Let me do a final review of DockIcon to verify its logic:
DockIcon logic is solid. Let me add two final polish touches — entrance animations for the dock and menu bar:
The build is complete. Here's what I created:
Dock OS — a full macOS desktop experience built around the Dock
All five requested dock features:
- Hover magnification — cursor-distance-driven width springs (framer-motion physics) that ripple across neighboring icons, exactly like macOS
- Draggable reordering — custom pointer-based drag engine with live reordering; siblings spring aside via layout animations while the dragged icon stays glued to the cursor (with offset compensation across reorders), snapping home with a spring on release
- Active indicators — spring-animated white dots that pop in beneath running apps and folders with open stacks
- Bouncing launch animation — a three-hop accelerating bounce when launching, a single hop when focusing a running app, and a jiggle for Trash
- Folder stacks — Downloads and Projects fan out into an arc that unfolds item-by-item from the dock, with a toggleable Grid view, hover/tap micro-interactions, and items that can launch their parent apps
Beyond the dock, a whole desktop:
- Menu bar with live clock, Apple menu dropdown (About This Mac, System Settings, Lock Screen), and a dynamic active-app name
- Full window manager — draggable, focusable, minimizable, maximizable windows with traffic-light controls, focus shadows, blur-out minimize, and double-click-to-zoom
- 12 functional apps — a working calculator, Music player with animated EQ bars and progress, live Calendar (the dock icon shows today's real date), Photos with shared-element lightbox transitions, Terminal, Notes, Finder, Safari, Mail, Settings with working toggles, and About This Mac
- Extras — lock screen with blurred wallpaper clock, selectable desktop icons, tooltips, a "Trash is empty" bubble, onboarding hint, entrance choreography, and an AI-generated Sequoia-style gradient wallpaper
Everything runs on spring physics with responsive sizing for smaller screens. Double-click "Macintosh HD" to get started.
Files built:
src/index.css,src/data/dock.ts,src/components/AppIconVisual.tsx,src/components/DockIcon.tsx,src/components/Dock.tsx,src/components/FolderStack.tsx,src/components/WindowContent.tsx,src/components/WindowLayer.tsx,src/components/MenuBar.tsx,src/App.tsx,index.html
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.