A fully functional Figma clone built with vanilla HTML, CSS, and JavaScript. This application replicates Figma's core design functionality including shape creation, text editing, effects, export capabilities, and more.
- Shape Creation: Rectangle, Ellipse, Line, Arrow, Polygon, Star, Path/Pen Tool
- Text Tool: Fully editable text with live typing and in-place editing
- Image Support: Drag & drop, paste from clipboard, file picker, assets gallery
- Comments: Clickable comment system with position persistence
- Selection Tools: Multi-selection with Shift+click, move, resize with corner handles
- Multi-Selection: Hold Shift and click to select multiple elements simultaneously
- Alignment Tools: Comprehensive alignment options for multiple selected elements
- Horizontal: Left, Center, Right alignment
- Vertical: Top, Center, Bottom alignment
- Transform Tools: Flip horizontal/vertical with visual transforms
- Stroke System: Complete stroke management with color, width, and visibility controls
- Effects System: Drop shadows with full control (X, Y, Blur, Spread, Color, Opacity)
- Export System: PNG export with real-time preview and canvas rendering
- Infinite Canvas: Smooth pan and zoom in all directions
- Advanced Zoom: Comprehensive zoom controls with preset values (10%-400%)
- Zoom to fit all content
- Zoom to selection
- Dropdown with common zoom levels
- Pages Management: Multiple design pages with switching and deletion
- Assets Gallery: Dedicated image library with upload, preview, and reuse functionality
- Dynamic Search: Real-time search with highlighting and focusing on canvas elements
- Clean Header Design: Minimalist top area with only rulers when sidebars are open
- Reorganized Controls: Design/Prototype/Zoom/Share moved to right sidebar for cleaner workflow
- Project Title Section: Dedicated area below Figma icon for better organization
- Figma-Accurate Design: Pixel-perfect recreation of Figma's interface
- Dark Theme: Professional dark color scheme
- Lucide Icons: High-quality SVG icons throughout
- Smooth Animations: Polished transitions and micro-interactions
- Glass Morphism: Modern backdrop blur effects
- Responsive Design: Adaptive layout with collapsible sidebars and floating controls
- Modern web browser (Chrome, Firefox, Safari, Edge)
- No server required - runs entirely in the browser
- Clone or download this repository
- Open
index.htmlin your web browser - Start designing immediately!
# Clone the repository
git clone [repository-url]
# Navigate to the project
cd figma-clone
# Open in browser
open index.html- Select Tool (V): Click to select shapes, drag to move
- Hand Tool (H): Pan around the canvas
- Rectangle (R): Click and drag to create rectangles
- Ellipse (O): Click and drag to create circles/ellipses
- Line (L): Click and drag to create lines
- Text (T): Click to create editable text
- Comment: Click to place comments
- Move: Select and drag shapes, or use Shift+click for multi-selection
- Resize: Drag corner handles to resize selected shapes
- Properties: Use right sidebar to adjust X, Y, Width, Height
- Styling: Change fill color, stroke (width, color, visibility), opacity, rotation
- Transform: Use flip horizontal/vertical buttons in inspector
- Alignment: Use alignment tools for precise positioning of multiple elements
- Effects: Add drop shadows with full control
- Multi-Selection: Hold Shift and click to select multiple elements
- Alignment: Select multiple elements and use alignment buttons
- Transform: Use flip controls to mirror elements horizontally or vertically
- Stroke Management: Add, customize, and toggle stroke visibility
- Effects: Click + in Effects panel to add drop shadows
- Export: Click + in Export panel to export as PNG
- Images: Drag & drop images, use image tool, or browse assets gallery
- Comments: Click comment tool, then click on canvas
- Zoom: Comprehensive zoom controls with presets (10%-400%)
- Pages: Create multiple design pages and switch between them
- Assets: Upload and manage images in dedicated assets gallery
- Search: Real-time search with dynamic highlighting and focusing
V- Select toolH- Hand toolR- RectangleO- EllipseL- LineT- TextP- PenF- Frame
Cmd/Ctrl + Kor/- Open command paletteShift + Click- Multi-select elementsDelete/Backspace- Delete selected shapesCmd/Ctrl + +- Zoom inCmd/Ctrl + -- Zoom outCmd/Ctrl + 0- Reset zoom to 100%Escape- Clear selection or close dialogs
- Zoom to Fit - Available in zoom dropdown
- Zoom to Selection - Available in zoom dropdown
- Alignment Tools - Use buttons in right sidebar Position section
- Flip Tools - Use buttons in right sidebar Transform section
- Stroke Controls - Add/remove/customize in right sidebar Stroke section
- Assets Gallery - Switch to Assets tab in left sidebar
- Dynamic Search - Click search icon in left sidebar Pages section
figma-clone/
โโโ index.html # Main HTML structure
โโโ styles.css # All styling and animations
โโโ app.js # Core application logic
โโโ README.md # This file
โโโ screenshots/ # Screenshot assets
- HTML5: Semantic structure and canvas management
- CSS3: Advanced styling, animations, grid layout
- Vanilla JavaScript: Full application logic without frameworks
- LocalStorage: Data persistence between sessions
- HTML5 Canvas: Image export functionality
this.state = {
tool: 'select', // Current active tool
zoom: 1, // Canvas zoom level (0.1 to 4.0)
shapes: [], // All shapes on canvas
comments: [], // All comments
selectedIds: new Set(), // Currently selected shapes (multi-selection)
pages: [], // Multiple design pages
currentPageId: null, // Active page identifier
assets: [], // Image assets gallery
activeTab: 'file', // Active sidebar tab (file/assets)
leftSidebarCollapsed: false,
rightSidebarCollapsed: false,
// ... more state
}- Unified shape rendering system
- SVG generation for complex shapes (arrows, polygons, stars)
- Dynamic property binding
- Effect application with CSS filters
- Real-time drop shadow preview
- Customizable X, Y, blur, spread, color, opacity
- Multiple effects per shape
- CSS filter-based implementation
- Figma Icon: Clean, minimal branding
- Project Title: Dedicated section below icon with project name and metadata
- File Tab:
- Pages: Project page management with search functionality
- Layers: Hierarchical shape listing with icons and visibility controls
- Assets Tab:
- Image Gallery: Upload, preview, and reuse images
- Asset Management: Organized library with delete and clear functions
- Infinite Scroll: 10000x10000px virtual canvas
- Zoom System: Smooth scaling with rulers
- Shape Rendering: Real-time shape updates
- Selection System: Multi-shape selection with handles
- Top Controls: Design/Prototype mode switch, zoom controls, Share button
- Position: X, Y coordinates with 6 alignment tools (left, center-h, right, top, center-v, bottom)
- Layout: Width, height, constraints controls
- Transform: Rotation controls with flip horizontal/vertical buttons
- Appearance: Opacity, corner radius, visibility toggles
- Fill: Color picker with hex input and opacity control
- Stroke: Complete stroke management (add, color, width, visibility, remove)
- Effects: Drop shadow configuration with full controls
- Export: PNG export with real-time preview
- Tool Groups: Organized tool categories
- Dropdowns: Nested tool selection
- View Controls: Rulers, zoom, developer mode
All data is automatically saved to browser localStorage:
// Saved data structure
{
shapes: [
{
id: "unique-id",
type: "rectangle",
x: 100, y: 100,
w: 200, h: 150,
fill: "#0969da",
effects: [...],
// ... other properties
}
],
comments: [
{
id: "comment-id",
x: 300, y: 200,
text: "Design feedback",
timestamp: "2023-..."
}
],
timestamp: "2023-..."
}:root {
--bg-0: #1e1e1e; /* Primary background */
--bg-1: #2d2d2d; /* Secondary background */
--text: #ffffff; /* Primary text */
--accent: #0969da; /* Brand accent */
--border: #3c3c3c; /* Border color */
--shadow: 0 4px 12px rgba(0,0,0,0.15);
}- Smooth transitions with
cubic-beziereasing - Transform-based animations for performance
- Backdrop blur for modern glass effects
- Micro-interactions on hover states
- Add shape type to tool creation logic
- Implement rendering in
renderShape()method - Add SVG generation method if needed
- Update layer icons in
getShapeIcon()
- Extend effects system in
addEffect()method - Add UI controls in
createEffectElement() - Implement CSS filter in
applyEffects() - Update export canvas rendering
- Modify CSS variables for theme changes
- Update component-specific styles
- Maintain responsive breakpoints
- Preserve animation timing
- โ Chrome 90+
- โ Firefox 88+
- โ Safari 14+
- โ Edge 90+
- CSS Grid Layout
- CSS Custom Properties
- HTML5 Canvas
- LocalStorage API
- File API (for image uploads)
- Clipboard API (for image paste)
- Efficient Rendering: Only re-render changed shapes
- Event Delegation: Minimal event listeners
- LocalStorage: Chunked data saving
- CSS Transforms: Hardware-accelerated animations
- Debounced Saving: Reduced localStorage writes
- Automatic cleanup of removed elements
- Efficient shape data structures
- Optimized image handling with base64
- More shape types (pentagon, octagon, custom polygons)
- Layer groups and nesting
- Copy/paste functionality
- Undo/redo system
- Grid and snap-to-grid
- Collaborative features
- Component system
- More export formats (SVG, PDF)
- Advanced text formatting
- Gradient fills
- More effects (blur, glow, etc.)
- Text selection may interfere with shape selection
- Large images may impact performance
- Complex shapes with many effects may slow rendering
- LocalStorage has size limitations (~5-10MB)
This is a learning project demonstrating vanilla JavaScript capabilities. Feel free to:
- Fork the repository
- Create feature branches
- Submit pull requests
- Report issues
- Suggest improvements
This project is open source and available under the MIT License.
- Figma: For the original design inspiration
- Lucide Icons: For the beautiful icon set
- Inter Font: For the professional typography
- CSS-Tricks: For various CSS techniques
- MDN Web Docs: For comprehensive web API documentation
Built with โค๏ธ using vanilla HTML, CSS, and JavaScript
A demonstration of what's possible without frameworks






