Skip to content

Commit d238e78

Browse files
committed
release: v0.2.0
1 parent c8314a9 commit d238e78

12 files changed

Lines changed: 126 additions & 123 deletions

File tree

.changeset/tidy-deer-retire.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/tired-snails-retire.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# amgiflol
22

3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- c8314a9: Adds new voting feature
8+
9+
### Patch Changes
10+
11+
- dcc0bd6: Add analytics module
12+
313
## 0.1.1
414

515
### Patch Changes

README.md

Lines changed: 83 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,97 @@
1-
# Amgiflol - A layout inspector web extension to match your pixels with Figma
1+
# Amgiflol - Figma-like Layout Inspector For Web
22

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.
44

5-
This extension is built with a modular architecture using wxt, Svelte 5, TypeScript, and Tailwind CSS
5+
## Target Audience
66

7-
## Features
7+
Any individual or web development teams including front-end developers, UI/UX designers, QA engineers, and product managers.
88

9-
1. Locate
10-
2. Screenshot
9+
## Usage Note
1110

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.
1312

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+
1618

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
1848

1949
```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
2355
```
2456

25-
## Directory structure
2657

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
2780
```
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
6693
```
94+
95+
---
96+
97+
**License**: MIT | **Build**: Vite + WXT + Svelte + TypeScript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amgiflol",
33
"description": "Figma-like Web Inspector for designers",
44
"private": true,
5-
"version": "0.1.1",
5+
"version": "0.2.0",
66
"type": "module",
77
"scripts": {
88
"build": "wxt build --mv3",

src/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { googleAnalytics4 } from "@wxt-dev/analytics/providers/google-analytics-
33

44
export default defineAppConfig({
55
analytics: {
6-
debug: true,
6+
debug: import.meta.env.DEV,
77
providers: [
88
googleAnalytics4({
99
apiSecret: import.meta.env.WXT_GA_API_SECRET,

src/entrypoints/background.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export default defineBackground(() => {
2-
console.log("Hello background!", { id: browser.runtime.id });
32
browser.runtime.onMessage.addListener(async (event, sender) => {
43
if (event.type === "SCREENSHOT" && sender.tab) {
54
captureHandler(sender.tab);

src/lib/core/ElementInspector.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ export class ElementInspector {
2929
};
3030
}
3131

32-
public findParentElement(element: HTMLElement): HTMLElement | null {
32+
public moveUp(element?: HTMLElement | null): HTMLElement | undefined {
3333
let current = element;
34-
let parent = element.parentElement;
34+
let parent = element?.parentElement;
3535
let safetyCounter = 20;
3636

37+
while (this.areSameSize(current, parent) && safetyCounter > 0) {
38+
parent = parent?.parentElement;
39+
safetyCounter--;
40+
}
41+
3742
while (parent && safetyCounter > 0) {
3843
if (!this.areSameSize(current, parent)) {
3944
return parent;
@@ -43,7 +48,7 @@ export class ElementInspector {
4348
safetyCounter--;
4449
}
4550

46-
return parent;
51+
return parent ? parent : undefined;
4752
}
4853

4954
public isExtensionElement(element: HTMLElement): boolean {
@@ -226,19 +231,20 @@ export class ElementInspector {
226231
return `${top} ${right} ${bottom} ${left}`;
227232
}
228233

229-
private areSameSize(element: Element, parent: Element): boolean {
230-
const elementRect = element.getBoundingClientRect();
231-
const parentRect = parent.getBoundingClientRect();
234+
public areSameSize(element?: HTMLElement | null, parent?: HTMLElement | null): boolean {
235+
if (element == null || parent == null) {
236+
return false;
237+
}
232238

233-
const widthDiff = Math.abs(elementRect.width - parentRect.width);
234-
const heightDiff = Math.abs(elementRect.height - parentRect.height);
239+
const widthDiff = Math.abs(element.offsetWidth - parent.offsetWidth);
240+
const heightDiff = Math.abs(element.offsetHeight - parent.offsetHeight);
235241

236-
return widthDiff < 2 && heightDiff < 2;
242+
return widthDiff < 2 && heightDiff < 2 || parent.style.display === "contents";
237243
}
238244

239245
private greatestCommonDivisor(a: number, b: number): number {
240246
return b === 0 ? a : this.greatestCommonDivisor(b, a % b);
241247
}
242248
}
243249

244-
export const elementInspector = ElementInspector.getInstance();
250+
export const elementInspector: ElementInspector = ElementInspector.getInstance();

src/lib/modules/ExtenstionSettings/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
2626
async function mount() {
2727
try {
28-
analytics.page(import.meta.env.ENTRYPOINT);
28+
analytics.page(location.href);
2929
3030
const [tab] = await browser.tabs.query({
3131
active: true,

src/lib/modules/Toolbar/ToolbarSettings.svelte

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<DropdownMenu.GroupHeading>
4646
<h4 class="m-0 ml-1 grid grid-cols-[0px_1fr]">
4747
<span></span>
48-
<span class="flex justify-between gap-3">
48+
<span class="min-w-[250px] flex justify-between items-center gap-3 font-inherit">
4949
<Switch
5050
bind:checked={uiStore
5151
.toolbar
@@ -67,7 +67,7 @@
6767
>
6868
<span></span>
6969
<span
70-
class="flex justify-between items-center gap-3"
70+
class="min-w-[250px] flex justify-between items-center gap-3"
7171
>
7272
<UpvoteAction
7373
key="auto-hide-toolbar"
@@ -81,7 +81,7 @@
8181
>
8282
<span></span>
8383
<span
84-
class="flex justify-between items-center gap-3"
84+
class="min-w-[250px] flex justify-between items-center gap-3"
8585
>
8686
<UpvoteAction
8787
key="auto-move-toolbar"
@@ -95,7 +95,7 @@
9595
>
9696
<span></span>
9797
<span
98-
class="flex justify-between items-center gap-3"
98+
class="min-w-[250px] flex justify-between items-center gap-3"
9999
>
100100
<UpvoteAction
101101
key="auto-move-sidepanel"
@@ -109,7 +109,7 @@
109109
>
110110
<span></span>
111111
<span
112-
class="flex justify-between items-center gap-3"
112+
class="min-w-[250px] flex justify-between items-center gap-3"
113113
>
114114
<UpvoteAction
115115
key="multiple-trackers"
@@ -123,7 +123,7 @@
123123
>
124124
<span></span>
125125
<span
126-
class="flex justify-between items-center gap-3"
126+
class="min-w-[250px] flex justify-between items-center gap-3"
127127
>
128128
<UpvoteAction
129129
key="neighbour-distances"
@@ -137,7 +137,7 @@
137137
>
138138
<span></span>
139139
<span
140-
class="flex justify-between items-center gap-3"
140+
class="min-w-[250px] flex justify-between items-center gap-3"
141141
>
142142
<UpvoteAction
143143
key="onscreeen-measurement-lines"
@@ -151,7 +151,7 @@
151151
>
152152
<span></span>
153153
<span
154-
class="flex justify-between items-center gap-3"
154+
class="min-w-[250px] flex justify-between items-center gap-3"
155155
>
156156
<UpvoteAction
157157
key="parent-traversal"
@@ -165,7 +165,7 @@
165165
>
166166
<span></span>
167167
<span
168-
class="flex justify-between items-center gap-3"
168+
class="min-w-[250px] flex justify-between items-center gap-3"
169169
>
170170
<UpvoteAction
171171
key="sibling-traversal"
@@ -179,7 +179,7 @@
179179
>
180180
<span></span>
181181
<span
182-
class="flex justify-between items-center gap-3"
182+
class="min-w-[250px] flex justify-between items-center gap-3"
183183
>
184184
<UpvoteAction
185185
key="viewport-resizer"
@@ -214,7 +214,7 @@
214214
{ checked },
215215
)}
216216
<span></span>
217-
<span class="flex justify-between gap-3">
217+
<span class="min-w-[250px] flex justify-between items-center gap-3">
218218
<Switch
219219
checked={checked}
220220
disabled
@@ -233,7 +233,7 @@
233233
{ checked },
234234
)}
235235
<span></span>
236-
<span class="flex justify-between gap-3">
236+
<span class="min-w-[250px] flex justify-between items-center gap-3">
237237
<Switch
238238
checked={checked}
239239
disabled

0 commit comments

Comments
 (0)