50 Commits

Author SHA1 Message Date
5b31171964 0.6.15
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-03-03 00:02:34 +00:00
e98761a18e feat: make header title a link to home page 2026-03-03 00:02:17 +00:00
bc8168e724 0.6.14
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-03-02 23:59:04 +00:00
dcde3b0799 feat: add ESC key support to close all modals and fullscreen modes 2026-03-02 23:58:50 +00:00
60fc774586 0.6.13
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-03-02 23:37:12 +00:00
d65c0d0357 docs: replace problematic emoji in README.md with safer alternative 2026-03-02 23:36:57 +00:00
02736ecc70 0.6.12
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-03-02 23:32:21 +00:00
7b1d19ca7a docs: fix corrupted emoji in README.md 2026-03-02 23:32:12 +00:00
4846d0e61c 0.6.11
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-03-02 23:26:45 +00:00
3155e12b84 feat: display README.md on home page using marked 2026-03-02 23:26:36 +00:00
b8bbe84aa9 docs: add descriptions for all new tools (QR Gen, QR Scanner, URL Cleaner) to README 2026-03-02 23:24:03 +00:00
74984caf9e 0.6.10
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-28 18:07:22 +00:00
c8b799b078 fix: mirror background canvas for front camera in fullscreen mode 2026-02-28 18:07:10 +00:00
f3a4c1af05 0.6.9
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-02-28 18:05:14 +00:00
616f615d7c fix: improve front camera detection on macOS by checking video track label 2026-02-28 18:04:28 +00:00
4d572b55ca 0.6.8
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-28 17:51:40 +00:00
9822cab93e feat: restore QR code detection overlay in custom QrScanner 2026-02-28 17:50:29 +00:00
9409bd3e21 0.6.7
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-02-28 17:46:21 +00:00
346ded460a chore: remove wasm file from repo and add to gitignore 2026-02-28 17:45:21 +00:00
170539a62f 0.6.6
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-28 17:41:06 +00:00
cfc1785863 chore: cleanup unused code in QrScanner and remove vue-qrcode-reader dependency 2026-02-28 17:40:42 +00:00
712b1238a5 0.6.5
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-02-28 17:34:35 +00:00
3732d365dd refactor: replace vue-qrcode-reader with custom native QR scanner using local BarcodeDetector polyfill 2026-02-28 17:31:04 +00:00
34fd8bb2b3 0.6.4
All checks were successful
Deploy to Production / deploy (push) Successful in 14s
2026-02-28 17:21:46 +00:00
90dc663393 fix: use local zxing-wasm file to resolve CSP issues in QrScanner 2026-02-28 17:21:29 +00:00
1c4bdeff0e 0.6.3
All checks were successful
Deploy to Production / deploy (push) Successful in 15s
2026-02-28 17:10:17 +00:00
35c5ff4c51 fix: ensure useFillHeight recalculates when element appears (v-if) 2026-02-28 17:09:42 +00:00
c8f9dfb37e 0.6.2
All checks were successful
Deploy to Production / deploy (push) Successful in 15s
2026-02-28 04:19:41 +00:00
70d7c8873e refactor: centralize UI config and inject CSS variables dynamically 2026-02-28 04:18:53 +00:00
d5d3d37804 refactor: simplify useLocalStorage (remove APP_PREFIX) and finalize QR Code tool 2026-02-28 04:05:07 +00:00
2a1897f68d feat: enhance QR generator with responsive layout, custom focus styles, and download options 2026-02-28 03:50:47 +00:00
b2e8f23d60 0.6.1
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-27 19:43:31 +00:00
d2ea9e3fc7 chore: UI spacing tweaks, desktop scrolling fix, QR title alignment 2026-02-27 19:43:12 +00:00
1765742574 0.6.0
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-27 19:03:09 +00:00
5b1a50f148 chore: prepare release; reintroduce front camera CSS mirror, stabilize QR Scanner 2026-02-27 19:02:49 +00:00
613604f3c4 feat(qr-scanner): remove frame, add shape detection overlay, improve fullscreen desktop layout 2026-02-27 17:52:36 +00:00
a699b432d7 0.5.0
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-27 17:00:41 +00:00
839a98a658 feat: add QR Scanner tool with history, export, persistence and fullscreen support 2026-02-27 17:00:11 +00:00
fd23860bcf 0.4.6
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
2026-02-27 09:16:51 +00:00
74c0251535 feat: improve url cleaner modal ui (light mode) and enable rule editing 2026-02-27 09:16:37 +00:00
06b2815dd9 0.4.5
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-27 08:51:31 +00:00
1346de684c feat: url cleaner multiline support and ui tweaks 2026-02-27 08:51:05 +00:00
cfc9ac73b2 0.4.4
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
2026-02-27 07:43:26 +00:00
e095c0190b style: restore danger styling for stop sniffing button 2026-02-27 07:43:12 +00:00
45342d456a 0.4.3
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
2026-02-27 07:09:38 +00:00
3ea7f63b83 style: remove panel borders and backgrounds on mobile for cleaner look 2026-02-27 07:09:27 +00:00
8b5705c12f 0.4.2
All checks were successful
Deploy to Production / deploy (push) Successful in 13s
2026-02-27 07:03:14 +00:00
a3bc069029 fix: responsive layout for url cleaner and sniffer icon alignment 2026-02-27 07:02:58 +00:00
a5fc242a97 0.4.1
All checks were successful
Deploy to Production / deploy (push) Successful in 12s
2026-02-27 06:49:01 +00:00
a0346a64f0 feat: url cleaner exceptions keep-all and defaults reset 2026-02-27 06:48:39 +00:00
24 changed files with 2734 additions and 74 deletions

1
.gitignore vendored
View File

