-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredeem.html
More file actions
448 lines (377 loc) · 17.7 KB
/
Copy pathredeem.html
File metadata and controls
448 lines (377 loc) · 17.7 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3KX9VK5CCH"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-3KX9VK5CCH');
</script>
<!-- JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Giddy Key Redemption",
"url": "https://www.ofidcrypt.com/redeem.html",
"description": "Redeem your Kinnected payment links instantly into your Solana wallet.",
"applicationCategory": "FinanceApplication"
}
</script>
<title>Giddy Key | Redemption</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="description"
content="Redeem your Kinnected payment links instantly into your Solana wallet with Giddy Key.">
<meta name="keywords" content="redemption, Kinnected, Giddy Key, Solana, $GIDDY, $eXPB">
<!-- Open Graph -->
<meta property="og:title" content="Giddy Key | Redemption">
<meta property="og:image" content="https://www.ofidcrypt.com/assets/images/webp/giddy-key-logo.webp">
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<!-- Stylesheets -->
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<!-- Tailwind -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = { corePlugins: { preflight: false } };
</script>
<style>
body {
background: linear-gradient(to bottom, #1e0533, #000000);
color: white;
}
.card {
background-color: var(--card-bg-color, rgba(30, 5, 51, 0.95));
border: 1px solid #6b21a8;
border-radius: 1.5rem;
}
.input-field {
background: rgba(0, 0, 0, 0.3);
border: 1px solid #6b21a8;
color: var(--text-color);
border-radius: 12px;
padding: 14px;
width: 100%;
font-size: 1rem;
}
.input-field:focus {
outline: none;
border-color: #a855f7;
box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3);
}
button {
background: linear-gradient(to right, #9333ea, #ec4899);
color: white;
font-weight: bold;
font-size: 2.25rem;
padding: 16px;
margin-bottom: 0;
transition: all 0.3s;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgb(168 85 247);
}
#result {
margin-top: 24px;
padding: 20px;
border-radius: 1rem;
font-size: 14px;
white-space: pre-wrap;
word-break: break-all;
max-height: 400px;
overflow-y: auto;
}
.success {
background: #052e16;
border: 1px solid #4ade80;
color: #4ade80;
}
.error {
background: #450a0a;
border: 1px solid #f87171;
color: #f87171;
}
.back-btn {
color: #ffffff;
font-size: 2.25rem;
padding: 0 12px;
}
/* Modal Styles */
.modal {
display: none !important;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.75);
align-items: center;
justify-content: center;
z-index: 9999;
}
.modal.show {
display: flex !important;
}
</style>
</head>
<body>
<!-- ANTI-FLICKER SCRIPT - Put this as high as possible -->
<script>
(function () {
// Apply dark mode BEFORE the page paints
if (localStorage.getItem('dark-mode') === 'true') {
document.documentElement.classList.add('dark-mode');
document.body.classList.add('dark-mode');
}
})();
</script>
<!-- Content Container -->
<div id="wrapper">
<!-- Background Layer - Restored -->
<div class="bg fixed"></div>
<!-- Header -->
<header class="header-subpage">
<a href="/wallet.html">
<img src="/assets/images/webp/giddy-key-logo-2.webp" alt="Giddy Key Logo" class="logo">
</a>
</header>
<a href="#darkModePanel" id="darkModeToggle" class="alt">
<i class="fas fa-sun"></i>
</a>
<nav id="nav">
<ul class="links">
<li style="text-align: center; margin-bottom: 20px; display: block;">
<style>
@media (min-width: 768px) {
.mobile-browse-only {
display: none !important;
}
}
</style>
<a href="/index.html" class="mobile-browse-only"
style="display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 400; color: #a855f7; text-decoration: none;">
<i class="fas fa-globe"></i> Browse OFiDCrypt.com
</a>
</li>
<li><a href="index.html">Home</a></li>
<li><a href="ofidtales.html">Giddy's TV & Toys</a></li>
<li><a href="explore.html">More Apps</a></li>
<li><a href="bouncyball.html">Tokens</a></li>
<li><a href="/pages/about.html">About Us</a></li>
</ul>
<ul class="icons top-icons">
<li class="top-toggle">
<a href="#" aria-label="Dark-Light Desktop Toggle Button">
<img src="/assets/images/darklight-toggle01.svg" alt="Dark-Light Desktop Toggle Button"
class="custom-site-icon">
</a>
</li>
<li class="top-hvr">
<a href="https://www.ofidcrypt.ca" aria-label="Hvr">
<img src="/assets/images/hvr-logo01.svg" alt="Hvr Logo" class="custom-site-icon">
</a>
</li>
</ul>
<ul class="icons">
<li><a href="https://x.com/OFiDCrypt" class="icon brands fa-x-twitter"><span class="label">X</span></a>
</li>
<li><a href="https://youtube.com/@OFiDCrypt" class="icon brands fa-youtube"><span
class="label">YouTube</span></a></li>
<li><a href="https://www.tiktok.com/@Giddys_CA" class="icon brands alt fa-tiktok"><span
class="label">TikTok</span></a></li>
<li><a href="https://www.facebook.com/OFiDCrypt" class="icon brands alt fa-facebook-f"><span
class="label">Facebook</span></a></li>
<li><a href="https://linkedin.com/company/OFiDCrypt" class="icon brands alt fa-linkedin"><span
class="label">LinkedIn</span></a></li>
</ul>
<ul class="footer-links">
<li class="footer-info-link">
<a href="/pages/about.html#copyright">Docs | News & PR | Partners | Privacy</a>
</li>
</ul>
</nav>
<div id="main">
<!-- Top Bar -->
<div
class="relative flex items-center justify-between px-6 pt-5 pb-4 border-b border-purple-700 bg-gradient-to-r from-purple-950 to-black min-h-[68px]">
<div class="flex items-center gap-4 z-10">
<button onclick="history.back()" class="back-btn flex items-center justify-center !mb-0">
<i class="fas fa-arrow-left"></i>
</button>
</div>
<h1 class="text-3xl font-bold tracking-tight text-white text-center flex-1 px-4 !mb-0">
CASH LINKS
</h1>
<div class="flex items-center gap-5 z-10">
<i
class="fa-solid fa-bell text-2xl text-white/80 hover:text-white cursor-pointer transition-colors hidden md:block"></i>
<i id="navPanelTrigger"
class="fa-solid fa-bars text-2xl text-white/80 hover:text-white cursor-pointer transition-colors md:hidden"></i>
<div onclick="showProfile()"
class="w-10 h-10 bg-purple-300 rounded-full flex items-center justify-center cursor-pointer hover:bg-purple-200 transition-colors overflow-hidden">
<img src="/assets/images/webp/ofidcrypt-digitized-logo.webp" alt="OFIDCrypt Logo"
class="w-full h-full object-cover" />
</div>
</div>
</div>
<div class="px-6 pb-20 md:pb-20">
<!-- Redemption Card -->
<div class="card p-8 mt-8">
<h2 class="text-3xl font-black tracking-tighter text-center mb-12">REDEEM CODE</h2>
<label class="block text-sm font-semibold text-purple-300 mb-3">PAYMENT LINK ID</label>
<input type="text" id="linkId" placeholder="Paste your 13-digit link ID here"
class="input-field text-center rounded-xl"
style="color: var(--text-color) !important; border-radius: 12px !important;">
<label class="block text-sm font-semibold text-purple-300 mb-3 mt-6">DESTINATION WALLET</label>
<input type="text" id="wallet" placeholder="Paste your Solana wallet address"
class="input-field text-center rounded-xl"
style="color: var(--text-color) !important; border-radius: 12px !important;">
<button id="btn" onclick="redeem()" class="w-full py-4 text-center font-bold text-lg mt-8"
style="height: auto !important; line-height: 1.4 !important; min-height: 56px !important;">
REDEEM
</button>
<div id="result" class="hidden mt-8 mb-24"></div>
</div>
<p class="text-center text-zinc-400 text-sm mt-8">
Powered by
<a href="https://kinnected-links.com" class="status-link"
style="text-decoration: none; font-weight: 600; color: inherit;">
Kinnected</a>
• Secure • Instant
</p>
</div>
</div>
</div> <!-- End of wrapper -->
<!-- Bottom Nav -->
<nav class="bottom-nav">
<div class="nav-item" onclick="window.location.href='https://docs.ofidcrypt.com'">
<i class="fas fa-question-circle"></i>
<span>Ask Giddy</span>
</div>
<div class="nav-item" onclick="window.location.href='/shop.html'"><i class="fas fa-shopping-bag"></i>Shop
</div>
<div class="nav-item" onclick="window.location.href='/game/app-play.html'"><i class="fas fa-gamepad"></i>Play
Blinko!</div>
<div class="nav-item" onclick="window.location.href='/wallet.html'"><i class="fas fa-wallet"></i>Wallet
</div>
<div class="nav-item" onclick="window.location.href='/cashlinks.html'"><i class="fas fa-circle-notch"></i>Wheel
</div>
</nav>
<!-- REDEEM SUCCESS MODAL -->
<div id="redeem-success-modal" class="modal">
<div class="modal-content" style="width: 360px; max-width: 92vw; padding: 24px 20px; text-align: center; background: var(--card-bg-color, rgba(30, 5, 51, 0.98)); border-radius: 1.5rem;">
<div class="text-5xl mb-4">✅</div>
<h2 class="text-2xl font-bold tracking-tight mb-2" style="color: var(--text-color);">Redemption Successful!</h2>
<div id="redeem-result-details" class="text-left rounded-2xl p-5 mb-6 space-y-3 text-sm border border-purple-500/30 shadow-md"
style="background: var(--card-bg-color, #1a0f2e);">
</div>
<div class="border border-purple-500/40 hover:border-purple-400/60 rounded-2xl p-4 mb-6 transition-all shadow-md hover:shadow-lg">
<a id="redeem-solscan-link" href="#" target="_blank"
class="no-style-link text-emerald-400 hover:text-emerald-300 flex items-center gap-2 justify-center font-medium">
<i class="fas fa-external-link-alt"></i>
View Transaction on Solscan
</a>
</div>
<button onclick="closeRedeemSuccessModal()"
class="confirm-btn w-full py-4 text-2xl font-black tracking-tight rounded-3xl text-white shadow-xl transition-all active:scale-[0.97] flex items-center justify-center"
style="background: linear-gradient(to right, #9333ea, #ec4899); min-height: 68px;">
Close
</button>
</div>
</div>
<script>
async function redeem() {
const linkId = document.getElementById("linkId").value.trim();
const destinationWallet = document.getElementById("wallet").value.trim();
const btn = document.getElementById("btn");
const result = document.getElementById("result");
if (!linkId || !destinationWallet) {
showResult("⚠️ Please fill in both fields.", false);
return;
}
btn.disabled = true;
btn.innerHTML = `<i class="fas fa-spinner fa-spin"></i> Redeeming...`;
result.style.display = "none";
try {
const possibleUrls = [
"https://giddy-key-swaps-production.up.railway.app/api/secure-redeem",
"http://127.0.0.1:5000/api/secure-redeem",
"http://localhost:5000/api/secure-redeem"
];
let data;
let lastError;
for (const url of possibleUrls) {
try {
console.log("🔄 Trying backend:", url);
const response = await fetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ linkId, destinationWallet })
});
data = await response.json();
console.log("✅ Success with:", url);
break;
} catch (e) {
lastError = e;
console.log("❌ Failed:", url);
}
}
if (!data) throw lastError || new Error("All backends failed");
showResult(data, data.success);
} catch (err) {
showResult("Network error: " + err.message, false);
}
btn.disabled = false;
btn.textContent = "REDEEM NOW";
}
function showResult(data, success) {
const result = document.getElementById("result");
if (!success) {
// Original simple error message
result.textContent = (typeof data === 'string') ? data : "Redemption failed.";
result.className = "error";
result.style.display = "block";
return;
}
// Success → Show nice modal
const txHash = data.transaction_hash || "";
const shortHash = txHash ? txHash.slice(0, 8) + "..." + txHash.slice(-6) : "";
const solscanLink = txHash ? `https://solscan.io/tx/${txHash}` : "#";
document.getElementById('redeem-result-details').innerHTML = `
<div class="flex justify-between" style="color: var(--text-color);">
<span style="color: var(--text-muted, #a1a1aa);">Amount</span>
<span class="font-bold" style="color: var(--text-color);">${data.amount || "—"} ${data.token_name || ""}</span>
</div>
<div class="flex justify-between" style="color: var(--text-color);">
<span style="color: var(--text-muted, #a1a1aa);">Model</span>
<span class="font-medium" style="color: var(--text-color);">${data.model || "escrow"}</span>
</div>
<div class="flex justify-between items-center" style="color: var(--text-color);">
<span style="color: var(--text-muted, #a1a1aa);">Transaction</span>
<a href="${solscanLink}" target="_blank"
class="font-mono text-emerald-400 hover:text-emerald-300 text-xs break-all"
style="color: var(--accent-color, #4ade80);">
${shortHash || "—"}
</a>
</div>
`;
document.getElementById('redeem-solscan-link').href = solscanLink;
const modal = document.getElementById('redeem-success-modal');
modal.style.display = 'flex';
modal.classList.add('show');
}
function closeRedeemSuccessModal() {
const modal = document.getElementById('redeem-success-modal');
modal.style.display = 'none';
modal.classList.remove('show');
}
</script>
<!-- Scripts -->
<script src="/assets/js/ofid-main.js"></script>
</body>
</html>