|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta |
| 6 | + name="viewport" |
| 7 | + content="width=device-width, initial-scale=1.0" |
| 8 | + /> |
| 9 | + <title>StikFetch Patreon Redirect</title> |
| 10 | + <style> |
| 11 | + body { |
| 12 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 13 | + background: #0b0b0f; |
| 14 | + color: #f5f5f5; |
| 15 | + display: flex; |
| 16 | + align-items: center; |
| 17 | + justify-content: center; |
| 18 | + min-height: 100vh; |
| 19 | + margin: 0; |
| 20 | + padding: 24px; |
| 21 | + text-align: center; |
| 22 | + } |
| 23 | + .card { |
| 24 | + max-width: 420px; |
| 25 | + padding: 32px; |
| 26 | + border-radius: 20px; |
| 27 | + background: rgba(255, 255, 255, 0.04); |
| 28 | + box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); |
| 29 | + } |
| 30 | + h1 { |
| 31 | + font-size: 1.9rem; |
| 32 | + margin-bottom: 12px; |
| 33 | + } |
| 34 | + p { |
| 35 | + margin: 0; |
| 36 | + line-height: 1.5; |
| 37 | + } |
| 38 | + code { |
| 39 | + font-family: ui-monospace, SFMono-Regular, SFMono-Bold, Menlo, Monaco, Consolas, "Liberation Mono", |
| 40 | + "Courier New", monospace; |
| 41 | + } |
| 42 | + .hidden { |
| 43 | + display: none; |
| 44 | + } |
| 45 | + </style> |
| 46 | + </head> |
| 47 | + <body> |
| 48 | + <div class="card"> |
| 49 | + <h1>Opening StikFetch…</h1> |
| 50 | + <p id="status">If the app doesn’t open automatically, tap the button below.</p> |
| 51 | + <p class="hidden" id="error"></p> |
| 52 | + <p style="margin-top: 18px;"> |
| 53 | + <a id="open-app" href="#" style="color: #9ad1ff;">Open StikFetch</a> |
| 54 | + </p> |
| 55 | + <p style="margin-top: 24px; font-size: 0.85rem; opacity: 0.75;"> |
| 56 | + You can close this tab once the app finishes signing you in. |
| 57 | + </p> |
| 58 | + </div> |
| 59 | + <script> |
| 60 | + (function () { |
| 61 | + const query = window.location.search || ""; |
| 62 | + const hash = window.location.hash || ""; |
| 63 | + const target = "stikfetch://oauth" + query + hash; |
| 64 | + const error = new URLSearchParams(query).get("error_description"); |
| 65 | + |
| 66 | + const errorEl = document.getElementById("error"); |
| 67 | + const statusEl = document.getElementById("status"); |
| 68 | + const openLink = document.getElementById("open-app"); |
| 69 | + openLink.href = target; |
| 70 | + |
| 71 | + if (error) { |
| 72 | + statusEl.textContent = "Patreon reported an error while signing in."; |
| 73 | + errorEl.textContent = error; |
| 74 | + errorEl.classList.remove("hidden"); |
| 75 | + return; |
| 76 | + } |
| 77 | + |
| 78 | + let opened = false; |
| 79 | + const attemptOpen = () => { |
| 80 | + window.location.replace(target); |
| 81 | + }; |
| 82 | + |
| 83 | + openLink.addEventListener("click", (event) => { |
| 84 | + event.preventDefault(); |
| 85 | + attemptOpen(); |
| 86 | + }); |
| 87 | + |
| 88 | + attemptOpen(); |
| 89 | + |
| 90 | + setTimeout(() => { |
| 91 | + if (!opened) { |
| 92 | + statusEl.textContent = "Tap “Open StikFetch” above if your device doesn’t switch automatically."; |
| 93 | + } |
| 94 | + }, 1200); |
| 95 | + })(); |
| 96 | + </script> |
| 97 | + </body> |
| 98 | +</html> |
0 commit comments