@@ -11,6 +11,7 @@ node_modules
dist dist
dist-ssr dist-ssr
*.local *.local
public/wasm
# Editor directories and files # Editor directories and files
.vscode/* .vscode/*

View File

@@ -20,6 +20,26 @@ Monitor and capture your clipboard history in real-time.
- Clears history on demand. - Clears history on demand.
- Privacy-focused: Data is processed locally and never sent to any server. - Privacy-focused: Data is processed locally and never sent to any server.
### 🔗 URL Cleaner
Clean tracking parameters and clutter from URLs.
- **Privacy:** Removes known tracking parameters (UTM, fbclid, gclid, etc.).
- **Bulk Processing:** Clean list of URLs at once.
- **Customizable:** Manage exceptions to keep specific parameters.
- **Smart:** "Direct Clean" mode for quick single-URL cleaning.
### ⬛ QR Generator
Create custom QR codes instantly.
- **Customizable:** Adjustable error correction level and size.
- **Download:** Save as PNG (raster) or SVG (vector) for high-quality printing.
- **Persistent Settings:** Remembers your preferences.
### 📷 QR Scanner
Scan QR codes directly from your camera or device.
- **Privacy First:** Works entirely in the browser using local `BarcodeDetector` API. No images are sent to any server.
- **Multi-Camera:** Support for front and back cameras with easy switching.
- **History:** Keeps a log of scanned codes with options to copy or download as JSON.
- **Responsive:** Fullscreen mode for immersive scanning experience.
--- ---
## Chrome Extension 🧩 ## Chrome Extension 🧩

380
package-lock.json generated
View File

@@ -1,14 +1,18 @@
{ {
"name": "tools-app", "name": "tools-app",
"version": "0.4.0", "version": "0.6.15",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "tools-app", "name": "tools-app",
"version": "0.4.0", "version": "0.6.15",
"hasInstallScript": true,
"dependencies": { "dependencies": {
"barcode-detector": "^3.1.0",
"lucide-vue-next": "^0.575.0", "lucide-vue-next": "^0.575.0",
"marked": "^17.0.3",
"qrcode": "^1.5.4",
"vue": "^3.5.25", "vue": "^3.5.25",
"vue-router": "^5.0.3" "vue-router": "^5.0.3"
}, },
@@ -2514,6 +2518,12 @@
"sourcemap-codec": "^1.4.8" "sourcemap-codec": "^1.4.8"
} }
}, },
"node_modules/@types/emscripten": {
"version": "1.41.5",
"resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.41.5.tgz",
"integrity": "sha512-cMQm7pxu6BxtHyqJ7mQZ2kXWV5SLmugybFdHCBbJ5eHzOo6VhBckEgAT3//rP5FwPHNPeEiq4SmQ5ucBwsOo4Q==",
"license": "MIT"
},
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
@@ -2741,6 +2751,30 @@
"url": "https://github.com/sponsors/epoberezkin" "url": "https://github.com/sponsors/epoberezkin"
} }
}, },
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/array-buffer-byte-length": { "node_modules/array-buffer-byte-length": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz",
@@ -2907,6 +2941,15 @@
"node": "18 || 20 || >=22" "node": "18 || 20 || >=22"
} }
}, },
"node_modules/barcode-detector": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/barcode-detector/-/barcode-detector-3.1.0.tgz",
"integrity": "sha512-aQjGxrgsb/WTlw6pHZwFRO6NhFMhwHGEkd0pzV25fBn8dnRA1PA1G7bLeAzvSea646S/96nW5W3jD8wezQZ1vQ==",
"license": "MIT",
"dependencies": {
"zxing-wasm": "3.0.0"
}
},
"node_modules/baseline-browser-mapping": { "node_modules/baseline-browser-mapping": {
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz",
@@ -3033,6 +3076,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001774", "version": "1.0.30001774",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz",
@@ -3069,6 +3121,35 @@
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/commander": { "node_modules/commander": {
"version": "2.20.3", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -3231,6 +3312,15 @@
} }
} }
}, },
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/deepmerge": { "node_modules/deepmerge": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
@@ -3277,6 +3367,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
"license": "MIT"
},
"node_modules/dunder-proto": { "node_modules/dunder-proto": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@@ -3315,6 +3411,12 @@
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/entities": { "node_modules/entities": {
"version": "7.0.1", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
@@ -3625,6 +3727,19 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"license": "MIT",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/for-each": { "node_modules/for-each": {
"version": "0.3.5", "version": "0.3.5",
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz",
@@ -3750,6 +3865,15 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/get-intrinsic": { "node_modules/get-intrinsic": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -4139,6 +4263,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/is-generator-function": { "node_modules/is-generator-function": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz",
@@ -4542,6 +4675,18 @@
"url": "https://github.com/sponsors/antfu" "url": "https://github.com/sponsors/antfu"
} }
}, },
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"license": "MIT",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/lodash": { "node_modules/lodash": {
"version": "4.17.23", "version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
@@ -4606,6 +4751,18 @@
"url": "https://github.com/sponsors/sxzz" "url": "https://github.com/sponsors/sxzz"
} }
}, },
"node_modules/marked": {
"version": "17.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-17.0.3.tgz",
"integrity": "sha512-jt1v2ObpyOKR8p4XaUJVk3YWRJ5n+i4+rjQopxvV32rSndTJXvIzuUdWWIy/1pFQMkQmvTXawzDNqOH/CUmx6A==",
"license": "MIT",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 20"
}
},
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -4777,6 +4934,42 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"license": "MIT",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/package-json-from-dist": { "node_modules/package-json-from-dist": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
@@ -4784,6 +4977,15 @@
"dev": true, "dev": true,
"license": "BlueOak-1.0.0" "license": "BlueOak-1.0.0"
}, },
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/path-key": { "node_modules/path-key": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
@@ -4869,6 +5071,15 @@
"pathe": "^2.0.3" "pathe": "^2.0.3"
} }
}, },
"node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/possible-typed-array-names": { "node_modules/possible-typed-array-names": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
@@ -4930,6 +5141,23 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/qrcode": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
"license": "MIT",
"dependencies": {
"dijkstrajs": "^1.0.1",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/quansync": { "node_modules/quansync": {
"version": "0.2.11", "version": "0.2.11",
"resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz",
@@ -5071,6 +5299,15 @@
"regjsparser": "bin/parser" "regjsparser": "bin/parser"
} }
}, },
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/require-from-string": { "node_modules/require-from-string": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
@@ -5081,6 +5318,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"license": "ISC"
},
"node_modules/resolve": { "node_modules/resolve": {
"version": "1.22.11", "version": "1.22.11",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",
@@ -5255,6 +5498,12 @@
"randombytes": "^2.1.0" "randombytes": "^2.1.0"
} }
}, },
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
"node_modules/set-function-length": { "node_modules/set-function-length": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
@@ -5501,6 +5750,20 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/string.prototype.matchall": { "node_modules/string.prototype.matchall": {
"version": "4.0.12", "version": "4.0.12",
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz",
@@ -5603,6 +5866,18 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-comments": { "node_modules/strip-comments": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz",
@@ -5638,6 +5913,18 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/tagged-tag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz",
"integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==",
"license": "MIT",
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/temp-dir": { "node_modules/temp-dir": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz",
@@ -6247,6 +6534,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"license": "ISC"
},
"node_modules/which-typed-array": { "node_modules/which-typed-array": {
"version": "1.1.20", "version": "1.1.20",
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz",
@@ -6598,6 +6891,26 @@
"workbox-core": "7.4.0" "workbox-core": "7.4.0"
} }
}, },
"node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"license": "ISC"
},
"node_modules/yallist": { "node_modules/yallist": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
@@ -6619,6 +6932,69 @@
"funding": { "funding": {
"url": "https://github.com/sponsors/eemeli" "url": "https://github.com/sponsors/eemeli"
} }
},
"node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"license": "MIT",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/zxing-wasm": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/zxing-wasm/-/zxing-wasm-3.0.0.tgz",
"integrity": "sha512-s7ASCPKX+QnH7Y83f4Byxmq/vDzYW7B9m6jMP5S30JGfN2A6WAUn6P3vcBmNguDhPLE6ny2fjTooQVyKBXI1qA==",
"license": "MIT",
"dependencies": {
"@types/emscripten": "^1.41.5",
"type-fest": "^5.4.4"
},
"peerDependencies": {
"@types/emscripten": ">=1.39.6"
}
},
"node_modules/zxing-wasm/node_modules/type-fest": {
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.4.tgz",
"integrity": "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw==",
"license": "(MIT OR CC0-1.0)",
"dependencies": {
"tagged-tag": "^1.0.0"
},
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
} }
} }
} }

View File

@@ -1,15 +1,19 @@
{ {
"name": "tools-app", "name": "tools-app",
"private": true, "private": true,
"version": "0.4.0", "version": "0.6.15",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview" "preview": "vite preview",
"postinstall": "mkdir -p public/wasm && cp node_modules/zxing-wasm/dist/reader/zxing_reader.wasm public/wasm/"
}, },
"dependencies": { "dependencies": {
"barcode-detector": "^3.1.0",
"lucide-vue-next": "^0.575.0", "lucide-vue-next": "^0.575.0",
"marked": "^17.0.3",
"qrcode": "^1.5.4",
"vue": "^3.5.25", "vue": "^3.5.25",
"vue-router": "^5.0.3" "vue-router": "^5.0.3"
}, },

View File

@@ -6,6 +6,7 @@ import Footer from './components/Footer.vue'
import Sidebar from './components/Sidebar.vue' import Sidebar from './components/Sidebar.vue'
import InstallPrompt from './components/InstallPrompt.vue' import InstallPrompt from './components/InstallPrompt.vue'
import ReloadPrompt from './components/ReloadPrompt.vue' import ReloadPrompt from './components/ReloadPrompt.vue'
import { UI_CONFIG } from './config/ui'
const isSidebarOpen = ref(window.innerWidth >= 768) const isSidebarOpen = ref(window.innerWidth >= 768)
const router = useRouter() const router = useRouter()
@@ -31,6 +32,11 @@ const handleResize = () => {
} }
onMounted(() => { onMounted(() => {
// Set global CSS variables from config
document.documentElement.style.setProperty('--header-height', `${UI_CONFIG.headerHeight}px`)
document.documentElement.style.setProperty('--footer-height', `${UI_CONFIG.footerHeight}px`)
document.documentElement.style.setProperty('--page-padding', `${UI_CONFIG.pagePadding}px`)
window.addEventListener('resize', handleResize) window.addEventListener('resize', handleResize)
}) })
@@ -67,22 +73,29 @@ onUnmounted(() => {
.main-content { .main-content {
flex: 1; flex: 1;
padding: 2rem; padding: 1rem;
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
/* Space for fixed footer on mobile + extra margin (match top padding 2rem + footer height ~40px) */ /* Space for fixed footer on mobile + extra margin */
padding-bottom: calc(2rem + 40px + env(safe-area-inset-bottom)); padding-bottom: calc(1rem + var(--footer-height) + env(safe-area-inset-bottom));
}
@media (max-width: 640px) {
.main-content {
padding: 0.5rem;
padding-bottom: calc(0.5rem + var(--footer-height) + env(safe-area-inset-bottom));
}
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.app-body { .app-body {
overflow: hidden; overflow: visible;
} }
.main-content { .main-content {
overflow-y: auto; overflow: visible;
height: 100%; height: auto;
padding-bottom: 2rem; padding-bottom: 1rem;
} }
} }

View File

