-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurl-cleaner.html
More file actions
195 lines (175 loc) · 5.76 KB
/
url-cleaner.html
File metadata and controls
195 lines (175 loc) · 5.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>URL List Cleaner | tools.eliana.lol</title>
<link rel="stylesheet" href="global.css" />
<link rel="icon" type="image/x-icon" href="favicon.svg" />
<style>
/* Layout for the URL Tool */
#linklist {
width: 100%;
min-height: 300px;
margin-bottom: 5px;
}
.stats-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.button-grid {
display: grid;
gap: 20px;
margin-top: 20px;
}
.group-container {
border: 1px dashed var(--puny);
padding: 15px;
background: var(--hover);
}
.group-label {
font-size: 0.7rem;
text-transform: uppercase;
font-weight: bold;
color: var(--puny);
margin-bottom: 10px;
display: block;
}
.btn-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
/* Group-specific highlights to mirror your original screenshot's intent */
#parseUrl,
#addhttp {
border-color: #3b82f6;
} /* Blue group */
#urls,
#domains {
border-color: #22c55e;
} /* Green group */
#removehttp {
border-color: #eab308;
} /* Yellow group */
</style>
</head>
<body>
<nav>
<div class="left">
<a href="index.html">home</a> | <a href="extra.html">extra</a> |
<a href="credits.html">credits</a> |
<a href="changelog.html">logs</a>
</div>
<div class="right">
<button id="theme-toggle">[theme]</button> |
<a href="https://eliana.lol">site</a>
</div>
</nav>
<main>
<h1>URL List Cleaner</h1>
<p class="puny">
Paste a list of links below to bulk transform, deduplicate, or sort
them.
</p>
<textarea
id="linklist"
placeholder="Enter one URL per line..."
></textarea>
<div class="stats-bar">
<span id="linecount" class="puny">0 lines</span>
<div class="btn-row">
<button type="button" id="undochange" class="puny">[undo]</button>
<button type="button" id="singlecopy" style="font-weight: bold">
Copy All
</button>
<button
type="button"
id="clearBtn"
style="color: var(--accent); border-style: dotted"
>
Clear
</button>
</div>
</div>
<div class="button-grid">
<div class="group-container">
<span class="group-label">Extraction & Protocol</span>
<div class="btn-row">
<button type="button" id="parseUrl">Extract URLs</button>
<button type="button" id="addhttp">Add https://www.</button>
<button type="button" id="removehttp">Remove Variations</button>
</div>
</div>
<div class="group-container">
<span class="group-label">Domain Trimming</span>
<div class="btn-row">
<button type="button" id="rtdomain">Root Domain</button>
<button type="button" id="madomain">Main Domain</button>
<button type="button" id="root">Trim to Root</button>
</div>
</div>
<div class="group-container">
<span class="group-label">Clean & Deduplicate</span>
<div class="btn-row">
<button type="button" id="urls">Remove Duplicate URLs</button>
<button type="button" id="domains">Remove Duplicate Domains</button>
</div>
</div>
<div class="group-container">
<span class="group-label">Organize</span>
<div class="btn-row">
<button type="button" id="httpsort">Sort A-Z</button>
<button type="button" id="sort_length">Sort by Length</button>
<button type="button" id="sort_random">Sort Random</button>
</div>
</div>
</div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://www.coderstool.com/js/all.js"></script>
<script src="https://www.coderstool.com/js/c_url.js"></script>
<script>
const html = document.documentElement;
const toggle = document.getElementById('theme-toggle');
const saved =
localStorage.getItem('theme') ||
(window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light');
html.setAttribute('data-theme', saved);
if (toggle) toggle.innerText = saved === 'dark' ? '[light]' : '[dark]';
if (toggle) {
toggle.onclick = () => {
const now = html.getAttribute('data-theme');
const next = now === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', next);
localStorage.setItem('theme', next);
toggle.innerText = next === 'dark' ? '[light]' : '[dark]';
};
}
$(document).ready(function () {
// Bind the external library logic
if (window.CodersTool) {
CodersTool.url_link_clean();
}
// Manual fix for clear button
$('#clearBtn').on('click', function () {
$('#linklist').val('').trigger('input');
$('#linecount').text('0 lines');
});
// Manual fix for copy button
$('#singlecopy').on('click', function () {
const val = $('#linklist').val();
if (!val) return;
navigator.clipboard.writeText(val);
const old = $(this).text();
$(this).text('Copied!');
setTimeout(() => $(this).text(old), 1500);
});
});
</script>
</body>
</html>