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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Claim Link - AstraPay</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
min-height: 100vh;
|
| 12 |
+
background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
|
| 13 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 14 |
+
color: #ffffff;
|
| 15 |
+
line-height: 1.6;
|
| 16 |
+
}
|
| 17 |
+
.main-content {
|
| 18 |
+
margin-top: 0;
|
| 19 |
+
min-height: 100vh;
|
| 20 |
+
display: flex;
|
| 21 |
+
justify-content: center;
|
| 22 |
+
align-items: center;
|
| 23 |
+
padding: 2rem 0;
|
| 24 |
+
}
|
| 25 |
+
.container {
|
| 26 |
+
text-align: center;
|
| 27 |
+
max-width: 500px;
|
| 28 |
+
padding: 2rem;
|
| 29 |
+
}
|
| 30 |
+
.title {
|
| 31 |
+
font-size: 2.2rem;
|
| 32 |
+
font-weight: 600;
|
| 33 |
+
margin-bottom: 1.5rem;
|
| 34 |
+
letter-spacing: -0.02em;
|
| 35 |
+
}
|
| 36 |
+
.claim-card {
|
| 37 |
+
background: rgba(255, 255, 255, 0.02);
|
| 38 |
+
backdrop-filter: blur(20px);
|
| 39 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 40 |
+
border-radius: 16px;
|
| 41 |
+
padding: 2.5rem;
|
| 42 |
+
margin-bottom: 2rem;
|
| 43 |
+
position: relative;
|
| 44 |
+
overflow: hidden;
|
| 45 |
+
}
|
| 46 |
+
.claim-card::before {
|
| 47 |
+
content: '';
|
| 48 |
+
position: absolute;
|
| 49 |
+
top: 0;
|
| 50 |
+
left: 0;
|
| 51 |
+
right: 0;
|
| 52 |
+
height: 1px;
|
| 53 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
| 54 |
+
}
|
| 55 |
+
.amount {
|
| 56 |
+
font-size: 3.2rem;
|
| 57 |
+
font-weight: 700;
|
| 58 |
+
background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
|
| 59 |
+
-webkit-background-clip: text;
|
| 60 |
+
-webkit-text-fill-color: transparent;
|
| 61 |
+
background-clip: text;
|
| 62 |
+
margin-bottom: 0.5rem;
|
| 63 |
+
letter-spacing: -0.02em;
|
| 64 |
+
}
|
| 65 |
+
.status {
|
| 66 |
+
font-size: 0.95rem;
|
| 67 |
+
padding: 0.5rem 1.2rem;
|
| 68 |
+
border-radius: 20px;
|
| 69 |
+
display: inline-block;
|
| 70 |
+
margin-bottom: 2rem;
|
| 71 |
+
font-weight: 500;
|
| 72 |
+
letter-spacing: 0.01em;
|
| 73 |
+
}
|
| 74 |
+
.status.pending {
|
| 75 |
+
background: rgba(255, 193, 7, 0.15);
|
| 76 |
+
color: #ffc107;
|
| 77 |
+
border: 1px solid rgba(255, 193, 7, 0.3);
|
| 78 |
+
}
|
| 79 |
+
.status.verified {
|
| 80 |
+
background: rgba(0, 255, 136, 0.15);
|
| 81 |
+
color: #00ff88;
|
| 82 |
+
border: 1px solid rgba(0, 255, 136, 0.3);
|
| 83 |
+
}
|
| 84 |
+
.status.claimed {
|
| 85 |
+
background: rgba(100, 100, 255, 0.15);
|
| 86 |
+
color: #6464ff;
|
| 87 |
+
border: 1px solid rgba(100, 100, 255, 0.3);
|
| 88 |
+
}
|
| 89 |
+
.claim-button {
|
| 90 |
+
background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
|
| 91 |
+
color: #000000;
|
| 92 |
+
border: none;
|
| 93 |
+
padding: 1rem 2.5rem;
|
| 94 |
+
font-size: 1rem;
|
| 95 |
+
font-weight: 600;
|
| 96 |
+
border-radius: 12px;
|
| 97 |
+
cursor: pointer;
|
| 98 |
+
transition: all 0.3s ease;
|
| 99 |
+
letter-spacing: 0.01em;
|
| 100 |
+
box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
|
| 101 |
+
}
|
| 102 |
+
.claim-button:hover:not(:disabled) {
|
| 103 |
+
transform: translateY(-2px);
|
| 104 |
+
box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
|
| 105 |
+
}
|
| 106 |
+
.claim-button:disabled {
|
| 107 |
+
background: rgba(255, 255, 255, 0.3);
|
| 108 |
+
color: rgba(255, 255, 255, 0.5);
|
| 109 |
+
cursor: not-allowed;
|
| 110 |
+
transform: none;
|
| 111 |
+
box-shadow: none;
|
| 112 |
+
}
|
| 113 |
+
.info-text {
|
| 114 |
+
font-size: 0.9rem;
|
| 115 |
+
color: rgba(255, 255, 255, 0.7);
|
| 116 |
+
margin-bottom: 1rem;
|
| 117 |
+
}
|
| 118 |
+
.back-link {
|
| 119 |
+
color: rgba(255, 255, 255, 0.6);
|
| 120 |
+
text-decoration: none;
|
| 121 |
+
font-size: 0.9rem;
|
| 122 |
+
margin-top: 2rem;
|
| 123 |
+
display: inline-block;
|
| 124 |
+
font-weight: 500;
|
| 125 |
+
transition: color 0.3s ease;
|
| 126 |
+
}
|
| 127 |
+
.back-link:hover {
|
| 128 |
+
color: rgba(255, 255, 255, 0.9);
|
| 129 |
+
}
|
| 130 |
+
.claim-modal {
|
| 131 |
+
display: none;
|
| 132 |
+
position: fixed;
|
| 133 |
+
z-index: 1;
|
| 134 |
+
left: 0;
|
| 135 |
+
top: 0;
|
| 136 |
+
width: 100%;
|
| 137 |
+
height: 100%;
|
| 138 |
+
background-color: rgba(0, 0, 0, 0.9);
|
| 139 |
+
}
|
| 140 |
+
.claim-modal-content {
|
| 141 |
+
background-color: #1a1a1a;
|
| 142 |
+
margin: 15% auto;
|
| 143 |
+
padding: 2rem;
|
| 144 |
+
border-radius: 12px;
|
| 145 |
+
width: 90%;
|
| 146 |
+
max-width: 500px;
|
| 147 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 148 |
+
text-align: center;
|
| 149 |
+
}
|
| 150 |
+
.claim-modal-title {
|
| 151 |
+
color: #ffffff;
|
| 152 |
+
font-size: 1.5rem;
|
| 153 |
+
font-weight: bold;
|
| 154 |
+
margin-bottom: 1.5rem;
|
| 155 |
+
}
|
| 156 |
+
.form-input {
|
| 157 |
+
width: 100%;
|
| 158 |
+
padding: 0.75rem;
|
| 159 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 160 |
+
border-radius: 8px;
|
| 161 |
+
background-color: rgba(255, 255, 255, 0.05);
|
| 162 |
+
color: #ffffff;
|
| 163 |
+
font-size: 1rem;
|
| 164 |
+
margin: 1rem 0;
|
| 165 |
+
box-sizing: border-box;
|
| 166 |
+
}
|
| 167 |
+
.form-input:focus {
|
| 168 |
+
outline: none;
|
| 169 |
+
border-color: rgba(255, 255, 255, 0.4);
|
| 170 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 171 |
+
}
|
| 172 |
+
.claim-modal-buttons {
|
| 173 |
+
display: flex;
|
| 174 |
+
gap: 1rem;
|
| 175 |
+
justify-content: center;
|
| 176 |
+
margin-top: 2rem;
|
| 177 |
+
}
|
| 178 |
+
.btn-secondary {
|
| 179 |
+
background-color: transparent;
|
| 180 |
+
color: rgba(255, 255, 255, 0.9);
|
| 181 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 182 |
+
padding: 0.75rem 1.5rem;
|
| 183 |
+
border-radius: 8px;
|
| 184 |
+
cursor: pointer;
|
| 185 |
+
font-size: 1rem;
|
| 186 |
+
transition: all 0.2s ease;
|
| 187 |
+
}
|
| 188 |
+
.btn-secondary:hover {
|
| 189 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 190 |
+
}
|
| 191 |
+
.success-message {
|
| 192 |
+
font-size: 1.2rem;
|
| 193 |
+
color: #00ff88;
|
| 194 |
+
font-weight: 500;
|
| 195 |
+
margin-top: 1rem;
|
| 196 |
+
}
|
| 197 |
+
</style>
|
| 198 |
+
</head>
|
| 199 |
+
<body>
|
| 200 |
+
<div class="main-content">
|
| 201 |
+
<div class="container">
|
| 202 |
+
<h1 class="title">AstraPay Claim</h1>
|
| 203 |
+
|
| 204 |
+
<div class="claim-card">
|
| 205 |
+
<div class="amount">{{ claim_amount }} Astra{{ 's' if claim_amount > 1 else '' }}</div>
|
| 206 |
+
{% if not claimed %}
|
| 207 |
+
<div class="info-text" style="margin-bottom: 1rem;">
|
| 208 |
+
Send {{ send_amount }} Astra{{ 's' if send_amount > 1 else '' }} to astrapay@astranova.org to verify
|
| 209 |
+
</div>
|
| 210 |
+
{% endif %}
|
| 211 |
+
<div class="status {{ 'claimed' if claimed else ('verified' if verified else 'pending') }}">
|
| 212 |
+
{% if claimed %}
|
| 213 |
+
Claimed
|
| 214 |
+
{% elif verified %}
|
| 215 |
+
Verified - Ready to Claim
|
| 216 |
+
{% else %}
|
| 217 |
+
Pending Verification
|
| 218 |
+
{% endif %}
|
| 219 |
+
</div>
|
| 220 |
+
|
| 221 |
+
{% if not claimed %}
|
| 222 |
+
{% if verified %}
|
| 223 |
+
<button class="claim-button" onclick="openClaimModal()" style="margin-top: 1rem; display: flex; align-items: center; gap: 0.5rem; justify-content: center;">
|
| 224 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 225 |
+
<polyline points="20 6 9 17 4 12"></polyline>
|
| 226 |
+
</svg>
|
| 227 |
+
Claim {{ claim_amount }} Astra{{ 's' if claim_amount > 1 else '' }}
|
| 228 |
+
</button>
|
| 229 |
+
{% else %}
|
| 230 |
+
<div class="info-text" style="margin-top: 1rem;">Waiting for payment verification...</div>
|
| 231 |
+
{% endif %}
|
| 232 |
+
{% else %}
|
| 233 |
+
<div class="success-message" style="margin-top: 1rem;">✓ Claimed{% if claimer_email %} by {{ claimer_email }}{% endif %}</div>
|
| 234 |
+
{% endif %}
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
<a href="/" class="back-link">← Back to AstraPay</a>
|
| 238 |
+
</div>
|
| 239 |
+
|
| 240 |
+
<div id="claimModal" class="claim-modal">
|
| 241 |
+
<div class="claim-modal-content">
|
| 242 |
+
<div class="claim-modal-title">Claim Astras</div>
|
| 243 |
+
<div style="color: #cccccc; margin-bottom: 1.5rem;">
|
| 244 |
+
Enter your AstraNova email to receive {{ claim_amount }} Astra{{ 's' if claim_amount > 1 else '' }}
|
| 245 |
+
</div>
|
| 246 |
+
<input type="email" id="claimer-email" class="form-input" placeholder="Enter your AstraNova email" required>
|
| 247 |
+
<div class="claim-modal-buttons">
|
| 248 |
+
<button class="btn-secondary" onclick="closeClaimModal()" style="display: flex; align-items: center; gap: 0.5rem;">
|
| 249 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 250 |
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
| 251 |
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
| 252 |
+
</svg>
|
| 253 |
+
Cancel
|
| 254 |
+
</button>
|
| 255 |
+
<button class="claim-button" onclick="processClaim()" style="display: flex; align-items: center; gap: 0.5rem;">
|
| 256 |
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 257 |
+
<polyline points="20 6 9 17 4 12"></polyline>
|
| 258 |
+
</svg>
|
| 259 |
+
Claim
|
| 260 |
+
</button>
|
| 261 |
+
</div>
|
| 262 |
+
</div>
|
| 263 |
+
</div>
|
| 264 |
+
|
| 265 |
+
<script>
|
| 266 |
+
let verificationInterval;
|
| 267 |
+
|
| 268 |
+
{% if not verified and not claimed %}
|
| 269 |
+
function startVerificationCheck() {
|
| 270 |
+
verificationInterval = setInterval(async () => {
|
| 271 |
+
try {
|
| 272 |
+
const response = await fetch('/check-claim-verification/{{ claim_id }}');
|
| 273 |
+
const data = await response.json();
|
| 274 |
+
|
| 275 |
+
if (data.verified) {
|
| 276 |
+
stopVerificationCheck();
|
| 277 |
+
location.reload();
|
| 278 |
+
}
|
| 279 |
+
} catch (error) {
|
| 280 |
+
console.log('Error checking verification:', error);
|
| 281 |
+
}
|
| 282 |
+
}, 2000);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
function stopVerificationCheck() {
|
| 286 |
+
if (verificationInterval) {
|
| 287 |
+
clearInterval(verificationInterval);
|
| 288 |
+
verificationInterval = null;
|
| 289 |
+
}
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
startVerificationCheck();
|
| 293 |
+
|
| 294 |
+
window.onbeforeunload = function() {
|
| 295 |
+
stopVerificationCheck();
|
| 296 |
+
};
|
| 297 |
+
{% endif %}
|
| 298 |
+
|
| 299 |
+
function openClaimModal() {
|
| 300 |
+
document.getElementById('claimModal').style.display = 'block';
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
function closeClaimModal() {
|
| 304 |
+
document.getElementById('claimModal').style.display = 'none';
|
| 305 |
+
document.getElementById('claimer-email').value = '';
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
async function processClaim() {
|
| 309 |
+
const email = document.getElementById('claimer-email').value.trim();
|
| 310 |
+
|
| 311 |
+
if (!email) {
|
| 312 |
+
alert('Please enter your email address');
|
| 313 |
+
return;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
const claimButton = document.querySelector('#claimModal .claim-button');
|
| 317 |
+
claimButton.disabled = true;
|
| 318 |
+
claimButton.textContent = 'Claiming...';
|
| 319 |
+
|
| 320 |
+
try {
|
| 321 |
+
const response = await fetch('/claim/{{ claim_id }}', {
|
| 322 |
+
method: 'POST',
|
| 323 |
+
headers: {
|
| 324 |
+
'Content-Type': 'application/json',
|
| 325 |
+
},
|
| 326 |
+
body: JSON.stringify({
|
| 327 |
+
email: email
|
| 328 |
+
})
|
| 329 |
+
});
|
| 330 |
+
|
| 331 |
+
const data = await response.json();
|
| 332 |
+
|
| 333 |
+
if (response.ok) {
|
| 334 |
+
document.querySelector('.claim-modal-content').innerHTML = `
|
| 335 |
+
<div class="claim-modal-title">Claim Successful!</div>
|
| 336 |
+
<div class="success-message" style="margin-top: 1rem;">
|
| 337 |
+
${data.message}
|
| 338 |
+
</div>
|
| 339 |
+
`;
|
| 340 |
+
setTimeout(() => {
|
| 341 |
+
location.reload();
|
| 342 |
+
}, 2000);
|
| 343 |
+
} else {
|
| 344 |
+
alert('Claim failed: ' + data.error);
|
| 345 |
+
claimButton.disabled = false;
|
| 346 |
+
claimButton.textContent = 'Claim';
|
| 347 |
+
}
|
| 348 |
+
} catch (error) {
|
| 349 |
+
alert('Claim failed: ' + error.message);
|
| 350 |
+
claimButton.disabled = false;
|
| 351 |
+
claimButton.textContent = 'Claim';
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
window.onclick = function(event) {
|
| 356 |
+
const modal = document.getElementById('claimModal');
|
| 357 |
+
if (event.target == modal) {
|
| 358 |
+
closeClaimModal();
|
| 359 |
+
}
|
| 360 |
+
}
|
| 361 |
+
</script>
|
| 362 |
+
</div>
|
| 363 |
+
</body>
|
| 364 |
+
</html>
|
| 365 |
+
|