forked from voucan/voucan.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathus5.html
More file actions
240 lines (216 loc) · 6.4 KB
/
us5.html
File metadata and controls
240 lines (216 loc) · 6.4 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
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/storage/css/style.css" rel="stylesheet" />
<title>Logged Links</title>
<style>
body {
font-family: Arial, sans-serif;
background: blue;
margin: 0;
padding: 2em;
}
h1,
h5 {
text-align: center;
color: rgba(255, 255, 255);
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
margin-top: 2em;
}
.card {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background-color: rgba(0, 0, 0, 0.2);
color: white;
padding: 1em;
border-radius: 8px;
word-wrap: break-word;
transition: transform 0.2s ease;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.card a {
color: rgba(255, 255, 255);
text-decoration: none;
font-weight: bold;
cursor: pointer;
}
.card a:hover {
text-decoration: underline;
}
.empty {
text-align: center;
color: rgba(255, 255, 255);
margin-top: 4em;
}
.page {
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
gap: 1em;
z-index: 1000;
background: rgba(0, 0, 0, 0.3);
padding: 0.5em 1em;
border-radius: 8px;
}
.page button {
background-color: rgba(0, 0, 0, 0.5);
color: white;
border: none;
padding: 0.5em 1em;
border-radius: 5px;
cursor: pointer;
}
.page button:disabled {
background-color: rgba(0, 0, 0, 0.2);
cursor: not-allowed;
}
.flicker {
display: inline-block;
}
</style>
</head>
<body>
<script src="/storage/js/particles.js"></script>
<script src="/storage/js/apps.js"></script>
<div id="particles-js"></div>
<h1>Logged Links</h1>
<h5>Fetches links that have been visited by any user - Not working? try the manually uploaded links: <a href="/us5-links2" target="_blank" style="color: blue;">Click Here</a></h5>
<div id="linkGrid" class="grid"></div>
<div id="emptyMsg" class="empty" style="display:none;"> Loading... </div>
<div class="page">
<button id="prevBtn">Previous</button>
<button id="nextBtn">Next</button>
</div>
<script>
const logsApi = "https://tight-wind-574e.bijoh41469.workers.dev/logs";
const CACHE_KEY = "us5-cache";
const gridEl = document.getElementById("linkGrid");
const emptyEl = document.getElementById("emptyMsg");
const prev = document.getElementById("prevBtn");
const next = document.getElementById("nextBtn");
let links = [];
let page = 0;
const limit = 20;
let flick = [];
function deleteflickgloveslapbattles() {
flick.forEach(cancelAnimationFrame);
flick = [];
}
function dclick(el) {
el.onclick = (e) => {
e.preventDefault();
const decoded = el.textContent.replace(/\u200B/g, "").replace(/\uFFFD/g, "");
window.open(decoded, "_blank");
};
}
function antiscreenshot(el) {
const text = el.textContent;
el.innerHTML = "";
for (let i = 0; i < text.length; i++) {
const span = document.createElement("span");
span.className = "flicker";
span.textContent = text[i];
el.appendChild(span);
const flicker = () => {
const r = Math.random();
if (r < 0.85) span.style.opacity = "1";
else if (r < 0.95) span.style.opacity = "0";
const id = requestAnimationFrame(flicker);
flick.push(id);
};
flicker();
}
}
function updpg() {
deleteflickgloveslapbattles();
gridEl.innerHTML = "";
const offset = page * limit;
const current = links.slice(offset, offset + limit);
if (!current.length) {
emptyEl.style.display = "block";
return;
}
emptyEl.style.display = "none";
for (let i = 0; i < current.length; i++) {
const div = document.createElement("div");
div.className = "card";
const a = document.createElement("a");
a.href = current[i];
a.textContent = current[i];
a.target = "_blank";
a.rel = "noopener noreferrer";
dclick(a);
div.appendChild(a);
gridEl.appendChild(div);
antiscreenshot(a);
}
prev.disabled = page === 0;
next.disabled = offset + limit >= links.length;
}
function loadCache() {
try {
const cached = localStorage.getItem(CACHE_KEY);
return cached ? JSON.parse(cached) : [];
} catch (err) {
console.warn("cache read fail", err);
return [];
}
}
function saveCache(list) {
try {
localStorage.setItem(CACHE_KEY, JSON.stringify(list));
} catch (err) {
console.warn("cache save fail", err);
}
}
async function getlinks() {
links = loadCache();
updpg();
try {
const r = await fetch(logsApi);
if (!r.ok) throw new Error("API error");
const data = await r.json();
const combined = [...new Set([...links, ...data])];
if (combined.length !== links.length) {
links = combined;
saveCache(links);
page = 0;
updpg();
}
} catch (e) {
console.error("fetch failed", e);
if (!links.length) {
emptyEl.textContent = "Couldn't fetch any links.";
emptyEl.style.display = "block";
}
}
}
prev.addEventListener("click", () => {
if (page > 0) {
page--;
updpg();
}
});
next.addEventListener("click", () => {
if ((page + 1) * limit < links.length) {
page++;
updpg();
}
});
getlinks();
</script>
<script type="text/javascript" src="/storage/js/background.js"></script>
</body>
</html>