-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0xEth.html
More file actions
55 lines (50 loc) · 2.77 KB
/
0xEth.html
File metadata and controls
55 lines (50 loc) · 2.77 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
<!DOCTYPE html><html lang="en" class="bg-gray-950 text-white">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZetaX Faucet</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="font-sans">
<div class="w-full py-4 px-6 bg-black shadow-md flex justify-between items-center">
<h1 class="text-2xl font-bold text-green-400">ZetaX Faucet</h1>
</div> <div class="max-w-lg mx-auto p-6">
<h2 class="text-lg font-semibold mb-4">Request Testnet Coins</h2>
<div class="space-y-4">
<select id="chain" class="w-full p-2 rounded bg-gray-800 text-white">
<option value="solana">Solana</option>
<option value="bsc">Binance Smart Chain</option>
</select>
<input id="wallet" type="text" placeholder="Enter Wallet Address" class="w-full p-2 rounded bg-gray-800 text-white">
<button onclick="sendCoins()" class="bg-blue-600 px-4 py-2 rounded hover:bg-blue-700 w-full">Request</button>
</div><div id="result" class="mt-6 text-sm bg-gray-800 p-4 rounded hidden">
<div><strong>Chain:</strong> <span id="resChain"></span></div>
<div><strong>Wallet:</strong> <span id="resWallet"></span></div>
<div><strong>TxID:</strong> <span id="resTx"></span></div>
<div><strong>Date:</strong> <span id="resDate"></span></div>
<div><strong>Explorer:</strong> <a id="resExplorer" href="#" class="text-blue-400" target="_blank">View Tx</a></div>
</div>
</div> <!-- Toast --> <div id="toast" class="fixed bottom-4 right-4 bg-green-700 text-white px-4 py-2 rounded shadow-lg opacity-0 transition-opacity duration-300"></div> <script>
function showToast(msg) {
const toast = document.getElementById('toast');
toast.textContent = msg;
toast.classList.remove('opacity-0');
toast.classList.add('opacity-100');
setTimeout(() => toast.classList.replace('opacity-100', 'opacity-0'), 3000);
}
function sendCoins() {
const chain = document.getElementById('chain').value;
const wallet = document.getElementById('wallet').value.trim();
if (!wallet) return showToast("Enter a valid wallet address.");
const tx = Math.random().toString(36).substring(2, 15);
const date = new Date().toLocaleString();
document.getElementById('resChain').innerText = chain.toUpperCase();
document.getElementById('resWallet').innerText = wallet;
document.getElementById('resTx').innerText = tx;
document.getElementById('resDate').innerText = date;
document.getElementById('resExplorer').href = `https://${chain}.testnet.explorer/tx/${tx}`;
document.getElementById('result').classList.remove('hidden');
showToast("Coins sent to wallet!");
}
</script></body>
</html>