@@ -14,7 +14,8 @@ const version = __APP_VERSION__;
<style scoped> <style scoped>
.app-footer { .app-footer {
width: 100%; width: 100%;
padding: 0.5rem; height: var(--footer-height);
padding: 0 0.5rem;
/* Background handled by glass-panel */ /* Background handled by glass-panel */
border-left: none; border-left: none;
border-right: none; border-right: none;
@@ -24,12 +25,9 @@ const version = __APP_VERSION__;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 10; z-index: 10;
/* Remove fixed height to allow content to dictate size */
/* height: 30px; */
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
} }
@media (min-width: 768px) { @media (min-width: 768px) {

View File

@@ -44,7 +44,7 @@ onMounted(() => {
<line x1="3" y1="18" x2="21" y2="18"></line> <line x1="3" y1="18" x2="21" y2="18"></line>
</svg> </svg>
</button> </button>
<h1 class="app-title">Tools App</h1> <router-link to="/" class="app-title">Tools App</router-link>
</div> </div>
<button <button
@@ -63,9 +63,12 @@ onMounted(() => {
<style scoped> <style scoped>
.app-header { .app-header {
/* Remove hardcoded colors and use theme variables */ /* Remove hardcoded colors and use theme variables */
background: var(--glass-bg); background: var(--header-bg);
color: var(--text-color); color: var(--text-color);
padding: 1rem; height: var(--header-height);
padding: 0 1rem;
display: flex;
align-items: center;
/* box-shadow handled by glass-panel class */ /* box-shadow handled by glass-panel class */
position: sticky; position: sticky;
top: 0; top: 0;
@@ -77,7 +80,7 @@ onMounted(() => {
} }
.header-content { .header-content {
max-width: 100%; width: 100%;
padding: 0; padding: 0;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
@@ -112,10 +115,11 @@ onMounted(() => {
.app-title { .app-title {
margin: 0; margin: 0;
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 600;
background: var(--title-gradient); background: var(--title-gradient);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text; background-clip: text;
color: transparent;
text-decoration: none;
font-weight: bold;
} }
</style> </style>

View File

@@ -51,12 +51,20 @@ const dismissPrompt = () => {
deferredPrompt = null deferredPrompt = null
} }
const handleKeydown = (e) => {
if (e.key === 'Escape' && showInstallPrompt.value) {
dismissPrompt()
}
}
onMounted(() => { onMounted(() => {
window.addEventListener('beforeinstallprompt', handleBeforeInstallPrompt) window.addEventListener('beforeinstallprompt', handleBeforeInstallPrompt)
window.addEventListener('keydown', handleKeydown)
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
window.removeEventListener('beforeinstallprompt', handleBeforeInstallPrompt) window.removeEventListener('beforeinstallprompt', handleBeforeInstallPrompt)
window.removeEventListener('keydown', handleKeydown)
}) })
</script> </script>

View File

@@ -1,11 +1,99 @@
<script setup> <script setup>
import { ref } from 'vue' import { marked } from 'marked'
import { computed } from 'vue'
import readmeContent from '../../README.md?raw'
const htmlContent = computed(() => {
return marked(readmeContent)
})
</script> </script>
<template> <template>
main <div class="readme-container glass-panel">
<div class="markdown-body" v-html="htmlContent"></div>
</div>
</template> </template>
<style scoped> <style scoped>
.readme-container {
padding: 2rem;
max-width: 800px;
margin: 0 auto;
}
.markdown-body :deep(h1) {
font-size: 2rem;
margin-bottom: 1rem;
color: var(--primary-accent);
}
.markdown-body :deep(h2) {
font-size: 1.5rem;
margin-top: 2rem;
margin-bottom: 1rem;
border-bottom: 1px solid var(--glass-border);
padding-bottom: 0.5rem;
color: var(--text-strong);
}
.markdown-body :deep(h3) {
font-size: 1.25rem;
margin-top: 1.5rem;
margin-bottom: 0.75rem;
color: var(--text-strong);
}
.markdown-body :deep(p) {
margin-bottom: 1rem;
line-height: 1.6;
color: var(--text-color);
}
.markdown-body :deep(ul) {
margin-bottom: 1rem;
padding-left: 1.5rem;
}
.markdown-body :deep(li) {
margin-bottom: 0.5rem;
color: var(--text-color);
}
.markdown-body :deep(a) {
color: var(--primary-accent);
text-decoration: none;
}
.markdown-body :deep(a:hover) {
text-decoration: underline;
}
.markdown-body :deep(code) {
background: rgba(255, 255, 255, 0.1);
padding: 0.2em 0.4em;
border-radius: 4px;
font-family: monospace;
font-size: 0.9em;
}
.markdown-body :deep(pre) {
background: rgba(0, 0, 0, 0.3);
padding: 1rem;
border-radius: 8px;
overflow-x: auto;
margin-bottom: 1rem;
border: 1px solid var(--glass-border);
}
.markdown-body :deep(pre code) {
background: none;
padding: 0;
color: #e6e6e6;
}
.markdown-body :deep(hr) {
border: none;
border-top: 1px solid var(--glass-border);
margin: 2rem 0;
}
</style> </style>

View File

@@ -13,6 +13,8 @@ defineProps({
<router-link to="/passwords" class="nav-item" v-ripple>Passwords</router-link> <router-link to="/passwords" class="nav-item" v-ripple>Passwords</router-link>
<router-link to="/clipboard-sniffer" class="nav-item" v-ripple>Clipboard Sniffer</router-link> <router-link to="/clipboard-sniffer" class="nav-item" v-ripple>Clipboard Sniffer</router-link>
<router-link to="/url-cleaner" class="nav-item" v-ripple>URL Cleaner</router-link> <router-link to="/url-cleaner" class="nav-item" v-ripple>URL Cleaner</router-link>
<router-link to="/qr-scanner" class="nav-item" v-ripple>QR Scanner</router-link>
<router-link to="/qr-code" class="nav-item" v-ripple>QR Code</router-link>
</nav> </nav>
</aside> </aside>
</template> </template>

View File

@@ -51,8 +51,10 @@ const clearText = () => {
<div class="tool-panel"> <div class="tool-panel">
<div class="tool-header"> <div class="tool-header">
<h2 class="tool-title">Clipboard Sniffer</h2> <h2 class="tool-title">Clipboard Sniffer</h2>
<div class="extension-indicator-wrapper">
<ExtensionStatus :isReady="isExtensionReady" /> <ExtensionStatus :isReady="isExtensionReady" />
</div> </div>
</div>
<div class="controls"> <div class="controls">
<button <button
@@ -67,7 +69,7 @@ const clearText = () => {
</button> </button>
<button <button
v-else v-else
class="btn-neon active" class="btn-neon danger"
@click="stopListening" @click="stopListening"
v-ripple v-ripple
> >
@@ -110,6 +112,7 @@ const clearText = () => {
justify-content: center; justify-content: center;
gap: 1rem; gap: 1rem;
flex-wrap: wrap; flex-wrap: wrap;
flex-shrink: 0;
} }
.tool-container.full-width { .tool-container.full-width {
@@ -124,6 +127,9 @@ const clearText = () => {
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
gap: 1.5rem; gap: 1.5rem;
/* Override shared tool-panel scroll for this tool */
max-height: none;
overflow: hidden;
} }
.tool-textarea { .tool-textarea {
@@ -144,4 +150,17 @@ const clearText = () => {
outline: none; outline: none;
border-color: var(--primary-accent); border-color: var(--primary-accent);
} }
.extension-indicator-wrapper {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
display: flex;
}
.result-area {
flex: 1;
display: flex;
}
</style> </style>

View File

@@ -142,7 +142,6 @@ const generatePasswords = () => {
class="tool-textarea" class="tool-textarea"
v-model="result" v-model="result"
placeholder="Generated passwords will appear here..." placeholder="Generated passwords will appear here..."
readonly
></textarea> ></textarea>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,299 @@
<script setup>
import { ref, watch, onMounted } from 'vue'
import { Download } from 'lucide-vue-next'
import QRCode from 'qrcode'
import { useFillHeight } from '../../composables/useFillHeight'
import { useLocalStorage } from '../../composables/useLocalStorage'
const text = useLocalStorage('text', '', 'qr-code')
const ecc = useLocalStorage('ecc', 'M', 'qr-code')
const size = useLocalStorage('size', 300, 'qr-code')
const format = useLocalStorage('format', 'png', 'qr-code')
const svgContent = ref('')
const previewRef = ref(null)
const { height: previewHeight } = useFillHeight(previewRef, 40) // 40px extra margin
const generateQR = async () => {
if (!text.value) {
svgContent.value = ''
return
}
try {
// Generate SVG for preview (always sharp)
svgContent.value = await QRCode.toString(text.value, {
type: 'svg',
errorCorrectionLevel: ecc.value,
margin: 1,
// No fixed width, allow scaling via CSS
})
} catch (err) {
console.error('QR Generation failed', err)
svgContent.value = ''
}
}
// Debounce generation slightly to avoid lag on typing
let timeout
watch([text, ecc], () => { // size is not relevant for preview
clearTimeout(timeout)
timeout = setTimeout(generateQR, 300)
})
onMounted(() => {
if (text.value) generateQR()
})
const downloadFile = async () => {
if (!text.value) return
const filename = `qr-code-${Date.now()}.${format.value}`
if (format.value === 'svg') {
// For SVG download, we might want to inject the size if user specifically requested it,
// but usually raw SVG is better.
// If we want to support the "Size" dropdown for SVG download, we can regenerate with specific width.
const svgWithSize = await QRCode.toString(text.value, {
type: 'svg',
errorCorrectionLevel: ecc.value,
margin: 1,
width: size.value
})
const blob = new Blob([svgWithSize], { type: 'image/svg+xml' })
triggerDownload(blob, filename)
} else {
// For raster formats, render to canvas first
try {
const canvas = document.createElement('canvas')
await QRCode.toCanvas(canvas, text.value, {
errorCorrectionLevel: ecc.value,
margin: 1,
width: size.value
})
const mime = `image/${format.value}`
canvas.toBlob((blob) => {
if (blob) triggerDownload(blob, filename)
}, mime)
} catch (err) {
console.error('Download failed', err)
}
}
}
const triggerDownload = (blob, filename) => {
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = filename
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
</script>
<template>
<div class="tool-container full-width">
<div class="tool-panel">
<div class="panel-header">
<h2 class="tool-title">QR Generator</h2>
</div>
<div class="input-section">
<textarea
v-model="text"
class="tool-textarea"
placeholder="Enter text to generate QR code..."
rows="3"
></textarea>
</div>
<div class="controls-section">
<div class="control-group">
<label>Error Correction</label>
<select v-model="ecc" class="select-input">
<option value="L">Low (7%)</option>
<option value="M">Medium (15%)</option>
<option value="Q">Quartile (25%)</option>
<option value="H">High (30%)</option>
</select>
</div>
<div class="control-group">
<label>Size (px)</label>
<select v-model="size" class="select-input">
<option :value="150">150x150</option>
<option :value="300">300x300</option>
<option :value="500">500x500</option>
<option :value="1000">1000x1000</option>
</select>
</div>
<div class="control-group">
<label>Format</label>
<select v-model="format" class="select-input">
<option value="png">PNG</option>
<option value="jpeg">JPG</option>
<option value="webp">WebP</option>
<option value="svg">SVG</option>
</select>
</div>
</div>
<div class="preview-section" v-if="text" ref="previewRef" :style="{ height: previewHeight }">
<div class="qr-frame" v-html="svgContent"></div>
<div class="actions">
<button class="action-btn" @click="downloadFile">
<Download size="18" />
Download {{ format.toUpperCase() }}
</button>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.tool-container.full-width {
height: 100%;
display: flex;
flex-direction: column;
}
.tool-panel {
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
height: 100%;
overflow: hidden; /* Prevent scrolling, force fit */
}
.panel-header {
display: flex;
justify-content: center;
align-items: center;
position: relative;
width: 100%;
margin-bottom: 0.5rem;
flex-shrink: 0;
}
.tool-title {
margin: 0;
font-size: 1.5rem;
font-weight: 600;
color: var(--primary-accent);
}
.input-section {
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.tool-textarea {
width: 100%;
padding: 1rem;
border-radius: 8px;
background: rgba(0, 0, 0, 0.2);
border: 1px solid var(--glass-border);
color: var(--text-color);
font-size: 1rem;
resize: vertical;
min-height: 80px;
}
.tool-textarea:focus {
outline: none;
border-color: var(--primary-accent);
box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.1);
}
.controls-section {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
justify-content: center;
flex-shrink: 0;
}
.control-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.control-group label {
font-size: 0.85rem;
color: var(--text-secondary);
}
.select-input {
padding: 0.5rem;
border-radius: 6px;
background: rgba(0, 0, 0, 0.2);
border: 1px solid var(--glass-border);
color: var(--text-color);
min-width: 120px;
}
.preview-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
justify-content: center;
background: rgba(0, 0, 0, 0.1);
border-radius: 12px;
padding: 1rem;
overflow: hidden; /* Prevent overflow if QR is too big */
min-height: 0;
container-type: size;
}
.qr-frame {
width: calc(100cqmin - 4rem);
height: calc(100cqmin - 4rem);
background: white;
padding: 1rem;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.qr-frame :deep(svg) {
display: block;
width: 100%;
height: 100%;
}
.actions {
display: flex;
gap: 1rem;
}
.action-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem 1.2rem;
border-radius: 6px;
background: var(--primary-accent);
color: #000;
border: none;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.action-btn:hover {
opacity: 0.9;
transform: translateY(-1px);
}
</style>

View File

@@ -0,0 +1,924 @@
<script setup>
import { ref, onMounted, onUnmounted, watch, computed } from 'vue'
import { SwitchCamera, Trash2, Copy, Download, X, Maximize2, Minimize2 } from 'lucide-vue-next'
const error = ref('')
const facingMode = ref('environment')
const scannedCodes = ref([])
const hasMultipleCameras = ref(false)
const isFullscreen = ref(false)
const videoAspect = ref(1)
const isMirrored = ref(false)
const wrapperRef = ref(null)
const bgCanvas = ref(null)
let bgRafId = null
// Native scanner state
const videoRef = ref(null)
let stream = null
let scanRafId = null
let barcodeDetector = null
const overlayCanvas = ref(null)
const paintDetections = (codes) => {
const canvas = overlayCanvas.value
const video = videoRef.value
if (!canvas || !video) return
const ctx = canvas.getContext('2d')
const { width, height } = canvas.getBoundingClientRect()
// Update canvas size if needed (to match CSS size)
if (canvas.width !== width || canvas.height !== height) {
canvas.width = width
canvas.height = height
}
ctx.clearRect(0, 0, width, height)
if (!codes || codes.length === 0) return
const vw = video.videoWidth
const vh = video.videoHeight
if (!vw || !vh) return
// Calculate object-fit: cover scaling
const videoRatio = vw / vh
const canvasRatio = width / height
let drawWidth, drawHeight, startX, startY
if (canvasRatio > videoRatio) {
// Canvas is wider than video (video cropped top/bottom)
drawWidth = width
drawHeight = width / videoRatio
startX = 0
startY = (height - drawHeight) / 2
} else {
// Canvas is taller than video (video cropped left/right)
drawHeight = height
drawWidth = height * videoRatio
startY = 0
startX = (width - drawWidth) / 2
}
const scale = drawWidth / vw
// Canvas is mirrored via CSS if isMirrored is true, so no manual coordinate mirroring needed
// Styles
const styles = getComputedStyle(document.documentElement)
const accent = styles.getPropertyValue('--primary-accent').trim() || '#00f2fe'
ctx.lineWidth = 4
ctx.strokeStyle = accent
ctx.fillStyle = accent
codes.forEach(code => {
const points = code.cornerPoints
if (!points || points.length < 4) return
ctx.beginPath()
const transform = (p) => {
let x = p.x * scale + startX
let y = p.y * scale + startY
return { x, y }
}
const p0 = transform(points[0])
ctx.moveTo(p0.x, p0.y)
for (let i = 1; i < points.length; i++) {
const p = transform(points[i])
ctx.lineTo(p.x, p.y)
}
ctx.closePath()
ctx.stroke()
// Draw corners
points.forEach(p => {
const tp = transform(p)
ctx.beginPath()
ctx.arc(tp.x, tp.y, 4, 0, Math.PI * 2)
ctx.fill()
})
})
}
const updateVideoAspect = () => {
if (videoRef.value && videoRef.value.videoWidth && videoRef.value.videoHeight) {
videoAspect.value = videoRef.value.videoWidth / videoRef.value.videoHeight
}
}
const startBackgroundLoop = () => {
const draw = () => {
const videoEl = videoRef.value
const canvas = bgCanvas.value
if (!videoEl || !canvas || videoEl.paused || videoEl.ended) {
bgRafId = requestAnimationFrame(draw)
return
}
const vw = videoEl.videoWidth || 0
const vh = videoEl.videoHeight || 0
if (!vw || !vh) {
bgRafId = requestAnimationFrame(draw)
return
}
const cw = Math.floor(window.innerWidth)
const ch = Math.floor(window.innerHeight * 0.5)
if (canvas.width !== cw || canvas.height !== ch) {
canvas.width = cw
canvas.height = ch
}
const ctx = canvas.getContext('2d')
if (ctx) {
// cover horizontally: scale by width, crop top/bottom
const scale = cw / vw
const srcH = ch / scale
const sx = 0
const sy = Math.max(0, (vh - srcH) / 2)
ctx.clearRect(0, 0, cw, ch)
ctx.drawImage(videoEl, sx, sy, vw, srcH, 0, 0, cw, ch)
}
bgRafId = requestAnimationFrame(draw)
}
if (bgRafId) cancelAnimationFrame(bgRafId)
bgRafId = requestAnimationFrame(draw)
}
const stopBackgroundLoop = () => {
if (bgRafId) {
cancelAnimationFrame(bgRafId)
bgRafId = null
}
}
const initDetector = async () => {
if (!barcodeDetector) {
if ('BarcodeDetector' in window) {
try {
// Formats are optional, but specifying qr_code might be faster
const formats = await window.BarcodeDetector.getSupportedFormats()
if (formats.includes('qr_code')) {
barcodeDetector = new window.BarcodeDetector({ formats: ['qr_code'] })
} else {
barcodeDetector = new window.BarcodeDetector()
}
} catch (e) {
// Fallback
barcodeDetector = new window.BarcodeDetector()
}
} else {
error.value = 'Barcode Detection API not supported'
}
}
}
const startScan = async () => {
stopScan()
error.value = ''
try {
await initDetector()
if (!barcodeDetector) {
error.value = 'Barcode Detector failed to initialize'
return
}
const constraints = {
video: {
facingMode: facingMode.value,
width: { ideal: 1280 },
height: { ideal: 720 }
}
}
stream = await navigator.mediaDevices.getUserMedia(constraints)
// Detect actual facing mode to mirror front camera correctly
const videoTrack = stream.getVideoTracks()[0]
if (videoTrack) {
const settings = videoTrack.getSettings()
if (settings.facingMode) {
isMirrored.value = settings.facingMode === 'user'
} else {
// Fallback: check label for desktop cameras or assume requested mode
const label = videoTrack.label ? videoTrack.label.toLowerCase() : ''
if (label.includes('front') || label.includes('facetime') || label.includes('macbook')) {
isMirrored.value = true
} else {
isMirrored.value = facingMode.value === 'user'
}
}
}
if (videoRef.value) {
videoRef.value.srcObject = stream
// Wait for metadata to play
videoRef.value.onloadedmetadata = () => {
videoRef.value.play().catch(e => console.error('Play error', e))
updateVideoAspect()
detectLoop()
startBackgroundLoop()
}
}
} catch (err) {
onError(err)
}
}
const stopScan = () => {
if (scanRafId) cancelAnimationFrame(scanRafId)
if (stream) {
stream.getTracks().forEach(t => t.stop())
stream = null
}
stopBackgroundLoop()
}
const detectLoop = async () => {
if (!videoRef.value || videoRef.value.paused || videoRef.value.ended) {
scanRafId = requestAnimationFrame(detectLoop)
return
}
try {
const codes = await barcodeDetector.detect(videoRef.value)
paintDetections(codes)
if (codes.length > 0) {
onDetect(codes)
}
} catch (e) {
// console.error('Detection error', e)
}
scanRafId = requestAnimationFrame(detectLoop)
}
const desktopFullscreenStyle = computed(() => {
if (!isFullscreen.value) return {}
const isDesktop = window.innerWidth >= 768
if (!isDesktop) return {}
const halfHeight = Math.floor(window.innerHeight * 0.5)
const widthPx = Math.min(window.innerWidth, Math.floor(halfHeight * videoAspect.value))
return { height: `${halfHeight}px`, width: `${widthPx}px`, margin: '0 auto' }
})
const processCodes = (codes) => {
codes.forEach(code => {
const value = code.rawValue
if (value && !scannedCodes.value.some(c => c.value === value)) {
scannedCodes.value.unshift({
id: Date.now() + Math.random(),
value,
format: code.format,
timestamp: new Date().toLocaleTimeString()
})
}
})
}
const onDetect = (detectedCodes) => {
// If fullscreen, accept all detected codes (as the user sees the full camera view mostly)
if (isFullscreen.value) {
processCodes(detectedCodes)
return
}
// Try to find video element to calculate visible area
const videoEl = document.querySelector('.camera-wrapper video')
if (!videoEl || !videoEl.videoWidth || !videoEl.videoHeight) {
processCodes(detectedCodes)
return
}
const { videoWidth, videoHeight } = videoEl
// Calculate visible square area (assuming object-fit: cover and 1:1 container)
const isLandscape = videoWidth > videoHeight
let visibleX, visibleY, visibleW, visibleH
if (isLandscape) {
// Landscape: sides are cropped, height is fully visible
visibleH = videoHeight
visibleW = videoHeight // Square
visibleX = (videoWidth - videoHeight) / 2
visibleY = 0
} else {
// Portrait: top/bottom are cropped, width is fully visible
visibleW = videoWidth
visibleH = videoWidth // Square
visibleX = 0
visibleY = (videoHeight - videoWidth) / 2
}
// Add margin to be safe (code center must be within visible area)
// We allow codes slightly outside if their center is inside
const validCodes = detectedCodes.filter(code => {
if (!code.boundingBox) return true
const { x, y, width, height } = code.boundingBox
const centerX = x + width / 2
const centerY = y + height / 2
return (
centerX >= visibleX &&
centerX <= visibleX + visibleW &&
centerY >= visibleY &&
centerY <= visibleY + visibleH
)
})
processCodes(validCodes)
}
watch(facingMode, () => {
startScan()
})
const onError = (err) => {
if (err.name === 'NotAllowedError') {
error.value = 'Camera permission denied'
} else if (err.name === 'NotFoundError') {
error.value = 'No camera found'
} else {
error.value = `Camera error: ${err.name}`
}
}
const checkCameras = async () => {
try {
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
return
}
const devices = await navigator.mediaDevices.enumerateDevices()
const cameras = devices.filter(d => d.kind === 'videoinput')
hasMultipleCameras.value = cameras.length > 1
} catch (e) {
console.error('Error checking cameras:', e)
}
}
const loadHistory = () => {
try {
const saved = localStorage.getItem('qr-history')
if (saved) {
scannedCodes.value = JSON.parse(saved)
}
} catch (e) {
console.error('Failed to load QR history', e)
}
}
watch(scannedCodes, (newVal) => {
localStorage.setItem('qr-history', JSON.stringify(newVal))
}, { deep: true })
const handleKeydown = (e) => {
if (e.key === 'Escape' && isFullscreen.value) {
toggleFullscreen()
}
}
onMounted(() => {
checkCameras()
loadHistory()
window.addEventListener('resize', updateVideoAspect)
window.addEventListener('resize', startBackgroundLoop)
window.addEventListener('keydown', handleKeydown)
watch(isFullscreen, (fs) => {
if (fs) {
startBackgroundLoop()
} else {
stopBackgroundLoop()
}
}, { immediate: true })
startScan()
})
onUnmounted(() => {
window.removeEventListener('resize', updateVideoAspect)
window.removeEventListener('resize', startBackgroundLoop)
window.removeEventListener('keydown', handleKeydown)
stopScan()
})
const switchCamera = (event) => {
event.stopPropagation()
facingMode.value = facingMode.value === 'environment' ? 'user' : 'environment'
}
const toggleFullscreen = () => {
isFullscreen.value = !isFullscreen.value
}
const clearHistory = () => {
scannedCodes.value = []
}
const removeCode = (id) => {
scannedCodes.value = scannedCodes.value.filter(c => c.id !== id)
}
const copyAll = async () => {
if (scannedCodes.value.length === 0) return
const text = scannedCodes.value.map(c => c.value).join('\n')
try {
await navigator.clipboard.writeText(text)
} catch (err) {
console.error('Failed to copy', err)
}
}
const downloadJson = () => {
if (scannedCodes.value.length === 0) return
const data = JSON.stringify(scannedCodes.value, null, 2)
const blob = new Blob([data], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = `qr-scan-history-${new Date().toISOString().slice(0, 10)}.json`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
const copyToClipboard = async (text) => {
try {
await navigator.clipboard.writeText(text)
} catch (err) {
console.error('Failed to copy', err)
}
}
const isUrl = (string) => {
try {
return Boolean(new URL(string))
} catch (_) {
return false
}
}
</script>
<template>
<div class="tool-container full-width">
<div class="tool-panel">
<div class="panel-header" v-if="!isFullscreen">
<h2 class="tool-title">QR Scanner</h2>
</div>
<Teleport to="body" :disabled="!isFullscreen">
<div class="scanner-content" :class="{ 'is-fullscreen': isFullscreen }">
<canvas
v-if="isFullscreen"
ref="bgCanvas"
class="camera-bg"
:class="{ 'is-mirrored': isMirrored }"
></canvas>
<button v-if="isFullscreen" class="close-fullscreen-btn" @click="toggleFullscreen">
<X size="24" />
</button>
<div
class="camera-wrapper"
:class="{ 'clickable': !isFullscreen, 'is-mirrored': isMirrored }"
:style="desktopFullscreenStyle"
ref="wrapperRef"
@click="!isFullscreen && toggleFullscreen()"
>
<video
ref="videoRef"
class="camera-feed"
:class="{ 'is-mirrored': isMirrored }"
autoplay
playsinline
muted
></video>
<canvas ref="overlayCanvas" class="scan-overlay-canvas" :class="{ 'is-mirrored': isMirrored }"></canvas>
<div v-if="error" class="error-overlay">
<p>{{ error }}</p>
<button @click="startScan" class="retry-btn">Retry</button>
</div>
<button
v-if="hasMultipleCameras"
class="switch-camera-btn"
@click.stop="switchCamera"
title="Switch Camera"
>
<SwitchCamera size="24" />
</button>
</div>
<div class="results-section">
<div class="results-header">
<h3>Scanned Codes ({{ scannedCodes.length }})</h3>
<div v-if="scannedCodes.length > 0" class="header-actions">
<button class="icon-btn" @click="copyAll" title="Copy All">
<Copy size="18" />
</button>
<button class="icon-btn" @click="downloadJson" title="Download JSON">
<Download size="18" />
</button>
<button class="icon-btn delete-btn" @click="clearHistory" title="Clear All">
<Trash2 size="18" />
</button>
</div>
</div>
<div v-if="scannedCodes.length > 0" class="codes-list">
<div v-for="code in scannedCodes" :key="code.id" class="code-item">
<div class="code-content">
<div class="code-value">
<a v-if="isUrl(code.value)" :href="code.value" target="_blank" rel="noopener noreferrer">{{ code.value }}</a>
<span v-else>{{ code.value }}</span>
</div>
<div class="code-meta">
<span class="timestamp">{{ code.timestamp }}</span>
<span class="format-badge">{{ code.format }}</span>
</div>
</div>
<div class="item-actions">
<button class="icon-btn" @click="copyToClipboard(code.value)" title="Copy">
<Copy size="18" />
</button>
<button class="icon-btn delete-btn" @click="removeCode(code.id)" title="Remove">
<Trash2 size="18" />
</button>
</div>
</div>
</div>
<div v-else class="empty-state">
Point camera at a QR code to scan
</div>
</div>
</div>
</Teleport>
</div>
</div>
</template>
<style scoped>
.tool-container.full-width {
max-width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.tool-panel {
display: flex;
flex-direction: column;
height: 100%;
gap: 1.5rem;
padding: 1.5rem;
}
.panel-header {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0.5rem;
margin-top: 0;
position: relative;
width: 100%;
}
.scanner-content {
display: flex;
flex-direction: column;
height: 100%;
gap: 1.5rem;
}
.scanner-content.is-fullscreen {
position: fixed;
inset: 0;
z-index: 9999;
background: #000;
gap: 0;
}
.camera-wrapper {
width: 100%;
max-width: 500px;
aspect-ratio: 1;
margin: 0 auto;
border-radius: 12px;
overflow: hidden;
position: relative;
background: #000;
border: 1px solid var(--glass-border);
box-shadow: var(--glass-shadow);
transition: all 0.3s ease;
}
.camera-wrapper.clickable {
cursor: pointer;
}
.scanner-content.is-fullscreen .camera-wrapper {
position: relative;
width: 100%;
aspect-ratio: 1;
max-width: none;
height: auto;
border-radius: 0;
border: none;
margin: 0;
z-index: 1;
}
.camera-bg {
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 50vh;
filter: blur(16px) saturate(110%);
opacity: 0.9;
z-index: 0;
}
.camera-bg.is-mirrored {
transform: scaleX(-1);
}
.camera-feed {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.camera-feed.is-mirrored {
transform: scaleX(-1);
}
.scan-overlay-canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 5;
}
.scan-overlay-canvas.is-mirrored {
transform: scaleX(-1);
}
/* front mirror canvas removed */
.error-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.8);
color: #ff4444;
padding: 1rem;
text-align: center;
z-index: 10;
}
.switch-camera-btn {
position: absolute;
top: 1rem;
right: 1rem;
background: rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
border-radius: 50%;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 20;
backdrop-filter: blur(4px);
transition: all 0.2s;
}
.switch-camera-btn:hover {
background: rgba(0, 0, 0, 0.6);
transform: scale(1.05);
}
.close-fullscreen-btn {
position: absolute;
top: 1rem;
left: 1rem;
z-index: 20;
background: rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
border-radius: 50%;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
backdrop-filter: blur(4px);
}
/* Removed legacy scan frame overlay - using shape detection rendering via track instead */
.results-section {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
}
.scanner-content.is-fullscreen .results-section {
position: relative;
flex: 1;
width: 100%;
height: auto;
z-index: 2;
border-radius: 0;
background: var(--glass-bg);
backdrop-filter: blur(10px);
border: none;
border-top: 1px solid rgba(255, 255, 255, 0.2);
display: flex;
flex-direction: column;
}
.results-header {
padding: 1rem;
border-bottom: 1px solid var(--glass-border);
display: flex;
justify-content: space-between;
align-items: center;
}
.results-header h3 {
margin: 0;
font-size: 1.1rem;
color: var(--text-strong);
}
.header-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.codes-list {
flex: 1;
overflow-y: auto;
padding: 0;
}
.code-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid var(--glass-border);
transition: background 0.2s;
}
.code-item:last-child {
border-bottom: none;
}
.code-item:hover {
background: var(--list-hover-bg);
}
.code-content {
flex: 1;
overflow: hidden;
padding-right: 1rem;
}
.code-value {
color: var(--primary-accent);
font-family: monospace;
word-break: break-all;
margin-bottom: 0.4rem;
}
.code-value a {
color: var(--primary-accent);
text-decoration: underline;
}
.code-value a:hover {
opacity: 0.8;
}
.code-meta {
display: flex;
gap: 1rem;
font-size: 0.85rem;
color: var(--text-secondary);
}
.item-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.format-badge {
background: rgba(255, 255, 255, 0.1);
padding: 0 0.4rem;
border-radius: 4px;
font-size: 0.75rem;
}
:global(:root[data-theme="light"]) .format-badge {
background: rgba(0, 0, 0, 0.1);
}
.icon-btn {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 0.4rem;
border-radius: 4px;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.icon-btn:hover {
color: var(--text-color);
background: rgba(255, 255, 255, 0.1);
}
:global(:root[data-theme="light"]) .icon-btn:hover {
background: rgba(0, 0, 0, 0.05);
}
.delete-btn:hover {
color: #ef4444;
}
.empty-state {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
color: var(--text-secondary);
padding: 2rem;
text-align: center;
}
:deep(video) {
object-fit: cover !important;
width: 100% !important;
height: 100% !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
}
:deep(.qrcode-stream-wrapper),
:deep(.qrcode-stream-overlay) {
width: 100% !important;
height: 100% !important;
position: absolute !important;
inset: 0 !important;
}
/* Front camera mirror (CSS-only) */
.camera-wrapper.is-front :deep(video) {
transform: scaleX(-1);
transform-origin: center;
}
.camera-wrapper.is-front :deep(#qrcode-stream-pause-frame),
.camera-wrapper.is-front :deep(#qrcode-stream-overlay) {
transform: scaleX(-1);
transform-origin: center;
}
@media (min-width: 768px) {
:deep(.scanner-content.is-fullscreen .camera-wrapper video) {
object-fit: contain !important;
}
}
</style>

View File

@@ -1,9 +1,10 @@
<script setup> <script setup>
import { ref, watch, onUnmounted } from 'vue' import { ref, watch, onUnmounted } from 'vue'
import { Copy, Trash2, ExternalLink, Power, Zap, X } from 'lucide-vue-next' import { Copy, Trash2, ExternalLink, Power, Zap, X, Settings, Download } from 'lucide-vue-next'
import { useExtension } from '../../composables/useExtension' import { useExtension } from '../../composables/useExtension'
import { useLocalStorage } from '../../composables/useLocalStorage' import { useLocalStorage } from '../../composables/useLocalStorage'
import ExtensionStatus from './common/ExtensionStatus.vue' import ExtensionStatus from './common/ExtensionStatus.vue'
import UrlCleanerExceptionsModal from './UrlCleanerExceptionsModal.vue'
// Extension integration // Extension integration
const { isExtensionReady, isListening, lastClipboardText, startListening, stopListening, writeClipboard } = useExtension() const { isExtensionReady, isListening, lastClipboardText, startListening, stopListening, writeClipboard } = useExtension()
@@ -13,6 +14,21 @@ const inputUrl = ref('')
const cleanedHistory = useLocalStorage('url-cleaner-history', []) const cleanedHistory = useLocalStorage('url-cleaner-history', [])
const isWatchEnabled = useLocalStorage('url-cleaner-watch-enabled', false) const isWatchEnabled = useLocalStorage('url-cleaner-watch-enabled', false)
// Exceptions management
const showExceptionsModal = ref(false)
const defaultExceptions = [
{ id: 'yt', domainPattern: '*.youtube.com', keepParams: ['v', 't'], keepHash: false, keepAllParams: false, isEnabled: true, isDefault: true },
{ id: 'yt-short', domainPattern: 'youtu.be', keepParams: ['t'], keepHash: false, keepAllParams: false, isEnabled: true, isDefault: true }
]
const exceptions = useLocalStorage('url-cleaner-exceptions', defaultExceptions)
// Helper to match domain with glob pattern
const matchDomain = (pattern, domain) => {
// Escape regex chars except *
const regexString = '^' + pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*') + '$'
return new RegExp(regexString, 'i').test(domain)
}
// Watch for clipboard changes from extension // Watch for clipboard changes from extension
watch(lastClipboardText, (newText) => { watch(lastClipboardText, (newText) => {
if (isWatchEnabled.value && newText) { if (isWatchEnabled.value && newText) {
@@ -41,10 +57,45 @@ const toggleWatch = () => {
isWatchEnabled.value = !isWatchEnabled.value isWatchEnabled.value = !isWatchEnabled.value
} }
const copyAllUrls = async () => {
if (cleanedHistory.value.length === 0) return
const text = cleanedHistory.value.map(item => item.cleaned).join('\n')
try {
await navigator.clipboard.writeText(text)
} catch (err) {
console.error('Failed to copy URLs', err)
}
}
const downloadJson = () => {
if (cleanedHistory.value.length === 0) return
const exportData = cleanedHistory.value.map(item => ({
url: item.cleaned,
original: item.original,
timestamp: item.timestamp
}))
const data = JSON.stringify(exportData, null, 2)
const blob = new Blob([data], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = `cleaned-urls-${new Date().toISOString().slice(0, 10)}.json`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
// Manual clean // Manual clean
const handleClean = () => { const handleClean = () => {
if (inputUrl.value) { if (inputUrl.value) {
processUrl(inputUrl.value, false) const urls = inputUrl.value.split(/\r?\n/).filter(line => line.trim().length > 0)
urls.forEach(url => {
processUrl(url.trim(), false)
})
inputUrl.value = '' inputUrl.value = ''
} }
} }
@@ -62,13 +113,41 @@ const processUrl = (text, autoClipboard = false) => {
try { try {
const urlObj = new URL(text) const urlObj = new URL(text)
// Remove query params and hash const hostname = urlObj.hostname
// Check for exceptions
const matchedRule = exceptions.value.find(rule =>
rule.isEnabled && matchDomain(rule.domainPattern, hostname)
)
if (matchedRule) {
if (!matchedRule.keepAllParams) {
// Exception logic: keep specific params
const params = new URLSearchParams(urlObj.search)
const keys = Array.from(params.keys())
for (const key of keys) {
if (!matchedRule.keepParams.includes(key)) {
params.delete(key)
}
}
urlObj.search = params.toString()
}
if (!matchedRule.keepHash) {
urlObj.hash = ''
}
} else {
// Default behavior: remove all query params and hash
if (urlObj.search || urlObj.hash) { if (urlObj.search || urlObj.hash) {
urlObj.search = '' urlObj.search = ''
urlObj.hash = '' urlObj.hash = ''
}
}
cleanedUrl = urlObj.toString() cleanedUrl = urlObj.toString()
// Remove trailing slash if it wasn't there before? usually keep it standard // Remove trailing slash if it wasn't there before? usually keep it standard
}
} catch (e) { } catch (e) {
// Invalid URL format // Invalid URL format
if (!autoClipboard) { if (!autoClipboard) {
@@ -135,18 +214,23 @@ onUnmounted(() => {
<div class="tool-panel"> <div class="tool-panel">
<div class="panel-header"> <div class="panel-header">
<h2 class="tool-title">URL Cleaner</h2> <h2 class="tool-title">URL Cleaner</h2>
<div class="header-actions">
<button class="icon-btn settings-btn" @click="showExceptionsModal = true" title="Cleaning Exceptions">
<Settings size="20" />
</button>
<ExtensionStatus :isReady="isExtensionReady" /> <ExtensionStatus :isReady="isExtensionReady" />
</div> </div>
</div>
<div class="input-section"> <div class="input-section">
<div class="input-wrapper"> <div class="input-wrapper">
<input <textarea
v-model="inputUrl" v-model="inputUrl"
type="text" placeholder="Paste URL(s) here to clean..."
placeholder="Paste URL here to clean..."
class="url-input" class="url-input"
@keyup.enter="handleClean" @keydown.enter.prevent="handleClean"
> rows="1"
></textarea>
<button class="btn-neon" @click="handleClean"> <button class="btn-neon" @click="handleClean">
Clean Clean
</button> </button>
@@ -170,10 +254,18 @@ onUnmounted(() => {
<div class="history-section" v-if="cleanedHistory.length > 0"> <div class="history-section" v-if="cleanedHistory.length > 0">
<div class="history-header"> <div class="history-header">
<h3>Cleaned URLs</h3> <h3>Cleaned URLs</h3>
<button class="icon-btn" @click="clearHistory" title="Clear History"> <div class="history-actions">
<button class="icon-btn" @click="copyAllUrls" title="Copy all URLs">
<Copy size="18" />
</button>
<button class="icon-btn" @click="downloadJson" title="Download JSON">
<Download size="18" />
</button>
<button class="icon-btn delete-btn" @click="clearHistory" title="Clear History">
<Trash2 size="18" /> <Trash2 size="18" />
</button> </button>
</div> </div>
</div>
<div class="history-list"> <div class="history-list">
<div v-for="item in cleanedHistory" :key="item.id" class="history-item"> <div v-for="item in cleanedHistory" :key="item.id" class="history-item">
@@ -205,6 +297,14 @@ onUnmounted(() => {
<div class="empty-state" v-else> <div class="empty-state" v-else>
<p>Paste a URL above or enable "Watch Clipboard" to automatically clean links.</p> <p>Paste a URL above or enable "Watch Clipboard" to automatically clean links.</p>
</div> </div>
<UrlCleanerExceptionsModal
:isOpen="showExceptionsModal"
:exceptions="exceptions"
:defaultRules="defaultExceptions"
@update:exceptions="exceptions = $event"
@close="showExceptionsModal = false"
/>
</div> </div>
</div> </div>
</template> </template>
@@ -243,11 +343,35 @@ onUnmounted(() => {
border-radius: 12px; border-radius: 12px;
} }
@media (max-width: 640px) {
.input-section {
background: transparent;
border: none;
border-radius: 0;
padding: 0;
}
}
.input-wrapper { .input-wrapper {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
} }
@media (max-width: 640px) {
.input-wrapper {
flex-direction: column;
}
.watch-toggle {
justify-content: center;
}
.toggle-btn {
width: 100%;
justify-content: center;
}
}
.url-input { .url-input {
flex: 1; flex: 1;
padding: 0.8rem 1rem; padding: 0.8rem 1rem;
@@ -258,6 +382,9 @@ onUnmounted(() => {
font-size: 1rem; font-size: 1rem;
outline: none; outline: none;
transition: all 0.2s; transition: all 0.2s;
resize: vertical;
min-height: 46px;
font-family: inherit;
} }
.url-input:focus { .url-input:focus {
@@ -323,10 +450,16 @@ onUnmounted(() => {
color: var(--text-strong); color: var(--text-strong);
} }
.history-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.history-list { .history-list {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 0.5rem; padding: 0;
} }
.history-item { .history-item {
@@ -343,7 +476,7 @@ onUnmounted(() => {
} }
.history-item:hover { .history-item:hover {
background: rgba(255, 255, 255, 0.05); background: var(--list-hover-bg);
} }
.item-info { .item-info {
@@ -422,4 +555,40 @@ onUnmounted(() => {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
} }
.header-actions {
display: flex;
align-items: center;
gap: 0.8rem;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}
.settings-btn {
background: rgba(255, 255, 255, 0.1);
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
color: var(--text-secondary);
transition: all 0.3s ease;
}
.settings-btn:hover {
background: rgba(255, 255, 255, 0.2);
color: var(--primary-accent);
}
:global(:root[data-theme="light"]) .settings-btn {
background: rgba(0, 0, 0, 0.05);
}
:global(:root[data-theme="light"]) .settings-btn:hover {
background: rgba(0, 0, 0, 0.1);
}
</style> </style>

View File

@@ -0,0 +1,619 @@
<script setup>
import { ref, computed, watch, onUnmounted } from 'vue'
import { X, Plus, Trash2, RotateCcw } from 'lucide-vue-next'
const props = defineProps({
isOpen: Boolean,
exceptions: Array,
defaultRules: Array
})
const emit = defineEmits(['close', 'update:exceptions'])
const handleKeydown = (e) => {
if (e.key === 'Escape') {
emit('close')
}
}
watch(() => props.isOpen, (isOpen) => {
if (isOpen) {
window.addEventListener('keydown', handleKeydown)
} else {
window.removeEventListener('keydown', handleKeydown)
}
})
onUnmounted(() => {
window.removeEventListener('keydown', handleKeydown)
})
const newRule = ref({
domainPattern: '',
keepParams: '',
keepHash: false,
keepAllParams: false
})
const localExceptions = computed({
get: () => props.exceptions,
set: (val) => emit('update:exceptions', val)
})
const addRule = () => {
if (!newRule.value.domainPattern) return
const params = newRule.value.keepParams
.split(',')
.map(p => p.trim())
.filter(p => p)
const existingRuleIndex = localExceptions.value.findIndex(
r => r.domainPattern === newRule.value.domainPattern
)
if (existingRuleIndex >= 0) {
// Merge with existing rule
const existingRule = localExceptions.value[existingRuleIndex]
// Merge params (unique)
const mergedParams = [...new Set([...existingRule.keepParams, ...params])]
// Merge keepHash
const mergedKeepHash = existingRule.keepHash || newRule.value.keepHash
const mergedKeepAllParams = !!existingRule.keepAllParams || !!newRule.value.keepAllParams
const updatedRule = {
...existingRule,
keepParams: mergedParams,
keepHash: mergedKeepHash,
keepAllParams: mergedKeepAllParams,
isEnabled: true // Re-enable if disabled
}
const newExceptions = [...localExceptions.value]
newExceptions[existingRuleIndex] = updatedRule
localExceptions.value = newExceptions
} else {
// Create new rule
const rule = {
id: Date.now().toString(),
domainPattern: newRule.value.domainPattern,
keepParams: params,
keepHash: newRule.value.keepHash,
keepAllParams: newRule.value.keepAllParams,
isEnabled: true,
isDefault: false
}
localExceptions.value = [...localExceptions.value, rule]
}
// Reset form
newRule.value = {
domainPattern: '',
keepParams: '',
keepHash: false,
keepAllParams: false
}
}
const editRule = (rule) => {
newRule.value = {
domainPattern: rule.domainPattern,
keepParams: Array.isArray(rule.keepParams) ? rule.keepParams.join(', ') : '',
keepHash: !!rule.keepHash,
keepAllParams: !!rule.keepAllParams
}
}
const removeRule = (id) => {
localExceptions.value = localExceptions.value.filter(r => r.id !== id)
}
const toggleRule = (id) => {
localExceptions.value = localExceptions.value.map(r => {
if (r.id === id) {
return { ...r, isEnabled: !r.isEnabled }
}
return r
})
}
const removeParam = (ruleId, param) => {
localExceptions.value = localExceptions.value.map(r => {
if (r.id === ruleId) {
return {
...r,
keepParams: r.keepParams.filter(p => p !== param)
}
}
return r
})
}
const toggleKeepHash = (ruleId) => {
localExceptions.value = localExceptions.value.map(r => {
if (r.id === ruleId) {
return { ...r, keepHash: !r.keepHash }
}
return r
})
}
const toggleKeepAllParams = (ruleId) => {
localExceptions.value = localExceptions.value.map(r => {
if (r.id === ruleId) {
return { ...r, keepAllParams: !r.keepAllParams }
}
return r
})
}
const resetToDefault = (ruleId) => {
const defaultRule = (props.defaultRules || []).find(r => r.id === ruleId)
if (!defaultRule) return
localExceptions.value = localExceptions.value.map(r => {
if (r.id !== ruleId) return r
return {
...r,
domainPattern: defaultRule.domainPattern,
keepParams: Array.isArray(defaultRule.keepParams) ? [...defaultRule.keepParams] : [],
keepHash: !!defaultRule.keepHash,
keepAllParams: !!defaultRule.keepAllParams,
isEnabled: true,
isDefault: true
}
})
}
</script>
<template>
<Teleport to="body">
<div v-if="isOpen" class="modal-overlay" @click.self="$emit('close')">
<div class="modal-content">
<div class="modal-header">
<h3>URL Cleaning Exceptions</h3>
<button class="close-btn" @click="$emit('close')">
<X size="24" />
</button>
</div>
<div class="modal-body">
<p class="description">
Define rules to keep specific parameters or anchors for certain domains.
Standard cleaning removes all parameters and anchors.
</p>
<div class="add-rule-form">
<h4>Add New Exception</h4>
<div class="form-row">
<input
v-model="newRule.domainPattern"
placeholder="Domain (e.g. *.youtube.com)"
class="input-field"
@keyup.enter="addRule"
>
<input
v-model="newRule.keepParams"
placeholder="Keep params (comma separated, e.g. v, id)"
class="input-field"
@keyup.enter="addRule"
>
</div>
<div class="form-row checkbox-row">
<div class="checkbox-group">
<label class="checkbox-label">
<input type="checkbox" v-model="newRule.keepHash">
Keep Anchor (#)
</label>
<label class="checkbox-label">
<input type="checkbox" v-model="newRule.keepAllParams">
Keep all params
</label>
</div>
<button class="btn-neon small" @click="addRule" :disabled="!newRule.domainPattern">
<Plus size="16" /> Add Rule
</button>
</div>
</div>
<div class="rules-list">
<h4>Active Rules</h4>
<div v-if="localExceptions.length === 0" class="empty-rules">
No exceptions defined.
</div>
<div v-for="rule in localExceptions" :key="rule.id" class="rule-item" :class="{ disabled: !rule.isEnabled }">
<div class="rule-info">
<div class="rule-domain" @click="editRule(rule)" title="Click to edit">{{ rule.domainPattern }}</div>
<div class="rule-details">
<div class="params-list">
<template v-if="rule.keepAllParams">
<span class="detail-tag">
Keep all params
<button class="remove-param-btn" @click.stop="toggleKeepAllParams(rule.id)" title="Disable keep all params">
<X size="12" />
</button>
</span>
</template>
<template v-else>
<span v-for="param in rule.keepParams" :key="param" class="detail-tag">
{{ param }}
<button class="remove-param-btn" @click.stop="removeParam(rule.id, param)" title="Remove parameter">
<X size="12" />
</button>
</span>
</template>
<span v-if="rule.keepHash" class="detail-tag hash-tag">
Keep #
<button class="remove-param-btn" @click.stop="toggleKeepHash(rule.id)" title="Remove hash exception">
<X size="12" />
</button>
</span>
<span v-if="!rule.keepAllParams && rule.keepParams.length === 0 && !rule.keepHash" class="no-params">No params kept</span>
</div>
</div>
</div>
<div class="rule-actions">
<button
class="icon-btn"
@click="toggleRule(rule.id)"
:title="rule.isEnabled ? 'Disable rule' : 'Enable rule'"
>
<div class="toggle-switch" :class="{ active: rule.isEnabled }"></div>
</button>
<button
v-if="!rule.isDefault"
class="icon-btn delete-btn"
@click="removeRule(rule.id)"
title="Remove rule"
>
<Trash2 size="18" />
</button>
<button v-else class="btn-neon small default-reset" @click="resetToDefault(rule.id)" title="Restore default rule">
<RotateCcw size="16" /> Default
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</Teleport>
</template>
<style scoped>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(5px);
padding: 1rem;
}
:global(:root[data-theme="light"]) .modal-overlay {
background: rgba(0, 0, 0, 0.15);
}
.modal-content {
background: var(--glass-bg);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid var(--glass-border);
border-radius: 16px;
padding: 0;
max-width: 800px;
width: 100%;
max-height: 85vh;
display: flex;
flex-direction: column;
box-shadow: var(--glass-shadow);
color: var(--text-color);
}
:global(:root[data-theme="light"]) .modal-content {
background: rgba(255, 255, 255, 0.98);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.modal-header {
padding: 1.5rem;
border-bottom: 1px solid var(--glass-border);
display: flex;
justify-content: space-between;
align-items: center;
}
@media (max-width: 640px) {
.modal-header {
padding: 0.8rem 1.2rem;
}
}
.modal-header h3 {
margin: 0;
font-size: 1.4rem;
background: var(--title-gradient);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.close-btn {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 0.5rem;
}
.close-btn:hover {
color: var(--text-color);
}
.modal-body {
padding: 1.5rem;
overflow-y: auto;
}
@media (max-width: 640px) {
.modal-body {
padding: 1rem 1.2rem;
}
}
.description {
color: var(--text-secondary);
margin-bottom: 1.5rem;
font-size: 0.95rem;
line-height: 1.5;
}
.add-rule-form {
background: rgba(255, 255, 255, 0.05);
padding: 1rem;
border-radius: 8px;
margin-bottom: 2rem;
border: 1px solid var(--glass-border);
}
:global(:root[data-theme="light"]) .add-rule-form {
background: rgba(0, 0, 0, 0.04);
border: 1px solid rgba(0, 0, 0, 0.06);
}
.add-rule-form h4, .rules-list h4 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1rem;
color: var(--text-strong);
}
.form-row {
display: flex;
gap: 0.8rem;
margin-bottom: 0.8rem;
}
@media (max-width: 640px) {
.form-row {
flex-direction: column;
}
.checkbox-row {
flex-direction: column;
align-items: stretch;
gap: 1rem;
}
.checkbox-group {
flex-direction: column;
align-items: flex-start;
gap: 0.8rem;
}
.btn-neon {
width: 100%;
justify-content: center;
}
}
.checkbox-row {
align-items: center;
justify-content: space-between;
margin-bottom: 0;
}
.checkbox-group {
display: flex;
align-items: center;
gap: 1.2rem;
}
.input-field {
flex: 1;
padding: 0.6rem;
border-radius: 6px;
border: 1px solid var(--toggle-border);
background: var(--toggle-bg);
color: var(--text-color);
outline: none;
}
.input-field:focus {
border-color: var(--primary-accent);
}
.checkbox-label {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--text-secondary);
font-size: 0.9rem;
cursor: pointer;
}
.btn-neon.small {
padding: 0.4rem 1rem;
font-size: 0.9rem;
}
.rules-list {
display: flex;
flex-direction: column;
gap: 0.8rem;
}
.rule-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.8rem;
border: 1px solid var(--glass-border);
border-radius: 8px;
background: rgba(255, 255, 255, 0.03);
transition: opacity 0.3s;
}
:global(:root[data-theme="light"]) .rule-item {
background: rgba(0, 0, 0, 0.04);
border: 1px solid rgba(0, 0, 0, 0.06);
}
.rule-item.disabled {
opacity: 0.6;
}
.rule-info {
flex: 1;
}
.rule-domain {
font-weight: 600;
color: var(--primary-accent);
margin-bottom: 0.3rem;
cursor: pointer;
transition: opacity 0.2s;
}
.rule-domain:hover {
opacity: 0.8;
text-decoration: underline;
}
.rule-details {
width: 100%;
}
.params-list {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.detail-tag {
font-size: 0.8rem;
background: rgba(255, 255, 255, 0.1);
padding: 0.2rem 0.5rem;
border-radius: 4px;
color: var(--text-secondary);
display: flex;
align-items: center;
gap: 0.4rem;
}
.remove-param-btn {
background: none;
border: none;
padding: 0;
display: flex;
align-items: center;
color: var(--text-muted);
cursor: pointer;
transition: color 0.2s;
}
.remove-param-btn:hover {
color: #ef4444;
}
.no-params {
font-size: 0.8rem;
color: var(--text-muted);
font-style: italic;
}
.rule-actions {
display: flex;
align-items: center;
gap: 0.8rem;
}
.toggle-switch {
width: 36px;
height: 20px;
background: rgba(255, 255, 255, 0.2);
border-radius: 10px;
position: relative;
transition: background 0.3s;
}
.toggle-switch::after {
content: '';
position: absolute;
left: 2px;
top: 2px;
width: 16px;
height: 16px;
background: white;
border-radius: 50%;
transition: transform 0.3s;
}
.toggle-switch.active {
background: #4ade80;
}
.toggle-switch.active::after {
transform: translateX(16px);
}
.default-reset {
white-space: nowrap;
}
.empty-rules {
text-align: center;
color: var(--text-muted);
padding: 1rem;
}
.icon-btn {
background: none;
border: none;
cursor: pointer;
padding: 0;
color: var(--text-secondary);
display: flex;
align-items: center;
}
.delete-btn:hover {
color: #ef4444;
}
:global(:root[data-theme="light"]) .delete-btn:hover {
color: #dc2626;
}
</style>

View File

@@ -1,5 +1,11 @@
<script>
export default {
inheritAttrs: false
}
</script>
<script setup> <script setup>
import { ref } from 'vue' import { ref, watch, onUnmounted } from 'vue'
import { Plug, Plus, X } from 'lucide-vue-next' import { Plug, Plus, X } from 'lucide-vue-next'
const props = defineProps({ const props = defineProps({
@@ -7,10 +13,28 @@ const props = defineProps({
}) })
const showModal = ref(false) const showModal = ref(false)
const handleKeydown = (e) => {
if (e.key === 'Escape' && showModal.value) {
showModal.value = false
}
}
watch(showModal, (isOpen) => {
if (isOpen) {
window.addEventListener('keydown', handleKeydown)
} else {
window.removeEventListener('keydown', handleKeydown)
}
})
onUnmounted(() => {
window.removeEventListener('keydown', handleKeydown)
})
</script> </script>
<template> <template>
<div class="extension-status" :class="{ 'is-ready': isReady }" @click="showModal = true" :title="isReady ? 'Extension Connected' : 'Extension Not Connected'"> <div class="extension-status" v-bind="$attrs" :class="{ 'is-ready': isReady }" @click="showModal = true" :title="isReady ? 'Extension Connected' : 'Extension Not Connected'">
<Plug v-if="isReady" size="18" /> <Plug v-if="isReady" size="18" />
<Plus v-else size="18" /> <Plus v-else size="18" />
</div> </div>
@@ -55,10 +79,6 @@ const showModal = ref(false)
<style scoped> <style scoped>
.extension-status { .extension-status {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -1,6 +1,7 @@
import { onMounted, onUnmounted, ref, nextTick } from 'vue' import { onMounted, onUnmounted, ref, nextTick, watch } from 'vue'
import { UI_CONFIG } from '../config/ui'
export function useFillHeight(elementRef, marginBottom = 20) { export function useFillHeight(elementRef, extraMargin = 0) {
const height = ref('auto') const height = ref('auto')
const updateHeight = () => { const updateHeight = () => {
@@ -8,16 +9,10 @@ export function useFillHeight(elementRef, marginBottom = 20) {
const rect = elementRef.value.getBoundingClientRect() const rect = elementRef.value.getBoundingClientRect()
const windowHeight = window.innerHeight const windowHeight = window.innerHeight
// Calculate available space: window height - element top position - margin bottom
// We also need to account for the footer height if it's fixed or layout related
// The user mentioned "margin bottom from footer".
// If footer is in the flow, we might just want to fill the parent container?
// But user asked for JS resizing.
// Let's assume we want to fill down to (windowHeight - marginBottom). // Calculate available space: window height - element top position - footer height - padding - extra margin
// This assumes the element should stretch to the bottom of the viewport. const bottomOffset = UI_CONFIG.footerHeight + UI_CONFIG.pagePadding + extraMargin
const availableHeight = windowHeight - rect.top - bottomOffset
const availableHeight = windowHeight - rect.top - marginBottom
// Ensure minimum height // Ensure minimum height
if (availableHeight > 100) { if (availableHeight > 100) {
@@ -34,6 +29,13 @@ export function useFillHeight(elementRef, marginBottom = 20) {
// Also update after a short delay to ensure layout is settled (e.g. sidebar transitions) // Also update after a short delay to ensure layout is settled (e.g. sidebar transitions)
setTimeout(updateHeight, 300) setTimeout(updateHeight, 300)
// Watch for element appearing (v-if) or changing
watch(elementRef, () => {
nextTick(updateHeight)
// Additional update for layout stability
setTimeout(updateHeight, 100)
})
}) })
onUnmounted(() => { onUnmounted(() => {

View File

@@ -1,16 +1,20 @@
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
export function useLocalStorage(key, defaultValue) { export function useLocalStorage(key, defaultValue, toolPrefix = '') {
// Construct prefixed key: [toolPrefix-]key
const prefixPart = toolPrefix ? `${toolPrefix}-` : ''
const prefixedKey = `${prefixPart}${key}`
// Initialize state from local storage or default value // Initialize state from local storage or default value
const storedValue = localStorage.getItem(key) const storedValue = localStorage.getItem(prefixedKey)
const data = ref(storedValue ? JSON.parse(storedValue) : defaultValue) const data = ref(storedValue ? JSON.parse(storedValue) : defaultValue)
// Watch for changes and update local storage // Watch for changes and update local storage
watch(data, (newValue) => { watch(data, (newValue) => {
if (newValue === null || newValue === undefined) { if (newValue === null || newValue === undefined) {
localStorage.removeItem(key) localStorage.removeItem(prefixedKey)
} else { } else {
localStorage.setItem(key, JSON.stringify(newValue)) localStorage.setItem(prefixedKey, JSON.stringify(newValue))
} }
}, { deep: true }) }, { deep: true })

6
src/config/ui.js Normal file
View File

@@ -0,0 +1,6 @@
export const UI_CONFIG = {
headerHeight: 64,
footerHeight: 50,
pagePadding: 16 // Single side padding (1rem)
}

View File

@@ -3,6 +3,27 @@ import './style.css'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import Ripple from './directives/ripple' import Ripple from './directives/ripple'
import { BarcodeDetector, prepareZXingModule } from 'barcode-detector/ponyfill'
// Configure BarcodeDetector polyfill to use local WASM file
try {
prepareZXingModule({
overrides: {
locateFile: (path, prefix) => {
if (path.endsWith('.wasm')) {
return '/wasm/zxing_reader.wasm'
}
return prefix + path
}
}
})
// Force usage of polyfill to avoid CSP issues and ensure consistent behavior
// Native implementation might fail or be missing in some browsers
window.BarcodeDetector = BarcodeDetector
} catch (e) {
console.error('Failed to initialize BarcodeDetector polyfill', e)
}
const app = createApp(App) const app = createApp(App)

View File

@@ -3,6 +3,8 @@ import Main from '../components/Main.vue'
import Passwords from '../components/tools/Passwords.vue' import Passwords from '../components/tools/Passwords.vue'
import ClipboardSniffer from '../components/tools/ClipboardSniffer.vue' import ClipboardSniffer from '../components/tools/ClipboardSniffer.vue'
import UrlCleaner from '../components/tools/UrlCleaner.vue' import UrlCleaner from '../components/tools/UrlCleaner.vue'
import QrScanner from '../components/tools/QrScanner.vue'
import QrCode from '../components/tools/QrCode.vue'
import PrivacyPolicy from '../views/PrivacyPolicy.vue' import PrivacyPolicy from '../views/PrivacyPolicy.vue'
const routes = [ const routes = [
@@ -26,6 +28,16 @@ const routes = [
name: 'UrlCleaner', name: 'UrlCleaner',
component: UrlCleaner component: UrlCleaner
}, },
{
path: '/qr-scanner',
name: 'QrScanner',
component: QrScanner
},
{
path: '/qr-code',
name: 'QrCode',
component: QrCode
},
{ {
path: '/extension-privacy-policy', path: '/extension-privacy-policy',
name: 'PrivacyPolicy', name: 'PrivacyPolicy',

View File

@@ -2,8 +2,6 @@
*, *::before, *::after { *, *::before, *::after {
box-sizing: border-box; box-sizing: border-box;
} }
@import 'tailwindcss';
:root { :root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5; line-height: 1.5;
@@ -42,6 +40,8 @@
--title-gradient: linear-gradient(45deg, #00f2fe, #4facfe); --title-gradient: linear-gradient(45deg, #00f2fe, #4facfe);
--ripple-color: rgba(255, 255, 255, 0.3); --ripple-color: rgba(255, 255, 255, 0.3);
--nav-item-weight: 400; --nav-item-weight: 400;
--list-hover-bg: rgba(255, 255, 255, 0.05);
--header-bg: rgba(0, 0, 0, 0.6);
color: var(--text-color); color: var(--text-color);
background-color: #242424; /* Fallback */ background-color: #242424; /* Fallback */
@@ -84,6 +84,8 @@
--button-active-shadow: 0 0 18px rgba(14, 165, 233, 0.25); --button-active-shadow: 0 0 18px rgba(14, 165, 233, 0.25);
--title-gradient: linear-gradient(45deg, #0ea5e9, #6366f1); --title-gradient: linear-gradient(45deg, #0ea5e9, #6366f1);
--ripple-color: rgba(0, 0, 0, 0.1); --ripple-color: rgba(0, 0, 0, 0.1);
--list-hover-bg: rgba(0, 0, 0, 0.05);
--header-bg: rgba(255, 255, 255, 0.9);
} }
body { body {
@@ -111,16 +113,18 @@ body {
@media (min-width: 768px) { @media (min-width: 768px) {
body { body {
height: 100vh; min-height: 100vh;
overflow: hidden; overflow: auto;
} }
#app { #app {
height: 100vh; min-height: 100vh;
overflow: hidden; overflow: auto;
} }
} }
/* Removed global front camera mirror to restore stability */
/* --- Shared styles for all tools (moved from tools.css) --- */ /* --- Shared styles for all tools (moved from tools.css) --- */
.tool-container { .tool-container {
@@ -130,12 +134,12 @@ body {
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
height: 100%; height: 100%;
padding: 1rem; padding: 0.5rem;
} }
.tool-panel { .tool-panel {
width: 100%; width: 100%;
padding: 2rem; padding: 1rem;
border-radius: 16px; border-radius: 16px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -239,6 +243,16 @@ body {
box-shadow: var(--glass-shadow); box-shadow: var(--glass-shadow);
} }
@media (max-width: 640px) {
.glass-panel:not(.modal-content) {
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
border: none;
box-shadow: none;
}
}
.btn-neon { .btn-neon {
background: var(--button-bg); background: var(--button-bg);
border: 1px solid var(--button-border); border: 1px solid var(--button-border);
@@ -279,6 +293,22 @@ button:focus {
box-shadow: var(--button-active-shadow); box-shadow: var(--button-active-shadow);
} }
.btn-neon.danger {
background: rgba(239, 68, 68, 0.2);
border-color: rgba(239, 68, 68, 0.6);
color: #fee2e2;
}
.btn-neon.danger:hover {
background: rgba(239, 68, 68, 0.3);
border-color: rgba(239, 68, 68, 0.85);
box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}
:root[data-theme="light"] .btn-neon.danger {
color: #7f1d1d;
}
.icon-only { .icon-only {
padding: 8px; padding: 8px;
border-radius: 50%; border-radius: 50%;
@@ -307,3 +337,19 @@ span.ripple {
opacity: 0; opacity: 0;
} }
} }
/* --- Global Input/Select Focus Styles --- */
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
/* Custom focus ring for all form elements */
input:focus,
select:focus,
textarea:focus {
border-color: var(--primary-accent);
box-shadow: 0 0 0 1px var(--primary-accent);
}

View File

@@ -43,5 +43,11 @@ export default defineConfig({
], ],
define: { define: {
'__APP_VERSION__': JSON.stringify(packageJson.version) '__APP_VERSION__': JSON.stringify(packageJson.version)
},
server: {
host: true,
allowedHosts: [
'.trycloudflare.com'
]
} }
}) })