|
1 | | -# Amgiflol - A layout inspector web extension to match your pixels with Figma |
| 1 | +# Amgiflol - Figma-like Layout Inspector For Web |
2 | 2 |
|
3 | | -## Overview |
| 3 | +A browser extension that helps with design audit. Match web layouts with Figma designs through real-time element inspection, measurements, and visual overlays. |
4 | 4 |
|
5 | | -This extension is built with a modular architecture using wxt, Svelte 5, TypeScript, and Tailwind CSS |
| 5 | +## Target Audience |
6 | 6 |
|
7 | | -## Features |
| 7 | +Any individual or web development teams including front-end developers, UI/UX designers, QA engineers, and product managers. |
8 | 8 |
|
9 | | -1. Locate |
10 | | -2. Screenshot |
| 9 | +## Usage Note |
11 | 10 |
|
12 | | -## Environment Configuration |
| 11 | +I'm building this tool to act as an active visual debugger which is intended to be used at the end of a feature development cycle, since this is what I struggle with most of the time. |
13 | 12 |
|
14 | | -- Node Version >= 24 |
15 | | -- PNPM 10.12.3 |
| 13 | +1. This tool won't automatically point out alignment or style mismatch with your designs. |
| 14 | +2. Use during development or design audit cycle to get things right as early as possible. |
| 15 | +3. You may find some shortcuts not implemented or upto the industry standard. |
| 16 | +4. **This tool doesn't require you to login into any of your fav prototyping tool.** |
| 17 | + |
16 | 18 |
|
17 | | -## Building Source Code |
| 19 | +## Current Features |
| 20 | +- **Distance Measurements**: Meeasurements between element and it's parent |
| 21 | +- **Dynamic Rulers**: Mouse-following coordinate system |
| 22 | +- **Element Inspection**: Real-time hover detection with element information |
| 23 | +- **Keyboard Shortcuts**: Quick access to all features |
| 24 | +- **Lock/Unlock**: Persistent element tracking |
| 25 | +- **Screenshots**: Capture current page state with overlays |
| 26 | +- **Side Panel**: Detailed element properties, computed styles, attributes |
| 27 | +- **Toolbar**: Floating interface with auto-positioning |
| 28 | +- **Visual Overlays**: Highlight elements and parent relationships |
| 29 | + |
| 30 | + |
| 31 | +## Roadmap |
| 32 | + |
| 33 | +### 🔄 Current Development |
| 34 | +- **Feature Voting System**: User-driven feature prioritization |
| 35 | +- **Enhanced Measurements**: Area calculations, angle measurements |
| 36 | +- **Multiple Trackers**: Track multiple elements simultaneously |
| 37 | + |
| 38 | +### 🚀 Planned Features |
| 39 | +- **Auto-Hide/Move**: Smart UI positioning to avoid interference |
| 40 | +- **Neighbor Analysis**: Automatic sibling/parent distance detection |
| 41 | +- **Viewport Tools**: Responsive design testing utilities |
| 42 | +- **Parent/Sibling Traversal**: Navigate element hierarchy |
| 43 | + |
| 44 | + |
| 45 | +## Quick Setup |
| 46 | + |
| 47 | +**Requirements**: Node.js ≥24, PNPM 10.12.3 |
18 | 48 |
|
19 | 49 | ```bash |
20 | | -pnpm i |
21 | | -pnpm build:firefox |
22 | | -pnpm zip:firefox |
| 50 | +pnpm install |
| 51 | +pnpm dev:firefox # Development mode for Firefox |
| 52 | +---- or ---- |
| 53 | +pnpm build:firefox # Build for Firefox |
| 54 | +pnpm zip:firefox # Create distribution package for firefox |
23 | 55 | ``` |
24 | 56 |
|
25 | | -## Directory structure |
26 | 57 |
|
| 58 | + |
| 59 | + |
| 60 | +## Development |
| 61 | + |
| 62 | +### State Management |
| 63 | +- **Reactive Stores**: Svelte 5 runes for optimal performance |
| 64 | +- **Cross-Context Communication**: Typed message bus system |
| 65 | +- **Storage Sync**: Browser storage integration with per-domain settings |
| 66 | + |
| 67 | +### Component Architecture |
| 68 | +``` |
| 69 | +src/lib/ |
| 70 | +├── components/ # UI components (Tracker, Ruler, Measurements) |
| 71 | +├── modules/ # Features (Toolbar, SidePanel, EventsManager) |
| 72 | +├── core/ # Business logic (ElementInspector, MessageBus) |
| 73 | +└── store/ # State management (UI, Trackers, Metadata) |
| 74 | +``` |
| 75 | + |
| 76 | +### Internal | Developer Tools |
| 77 | +- **Debug Interface**: Performance metrics, message history (dev mode only) |
| 78 | + |
| 79 | +### File Structure |
27 | 80 | ``` |
28 | | -amgiflol/ |
29 | | -├── src/ |
30 | | -│ ├── entrypoints/ # Extension entry points |
31 | | -│ │ ├── background.ts # Background script for cross-tab communication |
32 | | -│ │ ├── content.ts # Content script injection point |
33 | | -│ │ └── popup/ # Extension popup interface |
34 | | -│ │ ├── index.html # Popup HTML template |
35 | | -│ │ └── main.ts # Popup Svelte app entry |
36 | | -│ ├── lib/ |
37 | | -│ │ ├── Main.svelte # Content script root component |
38 | | -│ │ ├── components/ # Reusable UI components |
39 | | -│ │ │ ├── Measurements.svelte # SVG measurement system |
40 | | -│ │ │ ├── Ruler.svelte # Dynamic ruler overlay |
41 | | -│ │ │ ├── SelectorManager.svelte # Element selection management |
42 | | -│ │ │ ├── Switch.svelte # Custom switch component |
43 | | -│ │ │ ├── Tooltip.svelte # Tooltip wrapper |
44 | | -│ │ │ └── Tracker.svelte # Element tracking overlay |
45 | | -│ │ ├── core/ # Core business logic |
46 | | -│ │ │ ├── ElementInspector.ts # DOM analysis utilities |
47 | | -│ │ │ └── MessageBus.ts # Cross-context messaging |
48 | | -│ │ ├── modules/ # Feature modules |
49 | | -│ │ │ ├── DebugToolbar/ # Development debugging interface |
50 | | -│ │ │ ├── EventsManager/ # Global event handling |
51 | | -│ │ │ ├── ExtensionSettings/ # Popup settings interface |
52 | | -│ │ │ ├── SidePanel/ # Element details panel |
53 | | -│ │ │ ├── SvgManager/ # SVG overlay management |
54 | | -│ │ │ └── Toolbar/ # Main toolbar interface |
55 | | -│ │ └── store/ # State management |
56 | | -│ │ ├── MetaDataStore.svelte.ts # Mouse and window state |
57 | | -│ │ ├── TrackersStore.svelte.ts # Element tracking state |
58 | | -│ │ ├── TrackerState.svelte.ts # Individual tracker state |
59 | | -│ │ ├── UIStore.svelte.ts # UI state management |
60 | | -│ │ └── index.svelte.ts # Store exports |
61 | | -│ ├── assets/ # Static assets |
62 | | -│ │ └── svelte.svg # Svelte logo |
63 | | -│ ├── utils/ # Utility functions |
64 | | -│ │ └── data-urls.ts # Data URL manipulation |
65 | | -│ └── app.d.ts # Global type definitions |
| 81 | +src/ |
| 82 | +├── entrypoints/ # Extension entry points |
| 83 | +│ ├── background.ts # Background script |
| 84 | +│ ├── content.ts # Content script injection |
| 85 | +│ └── popup/ # Extension popup |
| 86 | +├── lib/ |
| 87 | +│ ├── Main.svelte # Content script root |
| 88 | +│ ├── components/ # Reusable UI components |
| 89 | +│ ├── modules/ # Feature modules |
| 90 | +│ ├── core/ # Core utilities |
| 91 | +│ └── store/ # State management |
| 92 | +└── utils/ # Helper functions |
66 | 93 | ``` |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +**License**: MIT | **Build**: Vite + WXT + Svelte + TypeScript |
0 commit comments