Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
fd23860bcf
|
|||
|
74c0251535
|
|||
|
06b2815dd9
|
|||
|
1346de684c
|
|||
|
cfc9ac73b2
|
|||
|
e095c0190b
|
|||
|
45342d456a
|
|||
|
3ea7f63b83
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"version": "0.4.2",
|
"version": "0.4.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"version": "0.4.2",
|
"version": "0.4.6",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-vue-next": "^0.575.0",
|
"lucide-vue-next": "^0.575.0",
|
||||||
"vue": "^3.5.25",
|
"vue": "^3.5.25",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tools-app",
|
"name": "tools-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.4.2",
|
"version": "0.4.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -74,6 +74,13 @@ onUnmounted(() => {
|
|||||||
padding-bottom: calc(2rem + 40px + env(safe-area-inset-bottom));
|
padding-bottom: calc(2rem + 40px + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.main-content {
|
||||||
|
padding: 1rem;
|
||||||
|
padding-bottom: calc(1rem + 40px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.app-body {
|
.app-body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -69,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
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onUnmounted } from 'vue'
|
import { ref, watch, onUnmounted } from 'vue'
|
||||||
import { Copy, Trash2, ExternalLink, Power, Zap, X, Settings } 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'
|
||||||
@@ -57,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 = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,13 +224,13 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
<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>
|
||||||
@@ -219,9 +254,17 @@ 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">
|
||||||
<Trash2 size="18" />
|
<button class="icon-btn" @click="copyAllUrls" title="Copy all URLs">
|
||||||
</button>
|
<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" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="history-list">
|
<div class="history-list">
|
||||||
@@ -300,6 +343,15 @@ 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;
|
||||||
@@ -330,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 {
|
||||||
@@ -395,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 {
|
||||||
@@ -415,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 {
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ const addRule = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) => {
|
const removeRule = (id) => {
|
||||||
localExceptions.value = localExceptions.value.filter(r => r.id !== id)
|
localExceptions.value = localExceptions.value.filter(r => r.id !== id)
|
||||||
}
|
}
|
||||||
@@ -145,7 +154,7 @@ const resetToDefault = (ruleId) => {
|
|||||||
<template>
|
<template>
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<div v-if="isOpen" class="modal-overlay" @click.self="$emit('close')">
|
<div v-if="isOpen" class="modal-overlay" @click.self="$emit('close')">
|
||||||
<div class="modal-content glass-panel">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h3>URL Cleaning Exceptions</h3>
|
<h3>URL Cleaning Exceptions</h3>
|
||||||
<button class="close-btn" @click="$emit('close')">
|
<button class="close-btn" @click="$emit('close')">
|
||||||
@@ -200,7 +209,7 @@ const resetToDefault = (ruleId) => {
|
|||||||
|
|
||||||
<div v-for="rule in localExceptions" :key="rule.id" class="rule-item" :class="{ disabled: !rule.isEnabled }">
|
<div v-for="rule in localExceptions" :key="rule.id" class="rule-item" :class="{ disabled: !rule.isEnabled }">
|
||||||
<div class="rule-info">
|
<div class="rule-info">
|
||||||
<div class="rule-domain">{{ rule.domainPattern }}</div>
|
<div class="rule-domain" @click="editRule(rule)" title="Click to edit">{{ rule.domainPattern }}</div>
|
||||||
<div class="rule-details">
|
<div class="rule-details">
|
||||||
<div class="params-list">
|
<div class="params-list">
|
||||||
<template v-if="rule.keepAllParams">
|
<template v-if="rule.keepAllParams">
|
||||||
@@ -275,6 +284,10 @@ const resetToDefault = (ruleId) => {
|
|||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(:root[data-theme="light"]) .modal-overlay {
|
||||||
|
background: rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
background: var(--glass-bg);
|
background: var(--glass-bg);
|
||||||
backdrop-filter: blur(16px);
|
backdrop-filter: blur(16px);
|
||||||
@@ -291,6 +304,11 @@ const resetToDefault = (ruleId) => {
|
|||||||
color: var(--text-color);
|
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 {
|
.modal-header {
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
border-bottom: 1px solid var(--glass-border);
|
border-bottom: 1px solid var(--glass-border);
|
||||||
@@ -352,6 +370,11 @@ const resetToDefault = (ruleId) => {
|
|||||||
border: 1px solid var(--glass-border);
|
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 {
|
.add-rule-form h4, .rules-list h4 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
@@ -445,6 +468,11 @@ const resetToDefault = (ruleId) => {
|
|||||||
transition: opacity 0.3s;
|
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 {
|
.rule-item.disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
@@ -457,6 +485,13 @@ const resetToDefault = (ruleId) => {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--primary-accent);
|
color: var(--primary-accent);
|
||||||
margin-bottom: 0.3rem;
|
margin-bottom: 0.3rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-domain:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule-details {
|
.rule-details {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
--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);
|
||||||
|
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
background-color: #242424; /* Fallback */
|
background-color: #242424; /* Fallback */
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
--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);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -239,6 +241,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 +291,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%;
|
||||||
|
|||||||
Reference in New Issue
Block a user