-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbulk-url.html
More file actions
230 lines (210 loc) · 6.63 KB
/
bulk-url.html
File metadata and controls
230 lines (210 loc) · 6.63 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Open Multiple URLs | tools.eliana.lol</title>
<link rel="stylesheet" href="global.css" />
<link rel="icon" type="image/x-icon" href="favicon.svg" />
<style>
/* Tool-specific UI */
.options-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
padding: 15px;
border: 1px dashed var(--puny);
background: var(--hover);
margin-bottom: 20px;
}
.option-group {
display: flex;
flex-direction: column;
gap: 5px;
}
.option-group label {
font-size: 0.85rem;
cursor: pointer;
}
#status {
margin-top: 15px;
padding: 10px;
border: 1px solid var(--accent);
background: var(--highlight);
font-size: 0.85rem;
}
.hidden {
display: none;
}
.tip-box {
margin-top: 2rem;
padding: 15px;
border: 1px solid var(--puny);
font-size: 0.8rem;
opacity: 0.8;
}
</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>Open Multiple URLs</h1>
<p class="puny">
Paste URLs (one per line) to open them all in new tabs/windows.
</p>
<div class="options-grid">
<div class="option-group">
<span class="section-title" style="margin-top: 0; font-size: 0.7rem"
>Mode</span
>
<label
><input type="radio" name="openMode" value="tabs" checked /> New
Tabs</label
>
<label
><input type="radio" name="openMode" value="windows" /> New
Windows</label
>
</div>
<div class="option-group">
<span class="section-title" style="margin-top: 0; font-size: 0.7rem"
>Settings</span
>
<label
><input type="checkbox" id="addProtocol" checked /> Add http:// if
missing</label
>
<label
>Delay (ms):
<input
type="number"
id="delay"
value="100"
style="width: 60px; padding: 2px"
/></label>
</div>
</div>
<textarea
id="urls"
rows="12"
placeholder="https://example.com https://google.com"
></textarea>
<div
style="
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
"
>
<div id="stats" class="puny italic">0 URLs detected</div>
<div>
<button id="example">Load Example</button>
<button id="clear">Clear</button>
<button
id="openAll"
style="border-color: var(--accent); font-weight: bold"
>
🚀 Open All
</button>
</div>
</div>
<div id="status" class="hidden"></div>
<div class="tip-box">
<strong>💡 Browser Tip:</strong> Most browsers block bulk popups by
default. Look for the "Always allow popups" icon in your URL bar if
nothing happens.
</div>
</main>
<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]';
};
}
</script>
<script>
const urlsTextarea = document.getElementById('urls');
const openAllBtn = document.getElementById('openAll');
const clearBtn = document.getElementById('clear');
const exampleBtn = document.getElementById('example');
const statusDiv = document.getElementById('status');
const statsDiv = document.getElementById('stats');
const addProtocolCheckbox = document.getElementById('addProtocol');
const delayInput = document.getElementById('delay');
function updateStats() {
const urls = extractUrls(urlsTextarea.value);
statsDiv.textContent = `${urls.length} URL${urls.length !== 1 ? 's' : ''} detected`;
}
function showStatus(message) {
statusDiv.textContent = message;
statusDiv.classList.remove('hidden');
setTimeout(() => statusDiv.classList.add('hidden'), 5000);
}
function extractUrls(text) {
const addProtocol = addProtocolCheckbox.checked;
return text
.split(/\r?\n/)
.map((line) => line.trim())
.filter((line) => line !== '')
.map((line) => {
if (addProtocol && !line.match(/^https?:\/\//i)) {
return 'http://' + line;
}
return line;
});
}
openAllBtn.onclick = () => {
const urls = extractUrls(urlsTextarea.value.trim());
if (urls.length === 0) return alert('Enter some URLs first!');
const mode = document.querySelector(
'input[name="openMode"]:checked'
).value;
const delay = parseInt(delayInput.value) || 100;
showStatus(`Opening ${urls.length} items...`);
urls.forEach((url, index) => {
setTimeout(() => {
const features =
mode === 'windows'
? 'width=800,height=600,noopener,noreferrer'
: '';
window.open(url, '_blank', features);
}, index * delay);
});
};
urlsTextarea.oninput = updateStats;
clearBtn.onclick = () => {
urlsTextarea.value = '';
updateStats();
};
exampleBtn.onclick = () => {
urlsTextarea.value =
'https://eliana.lol\nhttps://github.com/jubilancy\nhttps://j3s.sh';
updateStats();
};
</script>
</body>
</html>