-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.main.html
More file actions
191 lines (173 loc) · 4.25 KB
/
Copy path404.main.html
File metadata and controls
191 lines (173 loc) · 4.25 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<meta name="robots" content="noindex" />
<noscript>
<meta http-equiv="refresh" content="0; url=/NOSCRIPT.html" />
</noscript>
<title>Redirecting...</title>
<script>
(async (L, w) => {
/* redireciona tudo de '/radio/' para outro dominio sem tratar*/
if (/^\/radio(\/|$)/i.test(L.pathname)) {
const to = /\.github\.io\/?/i.test(L.hostname)
? 'jcem-radio.github.io'
: 'radioamador.jcem.pro';
L.href = `https://${to}${L.pathname.split('/radio')[1]}${
L.search
}${L.hash}`;
}
/* normalização de URLs (ou canonicalização), que reduz diferentes representações equivalentes a uma forma única e estável.
* A ideia é tratar URLs como equivalentes quando só variam em detalhes irrelevantes (ex: http ↔ https, / no final, #, etc.).
*/
const normUrl = (u) => {
const x = new URL(u, L.origin);
let p = x.pathname.replace(/\/+$/, '') || '/';
const s = /^(https?|wss?)$/.test(
x.protocol.replace(':', ''),
);
return (
(s ? '' : x.protocol + '//') +
x.hostname.toLowerCase() +
(x.port && !/^(80|443)$/.test(x.port)
? ':' + x.port
: '') +
p +
(x.search || '')
);
};
const isInt = (v) =>
Number.isInteger(v) ||
(typeof v === 'string' && /^[+-]?\d+$/.test(v));
const GO = async (t, flbk) => {
const p = (L.pathname + L.search).replace(
/^\/\s*404\.html(\/|\?)/gi,
'/',
);
if (/\/[^/]*\.[^/]*$/.test(p)) throw 4;
try {
const r = await fetch(
p.replace(/(\/?[^\/]*\/?)$/, '/') + 'data.json',
);
if (!r.ok) throw 1;
const j = await r.json().catch(() => {
throw 2;
});
const u = j?.[0];
new URL(u); // lança se inválida
if (
Array.isArray(j) &&
j.length == 1 &&
typeof u == 'string'
)
L.href = u;
else throw 3;
} catch (e) {
flbk(e, isInt(t) ? t + 1 : 1);
}
};
const STP2 = (e) => {
throw e;
};
GO(0, STP2);
})(window.location, window);
</script>
<style>
:root {
--blue: #c08282;
--blue2: #2b92db;
--amber: #cc4c1e;
--bg: #ebebeb;
--text: #222;
--radius: 1rem;
}
* {
box-sizing: border-box;
font-family: 'Noto Sans', 'Segoe UI', 'Tahoma', sans-serif;
color: var(--text);
}
html,
body {
margin: 0;
padding: 0;
background: var(--bg);
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* Loader top bar */
.loader-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 0.7rem;
background: linear-gradient(
90deg,
var(--blue2) 0%,
var(--blue2) 50%,
transparent 100%
);
background-size: 200% 100%;
animation: loading 1s linear infinite;
z-index: 9999;
border-bottom: 1px solid #eee;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
</style>
</head>
<body>
<!-- Loader top bar -->
<div class="loader-bar"></div>
<noscript>
<main>
<h1><span>⚠️</span>Problem / Problema / 问题</h1>
<div class="lang">
<h2>🇺🇸 English</h2>
<p>
<span>⚠️</span><strong>JavaScript is disabled.</strong
><br />
This prevents automatic redirection to your destination.
</p>
</div>
<div class="lang">
<h2>🇧🇷 Português</h2>
<p>
<span>⚠️</span
><strong>O JavaScript está desativado.</strong><br />
Isso impede o redirecionamento automático para o destino.
</p>
</div>
<div class="lang">
<h2>🇪🇸 Español</h2>
<p>
<span>⚠️</span
><strong>JavaScript está deshabilitado.</strong><br />
Esto impide la redirección automática al destino.
</p>
</div>
<div class="lang">
<h2>🇨🇳 中文(普通话)</h2>
<p>
<span>⚠️</span><strong>JavaScript 已被禁用。</strong
><br />
这会阻止自动跳转到目标页面。
</p>
</div>
</main>
</noscript>
</body>
</html>