Installation
- Tab Title
- Tab Title
Usage
Props
Array of Svelte components to render as icons in the cloud. Each component is rendered into a canvas for display.
Array of image URLs to display in the cloud. Images are loaded and rendered into circular canvases.
Additional CSS classes to apply to the canvas element.
Examples
With Images
Custom Styling
Technology Stack Showcase
Interactions
The Icon Cloud supports multiple interaction methods:Mouse Drag
Click and drag anywhere on the canvas to manually rotate the sphere in any direction.Auto-Rotation
When not actively dragging, the sphere automatically rotates based on mouse position:- Moving the mouse toward edges increases rotation speed
- Rotation direction follows mouse position relative to center
Click to Focus
Click on any icon to smoothly animate the sphere and bring that icon to the front center. The animation:- Calculates the optimal rotation path
- Uses eased animation (cubic ease-out)
- Duration scales with rotation distance (800ms-2000ms)
How It Works
- Sphere Generation: Icons are positioned using the Fibonacci sphere algorithm for even distribution
- 3D Projection: 3D coordinates are projected to 2D canvas space with perspective
- Depth Sorting: Icons are rendered back-to-front for proper occlusion
- Scale & Opacity: Icons closer to the viewer appear larger and more opaque
- Canvas Rendering: Each icon is pre-rendered to an off-screen canvas for performance
Technical Details
- Canvas size: 400x400 pixels
- Icon size: 40x40 pixels
- Sphere radius: 100 units
- Image clipping: Circular mask applied to all images
- Animation: 60fps via requestAnimationFrame
- Cross-origin: Images loaded with
crossOrigin="anonymous"
Features
- Smooth 3D sphere rotation with realistic physics
- Interactive drag controls
- Click-to-focus individual icons
- Mouse position affects auto-rotation speed
- Images automatically clipped to circular shape
- Depth-based scaling and opacity
- Performance-optimized canvas rendering
- Responsive to mouse interactions
- Clean lifecycle management
Accessibility
The canvas includes anaria-label="Interactive 3D Icon Cloud" for screen readers.