goes to a random website hosted on wisp.place
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <title>redirecting...</title>
6 <style>
7 body {
8 margin: 0;
9 min-height: 100vh;
10 display: flex;
11 flex-direction: column;
12 align-items: center;
13 justify-content: center;
14 background: #0d0d0d;
15 color: #aaa;
16 }
17 p {
18 font-size: 0.9rem;
19 letter-spacing: 0.05em;
20 }
21 .bar {
22 position: fixed;
23 bottom: 0;
24 left: 0;
25 width: 100%;
26 height: 2px;
27 }
28 .bar::after {
29 content: "";
30 position: absolute;
31 height: 2px;
32 width: 40%;
33 background: #aaa;
34 animation: bounce 1.4s ease-in-out infinite;
35 }
36 @keyframes bounce {
37 0% { left: -40%; }
38 100% { left: 100%; }
39 }
40 .bar.done { display: none; }
41 .error { color: #c04; }
42 #link { display: none; font-size: 0.9rem; margin-top: 0.2rem; }
43 #link a { color: #666; text-decoration: none; }
44 #link a:hover { color: #aaa; }
45 </style>
46</head>
47<body>
48 <p id="msg">picking a random site for you (^w^)</p>
49 <p id="link"><a id="url" href="#"></a></p>
50 <div class="bar" id="bar"></div>
51 <script>
52 fetch("__API_URL__")
53 .then(r => {
54 if (r.status === 503) throw new Error("no sites discovered yet, try again later (_ _*)Zzz");
55 if (!r.ok) throw new Error(`server error (T_T): ${r.status}`);
56 return r.json();
57 })
58 .then(({ domains, fallbackUrl }) => {
59 domains = domains.map(d => `https://${d}`);
60 const preferred = domains.filter(d => !d.endsWith("wisp.place"));
61 const href = (preferred.length > 0 ? preferred : domains)[0] ?? fallbackUrl;
62 const a = document.getElementById("url");
63 a.href = href;
64 a.textContent = href;
65 const p = document.getElementById("msg");
66 p.textContent = "found website!! \\(^.^)/";
67 document.getElementById("link").style.display = "block";
68 document.getElementById("bar").classList.add("done");
69 window.location.href = href;
70 })
71 .catch((err) => {
72 const p = document.getElementById("msg");
73 p.textContent = err.message;
74 p.className = "error";
75 document.title = "uh oh :c";
76 document.getElementById("bar").classList.add("done");
77 });
78 </script>
79</body>
80</html>