Spaces:
Running
Running
Turn this into a online crypto wallet platform, where users can log in with the username= 'User' and password= 'Password'. Once logged in, a dashboard appears with a balance of $470.000 in Bitcoin and the options to deposit, withdraw. The deposit leads to a deposit page with a placeholder bitcoin address and instructions. The withdrawal button leads to a withdraw page with the amount to be withdrawn, and recipient bitcoin address.
4ed6779 verified Download withdraw.html from Grego322/bitvault-pro: direct link, hf CLI and curl.
- Browser
- Download file 13.6 kB
-
https://huggingface.co/spaces/Grego322/bitvault-pro/resolve/main/withdraw.html
- Command line
-
hf download hf://spaces/Grego322/bitvault-pro/withdraw.html
-
curl -L -o withdraw.html https://huggingface.co/spaces/Grego322/bitvault-pro/resolve/main/withdraw.html
13.6 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Withdraw - BitVault Pro</title> | |
| <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>π</text></svg>"> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| </head> | |
| <body class="bg-slate-950 text-slate-100 min-h-screen"> | |
| <!-- Dashboard Navigation --> | |
| <dashboard-nav></dashboard-nav> | |
| <!-- Main Content --> | |
| <main class="pt-24 pb-12 px-4 sm:px-6 lg:px-8 max-w-2xl mx-auto"> | |
| <!-- Back Link --> | |
| <a href="index.html#dashboard" class="inline-flex items-center gap-2 text-slate-400 hover:text-violet-400 transition-colors mb-6"> | |
| <i data-feather="arrow-left" class="w-4 h-4"></i> | |
| Back to Dashboard | |
| </a> | |
| <!-- Withdraw Card --> | |
| <div class="bg-slate-900/80 backdrop-blur-xl rounded-2xl border border-slate-800 p-8"> | |
| <div class="text-center mb-8"> | |
| <div class="w-20 h-20 rounded-full bg-violet-500/20 flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="arrow-up-right" class="w-10 h-10 text-violet-400"></i> | |
| </div> | |
| <h1 class="text-3xl font-bold mb-2">Withdraw Bitcoin</h1> | |
| <p class="text-slate-400">Send BTC to an external wallet address</p> | |
| </div> | |
| <!-- Balance Info --> | |
| <div class="p-4 rounded-xl bg-slate-800/50 mb-6 text-center"> | |
| <div class="text-sm text-slate-400 mb-1">Available Balance</div> | |
| <div class="text-2xl font-bold text-emerald-400">7.0246 BTC</div> | |
| <div class="text-sm text-slate-500">β $470,000.00</div> | |
| </div> | |
| <!-- Withdraw Form --> | |
| <form id="withdraw-form" class="space-y-6"> | |
| <!-- Amount --> | |
| <div> | |
| <label class="block text-sm font-medium text-slate-300 mb-2">Amount (BTC)</label> | |
| <div class="relative"> | |
| <input type="number" id="withdraw-amount" step="0.00000001" max="7.0246" class="w-full px-4 py-4 bg-slate-800 border border-slate-700 rounded-xl focus:outline-none focus:border-violet-500 focus:ring-1 focus:ring-violet-500 transition-colors text-lg" placeholder="0.00000000"> | |
| <button type="button" onclick="setMaxAmount()" class="absolute right-4 top-1/2 -translate-y-1/2 text-sm font-semibold text-violet-400 hover:text-violet-300">MAX</button> | |
| </div> | |
| <div class="mt-2 text-sm text-slate-500">Maximum: 7.0246 BTC</div> | |
| </div> | |
| <!-- Recipient Address --> | |
| <div> | |
| <label class="block text-sm font-medium text-slate-300 mb-2">Recipient Bitcoin Address</label> | |
| <input type="text" id="withdraw-address" class="w-full px-4 py-4 bg-slate-800 border border-slate-700 rounded-xl focus:outline-none focus:border-violet-500 focus:ring-1 focus:ring-violet-500 transition-colors font-mono" placeholder="bc1q... or 1... or 3..."> | |
| </div> | |
| <!-- Network Fee --> | |
| <div class="p-4 rounded-xl bg-slate-800/50"> | |
| <div class="flex items-center justify-between text-sm mb-2"> | |
| <span class="text-slate-400">Network Fee</span> | |
| <span class="text-slate-300">0.0001 BTC (~$6.50)</span> | |
| </div> | |
| <div class="flex items-center justify-between"> | |
| <span class="text-slate-400">You will receive</span> | |
| <span class="font-bold text-lg" id="receive-amount">0.0000 BTC</span> | |
| </div> | |
| </div> | |
| <!-- Security Notice --> | |
| <div class="p-4 rounded-xl bg-amber-500/10 border border-amber-500/20"> | |
| <div class="flex items-start gap-3"> | |
| <i data-feather="shield" class="w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"></i> | |
| <div class="text-sm text-amber-200"> | |
| <strong>Security Check:</strong> Please verify the recipient address carefully. Bitcoin transactions cannot be reversed once confirmed. | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Submit Button --> | |
| <button type="submit" class="w-full py-4 bg-gradient-to-r from-violet-500 to-violet-600 hover:from-violet-400 hover:to-violet-500 rounded-xl font-semibold transition-all duration-300 shadow-lg shadow-violet-500/25 flex items-center justify-center gap-2"> | |
| <i data-feather="send" class="w-5 h-5"></i> | |
| Continue Withdrawal | |
| </button> | |
| </form> | |
| </div> | |
| <!-- Recent Withdrawals --> | |
| <div class="mt-8 bg-slate-900/80 backdrop-blur-xl rounded-2xl border border-slate-800 p-6"> | |
| <h2 class="text-lg font-semibold mb-4">Recent Withdrawals</h2> | |
| <div class="space-y-3"> | |
| <div class="flex items-center justify-between p-4 rounded-xl bg-slate-800/50"> | |
| <div class="flex items-center gap-3"> | |
| <div class="w-10 h-10 rounded-full bg-violet-500/20 flex items-center justify-center"> | |
| <i data-feather="arrow-up-right" class="w-5 h-5 text-violet-400"></i> | |
| </div> | |
| <div> | |
| <div class="font-medium">Withdrawal Sent</div> | |
| <div class="text-sm text-slate-500">Dec 15, 2024</div> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <div class="font-semibold text-violet-400">-0.5 BTC</div> | |
| <div class="text-sm text-emerald-400">Completed</div> | |
| </div> | |
| </div> | |
| <div class="flex items-center justify-between p-4 rounded-xl bg-slate-800/50"> | |
| <div class="flex items-center gap-3"> | |
| <div class="w-10 h-10 rounded-full bg-violet-500/20 flex items-center justify-center"> | |
| <i data-feather="arrow-up-right" class="w-5 h-5 text-violet-400"></i> | |
| </div> | |
| <div> | |
| <div class="font-medium">Withdrawal Sent</div> | |
| <div class="text-sm text-slate-500">Dec 10, 2024</div> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <div class="font-semibold text-violet-400">-1.2 BTC</div> | |
| <div class="text-sm text-emerald-400">Completed</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Confirmation Modal --> | |
| <div id="confirm-modal" class="fixed inset-0 z-50 hidden"> | |
| <div class="absolute inset-0 bg-slate-950/80 backdrop-blur-sm"></div> | |
| <div class="relative flex items-center justify-center min-h-screen p-4"> | |
| <div class="w-full max-w-md bg-slate-900 rounded-2xl border border-slate-800 p-8 shadow-2xl"> | |
| <div class="text-center mb-6"> | |
| <div class="w-16 h-16 rounded-full bg-amber-500/20 flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="alert-triangle" class="w-8 h-8 text-amber-400"></i> | |
| </div> | |
| <h2 class="text-2xl font-bold">Confirm Withdrawal</h2> | |
| <p class="text-slate-400">Please review the details carefully</p> | |
| </div> | |
| <div class="space-y-4 mb-6"> | |
| <div class="flex items-center justify-between p-3 rounded-lg bg-slate-800/50"> | |
| <span class="text-slate-400">Amount</span> | |
| <span class="font-semibold" id="confirm-amount">-</span> | |
| </div> | |
| <div class="flex items-center justify-between p-3 rounded-lg bg-slate-800/50"> | |
| <span class="text-slate-400">Network Fee</span> | |
| <span class="font-semibold">0.0001 BTC</span> | |
| </div> | |
| <div class="flex items-center justify-between p-3 rounded-lg bg-slate-800/50"> | |
| <span class="text-slate-400">Total Deduction</span> | |
| <span class="font-semibold text-violet-400" id="confirm-total">-</span> | |
| </div> | |
| <div class="p-3 rounded-lg bg-slate-800/50"> | |
| <div class="text-sm text-slate-400 mb-1">Recipient Address</div> | |
| <div class="font-mono text-sm break-all" id="confirm-address">-</div> | |
| </div> | |
| </div> | |
| <div class="flex gap-3"> | |
| <button onclick="closeConfirmModal()" class="flex-1 py-3 bg-slate-700 hover:bg-slate-600 rounded-xl font-semibold transition-colors"> | |
| Cancel | |
| </button> | |
| <button onclick="processWithdrawal()" class="flex-1 py-3 bg-gradient-to-r from-violet-500 to-violet-600 hover:from-violet-400 hover:to-violet-500 rounded-xl font-semibold transition-all"> | |
| Confirm & Send | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Success Modal --> | |
| <div id="success-modal" class="fixed inset-0 z-50 hidden"> | |
| <div class="absolute inset-0 bg-slate-950/80 backdrop-blur-sm"></div> | |
| <div class="relative flex items-center justify-center min-h-screen p-4"> | |
| <div class="w-full max-w-md bg-slate-900 rounded-2xl border border-slate-800 p-8 shadow-2xl text-center"> | |
| <div class="w-20 h-20 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="check-circle" class="w-10 h-10 text-emerald-400"></i> | |
| </div> | |
| <h2 class="text-2xl font-bold mb-2">Withdrawal Initiated</h2> | |
| <p class="text-slate-400 mb-6">Your transaction has been submitted and is being processed.</p> | |
| <div class="p-4 rounded-xl bg-slate-800/50 mb-6"> | |
| <div class="text-sm text-slate-400 mb-1">Transaction ID</div> | |
| <div class="font-mono text-sm text-emerald-400">txid_8f2a9b4c7d1e5f3a6b8c2d4e7f9a1b3c</div> | |
| </div> | |
| <button onclick="closeSuccessModal()" class="w-full py-3 bg-emerald-500 hover:bg-emerald-400 rounded-xl font-semibold transition-colors"> | |
| Back to Dashboard | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="components/dashboard-nav.js"></script> | |
| <script> | |
| feather.replace(); | |
| const btcBalance = 7.0246; | |
| const networkFee = 0.0001; | |
| // Check login status | |
| if (!sessionStorage.getItem('isLoggedIn')) { | |
| window.location.href = 'index.html'; | |
| } | |
| // Amount input handler | |
| document.getElementById('withdraw-amount').addEventListener('input', updateReceiveAmount); | |
| function updateReceiveAmount() { | |
| const amount = parseFloat(document.getElementById('withdraw-amount').value) || 0; | |
| const receive = Math.max(0, amount - networkFee); | |
| document.getElementById('receive-amount').textContent = receive.toFixed(8) + ' BTC'; | |
| } | |
| function setMaxAmount() { | |
| document.getElementById('withdraw-amount').value = btcBalance.toFixed(8); | |
| updateReceiveAmount(); | |
| } | |
| // Form submission | |
| document.getElementById('withdraw-form').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const amount = parseFloat(document.getElementById('withdraw-amount').value); | |
| const address = document.getElementById('withdraw-address').value.trim(); | |
| if (!amount || amount <= 0 || amount > btcBalance) { | |
| alert('Please enter a valid amount'); | |
| return; | |
| } | |
| if (!address || address.length < 10) { | |
| alert('Please enter a valid Bitcoin address'); | |
| return; | |
| } | |
| // Show confirmation modal | |
| document.getElementById('confirm-amount').textContent = amount.toFixed(8) + ' BTC'; | |
| document.getElementById('confirm-total').textContent = (amount + networkFee).toFixed(8) + ' BTC'; | |
| document.getElementById('confirm-address').textContent = address; | |
| document.getElementById('confirm-modal').classList.remove('hidden'); | |
| }); | |
| function closeConfirmModal() { | |
| document.getElementById('confirm-modal').classList.add('hidden'); | |
| } | |
| function processWithdrawal() { | |
| closeConfirmModal(); | |
| document.getElementById('success-modal').classList.remove('hidden'); | |
| } | |
| function closeSuccessModal() { | |
| document.getElementById('success-modal').classList.add('hidden'); | |
| window.location.href = 'index.html#dashboard'; | |
| } | |
| </script> | |
| </body> | |
| </html> |