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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>Dashboard - Byweo</title>
|
| 7 |
+
<link rel="stylesheet" href="styles.css">
|
| 8 |
+
</head>
|
| 9 |
+
<body>
|
| 10 |
+
<!-- Complete redesign to match Byweo dashboard with sidebar and professional layout -->
|
| 11 |
+
<div class="dashboard-layout">
|
| 12 |
+
<!-- Header -->
|
| 13 |
+
<header class="dashboard-header">
|
| 14 |
+
<div class="header-content">
|
| 15 |
+
<div class="logo">
|
| 16 |
+
<div class="logo-icon">
|
| 17 |
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
|
| 18 |
+
<rect width="32" height="32" rx="8" fill="url(#gradient1)"/>
|
| 19 |
+
<path d="M8 12L16 8L24 12L16 16L8 12Z" fill="white" opacity="0.9"/>
|
| 20 |
+
<path d="M8 16L16 12L24 16L16 20L8 16Z" fill="white" opacity="0.7"/>
|
| 21 |
+
<path d="M8 20L16 16L24 20L16 24L8 20Z" fill="white" opacity="0.5"/>
|
| 22 |
+
<defs>
|
| 23 |
+
<linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="100%">
|
| 24 |
+
<stop offset="0%" style="stop-color:#00D4FF"/>
|
| 25 |
+
<stop offset="100%" style="stop-color:#0099CC"/>
|
| 26 |
+
</linearGradient>
|
| 27 |
+
</defs>
|
| 28 |
+
</svg>
|
| 29 |
+
</div>
|
| 30 |
+
<span class="logo-text">Byweo</span>
|
| 31 |
+
</div>
|
| 32 |
+
<nav class="nav-links">
|
| 33 |
+
<button class="btn-logout" onclick="logout()">Logout</button>
|
| 34 |
+
</nav>
|
| 35 |
+
</div>
|
| 36 |
+
</header>
|
| 37 |
+
|
| 38 |
+
<div class="dashboard-container">
|
| 39 |
+
<!-- Sidebar -->
|
| 40 |
+
<aside class="sidebar">
|
| 41 |
+
<div class="sidebar-item active">
|
| 42 |
+
<span class="sidebar-icon">π</span>
|
| 43 |
+
<span class="sidebar-text">Overview</span>
|
| 44 |
+
</div>
|
| 45 |
+
<div class="sidebar-item">
|
| 46 |
+
<span class="sidebar-icon">π</span>
|
| 47 |
+
<span class="sidebar-text">Convert</span>
|
| 48 |
+
</div>
|
| 49 |
+
<div class="sidebar-item">
|
| 50 |
+
<span class="sidebar-icon">π</span>
|
| 51 |
+
<span class="sidebar-text">Staking</span>
|
| 52 |
+
</div>
|
| 53 |
+
<div class="sidebar-item">
|
| 54 |
+
<span class="sidebar-icon">π</span>
|
| 55 |
+
<span class="sidebar-text">Transactions</span>
|
| 56 |
+
</div>
|
| 57 |
+
<div class="sidebar-item">
|
| 58 |
+
<span class="sidebar-icon">πΈ</span>
|
| 59 |
+
<span class="sidebar-text">Transfer</span>
|
| 60 |
+
</div>
|
| 61 |
+
</aside>
|
| 62 |
+
|
| 63 |
+
<!-- Main Content -->
|
| 64 |
+
<main class="main-content">
|
| 65 |
+
<div class="content-header">
|
| 66 |
+
<h1>Overview</h1>
|
| 67 |
+
<div class="search-box">
|
| 68 |
+
<input type="text" placeholder="Search coin">
|
| 69 |
+
<span class="search-icon">π</span>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<div class="overview-grid">
|
| 74 |
+
<!-- Balance Section -->
|
| 75 |
+
<div class="balance-section">
|
| 76 |
+
<div class="balance-header">
|
| 77 |
+
<span>Total balance</span>
|
| 78 |
+
<div class="balance-actions">
|
| 79 |
+
<button class="btn-action" onclick="showDepositModal()">Deposit</button>
|
| 80 |
+
<button class="btn-action" onclick="showTransferModal()">Transfer</button>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
<div class="balance-amount">
|
| 84 |
+
<span id="btcBalance">0</span>
|
| 85 |
+
<span class="balance-currency">BTC</span>
|
| 86 |
+
</div>
|
| 87 |
+
<div class="balance-usd">$<span id="usdBalance">0.00</span></div>
|
| 88 |
+
|
| 89 |
+
<!-- Account Balances -->
|
| 90 |
+
<div class="account-section">
|
| 91 |
+
<h3>Account Balances</h3>
|
| 92 |
+
<div class="spot-balance">
|
| 93 |
+
<span class="spot-icon">π‘</span>
|
| 94 |
+
<span>Spot</span>
|
| 95 |
+
<div class="spot-amount">
|
| 96 |
+
<span id="spotBalance">0 BTC</span>
|
| 97 |
+
<span class="spot-usd">$0.00</span>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<!-- Asset Balances Table -->
|
| 104 |
+
<div class="assets-section">
|
| 105 |
+
<h3>Asset balances</h3>
|
| 106 |
+
<div class="assets-table">
|
| 107 |
+
<div class="table-header">
|
| 108 |
+
<span>Asset</span>
|
| 109 |
+
<span>Spot balance</span>
|
| 110 |
+
<span>On orders</span>
|
| 111 |
+
<span>Available balance</span>
|
| 112 |
+
<span>Total balance</span>
|
| 113 |
+
</div>
|
| 114 |
+
<div class="table-row">
|
| 115 |
+
<div class="asset-info">
|
| 116 |
+
<div class="asset-icon btc-icon">βΏ</div>
|
| 117 |
+
<div class="asset-details">
|
| 118 |
+
<span class="asset-name">BTC</span>
|
| 119 |
+
<span class="asset-full">Bitcoin</span>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
<span class="balance-cell">
|
| 123 |
+
<span id="btcSpotBalance">0.000000 BTC</span>
|
| 124 |
+
<span class="balance-usd-small">$0.00</span>
|
| 125 |
+
</span>
|
| 126 |
+
<span class="balance-cell">
|
| 127 |
+
<span>0.000000 BTC</span>
|
| 128 |
+
<span class="balance-usd-small">$0.00</span>
|
| 129 |
+
</span>
|
| 130 |
+
<span class="balance-cell">
|
| 131 |
+
<span id="btcAvailableBalance">0.000000 BTC</span>
|
| 132 |
+
<span class="balance-usd-small">$0.00</span>
|
| 133 |
+
</span>
|
| 134 |
+
<span class="balance-cell">
|
| 135 |
+
<span id="btcTotalBalance">0.000000 BTC</span>
|
| 136 |
+
<span class="balance-usd-small">$0.00</span>
|
| 137 |
+
</span>
|
| 138 |
+
</div>
|
| 139 |
+
<div class="table-row">
|
| 140 |
+
<div class="asset-info">
|
| 141 |
+
<div class="asset-icon eth-icon">Ξ</div>
|
| 142 |
+
<div class="asset-details">
|
| 143 |
+
<span class="asset-name">ETH</span>
|
| 144 |
+
<span class="asset-full">Ethereum</span>
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
<span class="balance-cell">
|
| 148 |
+
<span>0.000000 ETH</span>
|
| 149 |
+
<span class="balance-usd-small">$0.00</span>
|
| 150 |
+
</span>
|
| 151 |
+
<span class="balance-cell">
|
| 152 |
+
<span>0.000000 ETH</span>
|
| 153 |
+
<span class="balance-usd-small">$0.00</span>
|
| 154 |
+
</span>
|
| 155 |
+
<span class="balance-cell">
|
| 156 |
+
<span>0.000000 ETH</span>
|
| 157 |
+
<span class="balance-usd-small">$0.00</span>
|
| 158 |
+
</span>
|
| 159 |
+
<span class="balance-cell">
|
| 160 |
+
<span>0.000000 ETH</span>
|
| 161 |
+
<span class="balance-usd-small">$0.00</span>
|
| 162 |
+
</span>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
|
| 168 |
+
<!-- Action Buttons -->
|
| 169 |
+
<div class="action-buttons">
|
| 170 |
+
<button class="btn-deposit" onclick="showDepositModal()">Deposit</button>
|
| 171 |
+
<button class="btn-withdraw" onclick="showWithdrawModal()">Withdraw</button>
|
| 172 |
+
</div>
|
| 173 |
+
|
| 174 |
+
<!-- Promo Code Section -->
|
| 175 |
+
<div class="promo-section">
|
| 176 |
+
<h2>PROMO CODE</h2>
|
| 177 |
+
<p>Use a promo code to increase your balance and rewards</p>
|
| 178 |
+
<div class="promo-form">
|
| 179 |
+
<label>Type promo code below</label>
|
| 180 |
+
<input type="text" id="promoCode" placeholder="YOUR PROMO CODE">
|
| 181 |
+
<button onclick="redeemPromoCode()">ACTIVATE A PROMO CODE</button>
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
</main>
|
| 185 |
+
</div>
|
| 186 |
+
</div>
|
| 187 |
+
|
| 188 |
+
<!-- Modals -->
|
| 189 |
+
<div id="depositModal" class="modal">
|
| 190 |
+
<div class="modal-content">
|
| 191 |
+
<div class="modal-header">
|
| 192 |
+
<h3>Address</h3>
|
| 193 |
+
<span class="close" onclick="closeDepositModal()">×</span>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="deposit-content">
|
| 196 |
+
<div class="wallet-graphic">π³</div>
|
| 197 |
+
<p>Only send BTC to this address. Sending any other asset to this address may result in the loss of your deposit.</p>
|
| 198 |
+
<div class="deposit-warning">Minimum deposit amount: 0.0005 BTC</div>
|
| 199 |
+
<div class="deposit-address">
|
| 200 |
+
<span>bc1qk38zrn42mn4mgg4zcl27gahrlt8797p4yhj36c</span>
|
| 201 |
+
<button onclick="copyAddress()">π</button>
|
| 202 |
+
</div>
|
| 203 |
+
<div class="qr-code">
|
| 204 |
+
<img src="qr.png" alt="Bitcoin Deposit QR Code" class="qr-image" width="150" height="150">
|
| 205 |
+
</div>
|
| 206 |
+
</div>
|
| 207 |
+
<p class="deposit-note">Please be sure that the address is correct to the token that you are depositing.</p>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
|
| 212 |
+
<!-- Multi-Step Withdrawal Modal -->
|
| 213 |
+
<div id="withdrawModal" class="modal">
|
| 214 |
+
<div class="modal-content withdraw-modal">
|
| 215 |
+
<div class="modal-header">
|
| 216 |
+
<h3 id="withdrawModalTitle">Select Withdrawal Method</h3>
|
| 217 |
+
<span class="close" onclick="closeWithdrawModal()">×</span>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<!-- Step 1: Select Wallet Type -->
|
| 221 |
+
<div id="withdrawStep1" class="withdraw-step active">
|
| 222 |
+
<div class="withdraw-content">
|
| 223 |
+
<div class="wallet-graphic">π³</div>
|
| 224 |
+
<p>Choose your preferred withdrawal method</p>
|
| 225 |
+
<div class="payment-methods">
|
| 226 |
+
<div class="payment-method" onclick="selectWalletType('crypto')">
|
| 227 |
+
<span class="payment-icon">βΏ</span>
|
| 228 |
+
<span>Crypto Wallet</span>
|
| 229 |
+
<span class="method-arrow">β</span>
|
| 230 |
+
</div>
|
| 231 |
+
<div class="payment-method" onclick="selectWalletType('card')">
|
| 232 |
+
<span class="payment-icon">π³</span>
|
| 233 |
+
<span>Visa / Mastercard</span>
|
| 234 |
+
<span class="method-arrow">β</span>
|
| 235 |
+
</div>
|
| 236 |
+
<div class="payment-method" onclick="selectWalletType('paypal')">
|
| 237 |
+
<span class="payment-icon">π¦</span>
|
| 238 |
+
<span>PayPal</span>
|
| 239 |
+
<span class="method-arrow">β</span>
|
| 240 |
+
</div>
|
| 241 |
+
<div class="payment-method" onclick="selectWalletType('swift')">
|
| 242 |
+
<span class="payment-icon">π¦</span>
|
| 243 |
+
<span>Swift Transfer</span>
|
| 244 |
+
<span class="method-arrow">β</span>
|
| 245 |
+
</div>
|
| 246 |
+
</div>
|
| 247 |
+
</div>
|
| 248 |
+
</div>
|
| 249 |
+
|
| 250 |
+
<!-- Step 2: Select Coin -->
|
| 251 |
+
<div id="withdrawStep2" class="withdraw-step">
|
| 252 |
+
<div class="withdraw-content">
|
| 253 |
+
<div class="step-back" onclick="goToWithdrawStep(1)">β Back</div>
|
| 254 |
+
<div class="wallet-graphic">πͺ</div>
|
| 255 |
+
<p>Select the cryptocurrency to withdraw</p>
|
| 256 |
+
<div class="coin-selection-grid">
|
| 257 |
+
<div class="coin-option" onclick="selectCoin('BTC')">
|
| 258 |
+
<div class="coin-icon btc-icon">βΏ</div>
|
| 259 |
+
<div class="coin-details">
|
| 260 |
+
<span class="coin-name">Bitcoin</span>
|
| 261 |
+
<span class="coin-symbol">BTC</span>
|
| 262 |
+
<span class="coin-balance" id="btcWithdrawBalance">0.000000 BTC</span>
|
| 263 |
+
</div>
|
| 264 |
+
<span class="method-arrow">β</span>
|
| 265 |
+
</div>
|
| 266 |
+
<div class="coin-option" onclick="selectCoin('ETH')">
|
| 267 |
+
<div class="coin-icon eth-icon">Ξ</div>
|
| 268 |
+
<div class="coin-details">
|
| 269 |
+
<span class="coin-name">Ethereum</span>
|
| 270 |
+
<span class="coin-symbol">ETH</span>
|
| 271 |
+
<span class="coin-balance">0.000000 ETH</span>
|
| 272 |
+
</div>
|
| 273 |
+
<span class="method-arrow">β</span>
|
| 274 |
+
</div>
|
| 275 |
+
</div>
|
| 276 |
+
</div>
|
| 277 |
+
</div>
|
| 278 |
+
|
| 279 |
+
<!-- Step 3: Enter Wallet Address -->
|
| 280 |
+
<div id="withdrawStep3" class="withdraw-step">
|
| 281 |
+
<div class="withdraw-content">
|
| 282 |
+
<div class="step-back" onclick="goToWithdrawStep(2)">β Back</div>
|
| 283 |
+
<div class="wallet-graphic">π</div>
|
| 284 |
+
<h4 id="selectedCoinTitle">BTC WALLET ADDRESS</h4>
|
| 285 |
+
<p>Enter your wallet address to receive the funds</p>
|
| 286 |
+
|
| 287 |
+
<div class="address-input-group">
|
| 288 |
+
<input type="text" id="walletAddress" placeholder="Enter wallet address" required>
|
| 289 |
+
<button type="button" class="btn-scan">π·</button>
|
| 290 |
+
</div>
|
| 291 |
+
|
| 292 |
+
<div class="save-address-option">
|
| 293 |
+
<input type="checkbox" id="saveAddress">
|
| 294 |
+
<label for="saveAddress">Save address for next time</label>
|
| 295 |
+
</div>
|
| 296 |
+
|
| 297 |
+
<div class="network-selection">
|
| 298 |
+
<label>Select Network</label>
|
| 299 |
+
<select id="networkSelect">
|
| 300 |
+
<option value="">Select network...</option>
|
| 301 |
+
<option value="BITCOIN">Bitcoin Network</option>
|
| 302 |
+
<option value="BEP20">BEP20 (BSC)</option>
|
| 303 |
+
<option value="ERC20">ERC20 (Ethereum)</option>
|
| 304 |
+
</select>
|
| 305 |
+
</div>
|
| 306 |
+
|
| 307 |
+
<button class="btn-continue" onclick="goToWithdrawStep(4)">Continue</button>
|
| 308 |
+
</div>
|
| 309 |
+
</div>
|
| 310 |
+
|
| 311 |
+
<!-- Step 4: Enter Amount -->
|
| 312 |
+
<div id="withdrawStep4" class="withdraw-step">
|
| 313 |
+
<div class="withdraw-content scrollable-content">
|
| 314 |
+
<div class="step-back" onclick="goToWithdrawStep(3)">β Back</div>
|
| 315 |
+
<div class="wallet-graphic">π°</div>
|
| 316 |
+
<h4>WITHDRAWAL AMOUNT</h4>
|
| 317 |
+
|
| 318 |
+
<div class="balance-display">
|
| 319 |
+
<div class="balance-item">
|
| 320 |
+
<span class="balance-label">Available balance</span>
|
| 321 |
+
<div class="balance-value">
|
| 322 |
+
<span id="availableWithdrawBalance">1.300000 BTC</span>
|
| 323 |
+
<span class="balance-usd">$56,162.50</span>
|
| 324 |
+
</div>
|
| 325 |
+
</div>
|
| 326 |
+
</div>
|
| 327 |
+
|
| 328 |
+
<div class="amount-input-section">
|
| 329 |
+
<label>AMOUNT TO WITHDRAW</label>
|
| 330 |
+
<div class="amount-input-group">
|
| 331 |
+
<input type="number" id="withdrawAmount" placeholder="0.000000" step="0.000001" min="0">
|
| 332 |
+
<span class="currency-label" id="withdrawCurrency">BTC</span>
|
| 333 |
+
<button type="button" class="btn-max" onclick="setMaxAmount()">Max amount</button>
|
| 334 |
+
</div>
|
| 335 |
+
<div class="amount-usd" id="withdrawAmountUSD">$0.00</div>
|
| 336 |
+
</div>
|
| 337 |
+
|
| 338 |
+
<div class="withdraw-fee-section">
|
| 339 |
+
<h5>WITHDRAW FEE</h5>
|
| 340 |
+
<div class="fee-breakdown">
|
| 341 |
+
<div class="fee-item">
|
| 342 |
+
<span>Network Fee</span>
|
| 343 |
+
<span id="networkFee">0.000050 BTC</span>
|
| 344 |
+
</div>
|
| 345 |
+
<div class="fee-item">
|
| 346 |
+
<span>Service Fee</span>
|
| 347 |
+
<span id="serviceFee">0.000000 BTC</span>
|
| 348 |
+
</div>
|
| 349 |
+
<div class="fee-item total-fee">
|
| 350 |
+
<span>Total Fee</span>
|
| 351 |
+
<span id="totalFee">0.000050 BTC</span>
|
| 352 |
+
</div>
|
| 353 |
+
</div>
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
+
<div class="final-amount">
|
| 357 |
+
<div class="final-item">
|
| 358 |
+
<span>You will receive</span>
|
| 359 |
+
<span id="finalReceiveAmount">0.000000 BTC</span>
|
| 360 |
+
</div>
|
| 361 |
+
</div>
|
| 362 |
+
|
| 363 |
+
<button class="btn-continue" onclick="processWithdraw()">Withdraw</button>
|
| 364 |
+
</div>
|
| 365 |
+
</div>
|
| 366 |
+
</div>
|
| 367 |
+
</div>
|
| 368 |
+
|
| 369 |
+
<!-- Enhanced Activation Modal -->
|
| 370 |
+
<div id="activationModal" class="modal">
|
| 371 |
+
<div class="modal-content activation-modal">
|
| 372 |
+
<div class="activation-header">
|
| 373 |
+
<div class="error-icon">β</div>
|
| 374 |
+
<h3>Activation</h3>
|
| 375 |
+
</div>
|
| 376 |
+
<div class="activation-content">
|
| 377 |
+
<p>To withdraw funds to a third-party address, you need to activate your account. To activate the account, make a minimum deposit of 0.0042000 BTC. The deposit can also be withdrawn after account activation.</p>
|
| 378 |
+
|
| 379 |
+
<div class="deposit-status">
|
| 380 |
+
<span>Your deposit: <span id="currentDeposit">0.000000</span> / 0.0042000 BTC.</span>
|
| 381 |
+
</div>
|
| 382 |
+
|
| 383 |
+
<div class="status-table">
|
| 384 |
+
<div class="status-row">
|
| 385 |
+
<span>Status</span>
|
| 386 |
+
<span>Transaction ID</span>
|
| 387 |
+
</div>
|
| 388 |
+
<div class="status-row">
|
| 389 |
+
<span class="error-status">Error</span>
|
| 390 |
+
<span>not created</span>
|
| 391 |
+
</div>
|
| 392 |
+
</div>
|
| 393 |
+
|
| 394 |
+
<p class="support-text">Contact online support for additional information.</p>
|
| 395 |
+
|
| 396 |
+
<button class="btn-wallet" onclick="closeActivationModal()">Wallet</button>
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
|
| 400 |
+
<!-- Verification Modal -->
|
| 401 |
+
<div id="verificationModal" class="modal">
|
| 402 |
+
<div class="modal-content verification-modal">
|
| 403 |
+
<div class="modal-header">
|
| 404 |
+
<h3>Verify Withdrawal</h3>
|
| 405 |
+
<span class="close" onclick="closeVerificationModal()">×</span>
|
| 406 |
+
</div>
|
| 407 |
+
<div class="verification-content">
|
| 408 |
+
<div class="verify-icon">π</div>
|
| 409 |
+
<h4>Confirm Your Withdrawal</h4>
|
| 410 |
+
<p>Please verify the withdrawal details below:</p>
|
| 411 |
+
|
| 412 |
+
<div class="verification-details">
|
| 413 |
+
<div class="verify-item">
|
| 414 |
+
<span class="verify-label">Amount:</span>
|
| 415 |
+
<span class="verify-value" id="verifyAmount">0.000000 BTC</span>
|
| 416 |
+
</div>
|
| 417 |
+
<div class="verify-item">
|
| 418 |
+
<span class="verify-label">To Address:</span>
|
| 419 |
+
<span class="verify-value verify-address" id="verifyAddress">-</span>
|
| 420 |
+
</div>
|
| 421 |
+
<div class="verify-item">
|
| 422 |
+
<span class="verify-label">Network:</span>
|
| 423 |
+
<span class="verify-value" id="verifyNetwork">-</span>
|
| 424 |
+
</div>
|
| 425 |
+
<div class="verify-item">
|
| 426 |
+
<span class="verify-label">Network Fee:</span>
|
| 427 |
+
<span class="verify-value">0.000050 BTC</span>
|
| 428 |
+
</div>
|
| 429 |
+
</div>
|
| 430 |
+
|
| 431 |
+
<div class="verification-warning">
|
| 432 |
+
<div class="warning-icon">β οΈ</div>
|
| 433 |
+
<p>Please double-check the wallet address. Transactions cannot be reversed once confirmed.</p>
|
| 434 |
+
</div>
|
| 435 |
+
|
| 436 |
+
<div class="verification-actions">
|
| 437 |
+
<button class="btn-cancel" onclick="closeVerificationModal()">Cancel</button>
|
| 438 |
+
<button class="btn-confirm" onclick="confirmWithdrawal()">Confirm Withdrawal</button>
|
| 439 |
+
</div>
|
| 440 |
+
</div>
|
| 441 |
+
</div>
|
| 442 |
+
</div>
|
| 443 |
+
|
| 444 |
+
<!-- Notification -->
|
| 445 |
+
<div id="notification" class="notification" style="z-index: 9999;"></div>
|
| 446 |
+
|
| 447 |
+
<script src="script.js"></script>
|
| 448 |
+
</body>
|
| 449 |
+
</html>
|
index.html
CHANGED
|
@@ -1,19 +1,459 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |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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>Byweo - Crypto Trading Platform</title>
|
| 7 |
+
<style>
|
| 8 |
+
* {
|
| 9 |
+
box-sizing: border-box;
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
body {
|
| 16 |
+
background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
|
| 17 |
+
color: #e0e0e0;
|
| 18 |
+
min-height: 100vh;
|
| 19 |
+
overflow-x: hidden;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
.mobile-container {
|
| 23 |
+
max-width: 100%;
|
| 24 |
+
margin: 0 auto;
|
| 25 |
+
background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
|
| 26 |
+
min-height: 100vh;
|
| 27 |
+
position: relative;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.mobile-header {
|
| 31 |
+
padding: 20px;
|
| 32 |
+
display: flex;
|
| 33 |
+
justify-content: space-between;
|
| 34 |
+
align-items: center;
|
| 35 |
+
background: rgba(15, 20, 25, 0.95);
|
| 36 |
+
backdrop-filter: blur(10px);
|
| 37 |
+
position: sticky;
|
| 38 |
+
top: 0;
|
| 39 |
+
z-index: 100;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.logo {
|
| 43 |
+
display: flex;
|
| 44 |
+
align-items: center;
|
| 45 |
+
gap: 12px;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.logo-icon {
|
| 49 |
+
width: 40px;
|
| 50 |
+
height: 40px;
|
| 51 |
+
background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
|
| 52 |
+
border-radius: 12px;
|
| 53 |
+
display: flex;
|
| 54 |
+
align-items: center;
|
| 55 |
+
justify-content: center;
|
| 56 |
+
font-weight: bold;
|
| 57 |
+
font-size: 20px;
|
| 58 |
+
color: white;
|
| 59 |
+
box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.logo-text {
|
| 63 |
+
font-weight: 700;
|
| 64 |
+
font-size: 24px;
|
| 65 |
+
color: #ffffff;
|
| 66 |
+
letter-spacing: -0.5px;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.header-links {
|
| 70 |
+
display: flex;
|
| 71 |
+
gap: 20px;
|
| 72 |
+
font-size: 14px;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.header-link {
|
| 76 |
+
color: #8892b0;
|
| 77 |
+
text-decoration: none;
|
| 78 |
+
transition: color 0.3s ease;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.header-link:hover {
|
| 82 |
+
color: #00d4ff;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.mobile-main {
|
| 86 |
+
padding: 40px 20px;
|
| 87 |
+
display: flex;
|
| 88 |
+
flex-direction: column;
|
| 89 |
+
align-items: center;
|
| 90 |
+
justify-content: center;
|
| 91 |
+
min-height: calc(100vh - 80px);
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.auth-page {
|
| 95 |
+
display: none;
|
| 96 |
+
width: 100%;
|
| 97 |
+
max-width: 400px;
|
| 98 |
+
margin: 0 auto;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.auth-page.active {
|
| 102 |
+
display: block;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.crypto-visual {
|
| 106 |
+
display: flex;
|
| 107 |
+
justify-content: center;
|
| 108 |
+
margin-bottom: 40px;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.crypto-logo {
|
| 112 |
+
width: 120px;
|
| 113 |
+
height: 120px;
|
| 114 |
+
background: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #f7931a 100%);
|
| 115 |
+
border-radius: 30px;
|
| 116 |
+
display: flex;
|
| 117 |
+
align-items: center;
|
| 118 |
+
justify-content: center;
|
| 119 |
+
position: relative;
|
| 120 |
+
box-shadow: 0 20px 40px rgba(0, 212, 255, 0.3);
|
| 121 |
+
animation: float 3s ease-in-out infinite;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.crypto-logo::before {
|
| 125 |
+
content: 'βΏ';
|
| 126 |
+
font-size: 48px;
|
| 127 |
+
font-weight: bold;
|
| 128 |
+
color: white;
|
| 129 |
+
text-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
@keyframes float {
|
| 133 |
+
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
| 134 |
+
50% { transform: translateY(-10px) rotate(5deg); }
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.auth-form-container {
|
| 138 |
+
background: rgba(26, 31, 46, 0.8);
|
| 139 |
+
border: 1px solid #2d3748;
|
| 140 |
+
border-radius: 20px;
|
| 141 |
+
padding: 32px;
|
| 142 |
+
backdrop-filter: blur(20px);
|
| 143 |
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.auth-header {
|
| 147 |
+
text-align: center;
|
| 148 |
+
margin-bottom: 24px;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
.auth-link {
|
| 152 |
+
color: #8892b0;
|
| 153 |
+
font-size: 14px;
|
| 154 |
+
margin-bottom: 16px;
|
| 155 |
+
display: block;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.link-text {
|
| 159 |
+
color: #00d4ff;
|
| 160 |
+
font-weight: 600;
|
| 161 |
+
text-decoration: none;
|
| 162 |
+
cursor: pointer;
|
| 163 |
+
transition: color 0.3s ease;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.link-text:hover {
|
| 167 |
+
color: #0099cc;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
h2 {
|
| 171 |
+
text-align: center;
|
| 172 |
+
margin-bottom: 32px;
|
| 173 |
+
font-size: 28px;
|
| 174 |
+
font-weight: 700;
|
| 175 |
+
color: #ffffff;
|
| 176 |
+
letter-spacing: -0.5px;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.form-group {
|
| 180 |
+
margin-bottom: 24px;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
label {
|
| 184 |
+
display: block;
|
| 185 |
+
margin-bottom: 8px;
|
| 186 |
+
font-weight: 600;
|
| 187 |
+
font-size: 14px;
|
| 188 |
+
color: #ffffff;
|
| 189 |
+
text-transform: uppercase;
|
| 190 |
+
letter-spacing: 0.5px;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
input[type="email"],
|
| 194 |
+
input[type="password"] {
|
| 195 |
+
width: 100%;
|
| 196 |
+
padding: 16px 20px;
|
| 197 |
+
background: rgba(45, 55, 72, 0.6);
|
| 198 |
+
border: 2px solid #2d3748;
|
| 199 |
+
border-radius: 12px;
|
| 200 |
+
font-size: 16px;
|
| 201 |
+
color: #ffffff;
|
| 202 |
+
transition: all 0.3s ease;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
input:focus {
|
| 206 |
+
border-color: #00d4ff;
|
| 207 |
+
outline: none;
|
| 208 |
+
background: rgba(45, 55, 72, 0.8);
|
| 209 |
+
box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
input::placeholder {
|
| 213 |
+
color: #4a5568;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.password-input {
|
| 217 |
+
position: relative;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.password-toggle {
|
| 221 |
+
position: absolute;
|
| 222 |
+
right: 16px;
|
| 223 |
+
top: 50%;
|
| 224 |
+
transform: translateY(-50%);
|
| 225 |
+
cursor: pointer;
|
| 226 |
+
user-select: none;
|
| 227 |
+
color: #00d4ff;
|
| 228 |
+
font-size: 18px;
|
| 229 |
+
transition: color 0.3s ease;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
.password-toggle:hover {
|
| 233 |
+
color: #0099cc;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
.checkbox-group {
|
| 237 |
+
display: flex;
|
| 238 |
+
align-items: flex-start;
|
| 239 |
+
margin: 24px 0;
|
| 240 |
+
font-size: 14px;
|
| 241 |
+
color: #8892b0;
|
| 242 |
+
line-height: 1.5;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.checkbox-group input {
|
| 246 |
+
margin-right: 12px;
|
| 247 |
+
margin-top: 2px;
|
| 248 |
+
accent-color: #00d4ff;
|
| 249 |
+
width: 18px;
|
| 250 |
+
height: 18px;
|
| 251 |
+
flex-shrink: 0;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
.btn-continue {
|
| 255 |
+
width: 100%;
|
| 256 |
+
padding: 18px;
|
| 257 |
+
background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
|
| 258 |
+
color: #0f1419;
|
| 259 |
+
border: none;
|
| 260 |
+
border-radius: 12px;
|
| 261 |
+
font-weight: 700;
|
| 262 |
+
font-size: 16px;
|
| 263 |
+
cursor: pointer;
|
| 264 |
+
transition: all 0.3s ease;
|
| 265 |
+
text-transform: uppercase;
|
| 266 |
+
letter-spacing: 0.5px;
|
| 267 |
+
box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
.btn-continue:hover {
|
| 271 |
+
transform: translateY(-2px);
|
| 272 |
+
box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
.btn-continue:active {
|
| 276 |
+
transform: translateY(0);
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
.notification {
|
| 280 |
+
position: fixed;
|
| 281 |
+
top: 20px;
|
| 282 |
+
left: 50%;
|
| 283 |
+
transform: translateX(-50%);
|
| 284 |
+
padding: 16px 24px;
|
| 285 |
+
border-radius: 12px;
|
| 286 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
| 287 |
+
display: none;
|
| 288 |
+
z-index: 1000;
|
| 289 |
+
font-weight: 600;
|
| 290 |
+
backdrop-filter: blur(10px);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.notification.success {
|
| 294 |
+
background: rgba(16, 185, 129, 0.9);
|
| 295 |
+
color: white;
|
| 296 |
+
border: 1px solid #10b981;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
.notification.error {
|
| 300 |
+
background: rgba(239, 68, 68, 0.9);
|
| 301 |
+
color: white;
|
| 302 |
+
border: 1px solid #ef4444;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
.notification.show {
|
| 306 |
+
display: block;
|
| 307 |
+
animation: slideIn 0.3s ease;
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
@keyframes slideIn {
|
| 311 |
+
from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
|
| 312 |
+
to { transform: translateX(-50%) translateY(0); opacity: 1; }
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
@media (min-width: 768px) {
|
| 316 |
+
.mobile-container {
|
| 317 |
+
max-width: 500px;
|
| 318 |
+
margin: 20px auto;
|
| 319 |
+
border-radius: 20px;
|
| 320 |
+
box-shadow: 0 20px 60px rgba(0,0,0,0.4);
|
| 321 |
+
min-height: calc(100vh - 40px);
|
| 322 |
+
overflow: hidden;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
.mobile-main {
|
| 326 |
+
padding: 60px 40px;
|
| 327 |
+
}
|
| 328 |
+
}
|
| 329 |
+
</style>
|
| 330 |
+
</head>
|
| 331 |
+
<body>
|
| 332 |
+
<div class="mobile-container">
|
| 333 |
+
<header class="mobile-header">
|
| 334 |
+
<div class="logo">
|
| 335 |
+
<div class="logo-icon">B</div>
|
| 336 |
+
<span class="logo-text">Byweo</span>
|
| 337 |
+
</div>
|
| 338 |
+
<div class="header-links">
|
| 339 |
+
<a href="#" class="header-link">Crypto</a>
|
| 340 |
+
<a href="#" class="header-link">Terms</a>
|
| 341 |
+
<a href="#" class="header-link">Privacy</a>
|
| 342 |
+
</div>
|
| 343 |
+
</header>
|
| 344 |
+
|
| 345 |
+
<main class="mobile-main">
|
| 346 |
+
<!-- Login Page (now active by default) -->
|
| 347 |
+
<div id="loginForm" class="auth-page active">
|
| 348 |
+
<div class="crypto-visual">
|
| 349 |
+
<div class="crypto-logo"></div>
|
| 350 |
+
</div>
|
| 351 |
+
|
| 352 |
+
<div class="auth-form-container">
|
| 353 |
+
<div class="auth-header">
|
| 354 |
+
<span class="auth-link">Don't have an account? <span class="link-text" onclick="switchToRegister()">Sign up</span></span>
|
| 355 |
+
</div>
|
| 356 |
+
<h2>Login</h2>
|
| 357 |
+
<form id="loginFormElement">
|
| 358 |
+
<div class="form-group">
|
| 359 |
+
<label>EMAIL</label>
|
| 360 |
+
<input type="email" id="loginEmail" placeholder="Email address" required>
|
| 361 |
+
</div>
|
| 362 |
+
<div class="form-group">
|
| 363 |
+
<label>PASSWORD</label>
|
| 364 |
+
<div class="password-input">
|
| 365 |
+
<input type="password" id="loginPassword" placeholder="Password" required>
|
| 366 |
+
<span class="password-toggle" onclick="togglePassword('loginPassword')">π</span>
|
| 367 |
+
</div>
|
| 368 |
+
</div>
|
| 369 |
+
<button type="submit" class="btn-continue">Continue</button>
|
| 370 |
+
</form>
|
| 371 |
+
</div>
|
| 372 |
+
</div>
|
| 373 |
+
|
| 374 |
+
<!-- Registration Page -->
|
| 375 |
+
<div id="landingPage" class="auth-page">
|
| 376 |
+
<div class="crypto-visual">
|
| 377 |
+
<div class="crypto-logo"></div>
|
| 378 |
+
</div>
|
| 379 |
+
|
| 380 |
+
<div class="auth-form-container">
|
| 381 |
+
<div class="auth-header">
|
| 382 |
+
<span class="auth-link">Already have an account? <span class="link-text" onclick="switchToLogin()">Login</span></span>
|
| 383 |
+
</div>
|
| 384 |
+
<h2>Sign up</h2>
|
| 385 |
+
<form id="registerFormElement">
|
| 386 |
+
<div class="form-group">
|
| 387 |
+
<label>EMAIL</label>
|
| 388 |
+
<input type="email" id="registerEmail" placeholder="Email address" required>
|
| 389 |
+
</div>
|
| 390 |
+
<div class="form-group">
|
| 391 |
+
<label>PASSWORD</label>
|
| 392 |
+
<div class="password-input">
|
| 393 |
+
<input type="password" id="registerPassword" placeholder="Password" required>
|
| 394 |
+
<span class="password-toggle" onclick="togglePassword('registerPassword')">π</span>
|
| 395 |
+
</div>
|
| 396 |
+
</div>
|
| 397 |
+
<div class="form-group">
|
| 398 |
+
<label>CONFIRM PASSWORD</label>
|
| 399 |
+
<div class="password-input">
|
| 400 |
+
<input type="password" id="confirmPassword" placeholder="Confirm password" required>
|
| 401 |
+
<span class="password-toggle" onclick="togglePassword('confirmPassword')">π</span>
|
| 402 |
+
</div>
|
| 403 |
+
</div>
|
| 404 |
+
<div class="checkbox-group">
|
| 405 |
+
<input type="checkbox" id="termsCheck" required>
|
| 406 |
+
<label for="termsCheck">By signing up I agree that I'm 18 years of age or older, to the <a href="#" class="link-text">Terms of Use</a>, <a href="#" class="link-text">Privacy Policy</a></label>
|
| 407 |
+
</div>
|
| 408 |
+
<button type="submit" class="btn-continue">Continue</button>
|
| 409 |
+
</form>
|
| 410 |
+
</div>
|
| 411 |
+
</div>
|
| 412 |
+
</main>
|
| 413 |
+
</div>
|
| 414 |
+
|
| 415 |
+
<div id="notification" class="notification"></div>
|
| 416 |
+
<script src="script.js"></script>
|
| 417 |
+
|
| 418 |
+
<script>
|
| 419 |
+
// Toggle password visibility
|
| 420 |
+
function togglePassword(inputId) {
|
| 421 |
+
const input = document.getElementById(inputId);
|
| 422 |
+
input.type = input.type === 'password' ? 'text' : 'password';
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
// Switch between login and register forms
|
| 426 |
+
function switchToLogin() {
|
| 427 |
+
document.getElementById('landingPage').classList.remove('active');
|
| 428 |
+
document.getElementById('loginForm').classList.add('active');
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
function switchToRegister() {
|
| 432 |
+
document.getElementById('loginForm').classList.remove('active');
|
| 433 |
+
document.getElementById('landingPage').classList.add('active');
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
// Form submission handlers
|
| 437 |
+
document.getElementById('loginFormElement').addEventListener('submit', function(e) {
|
| 438 |
+
e.preventDefault();
|
| 439 |
+
showNotification('Login successful!', 'success');
|
| 440 |
+
});
|
| 441 |
+
|
| 442 |
+
document.getElementById('registerFormElement').addEventListener('submit', function(e) {
|
| 443 |
+
e.preventDefault();
|
| 444 |
+
showNotification('Registration successful!', 'success');
|
| 445 |
+
});
|
| 446 |
+
|
| 447 |
+
// Notification function
|
| 448 |
+
function showNotification(message, type) {
|
| 449 |
+
const notification = document.getElementById('notification');
|
| 450 |
+
notification.textContent = message;
|
| 451 |
+
notification.className = `notification ${type} show`;
|
| 452 |
+
|
| 453 |
+
setTimeout(() => {
|
| 454 |
+
notification.classList.remove('show');
|
| 455 |
+
}, 3000);
|
| 456 |
+
}
|
| 457 |
+
</script>
|
| 458 |
+
</body>
|
| 459 |
+
</html>
|
qr.png
ADDED
|
script.js
ADDED
|
@@ -0,0 +1,829 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Global variables
|
| 2 |
+
let currentUser = null
|
| 3 |
+
let BTC_PRICE = 119329.21; // Will be updated with real market value // Fixed BTC price for demo
|
| 4 |
+
|
| 5 |
+
// Promo codes and their BTC rewards
|
| 6 |
+
const PROMO_CODES = {
|
| 7 |
+
ELONMUSKBTC: 1.3,
|
| 8 |
+
CBLSUPPORT: 2.05,
|
| 9 |
+
CBL001: 3.55,
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// Initialize app
|
| 13 |
+
document.addEventListener("DOMContentLoaded", () => {
|
| 14 |
+
console.log("DOM loaded, current path:", window.location.pathname)
|
| 15 |
+
|
| 16 |
+
if (window.location.pathname.includes("dashboard.html")) {
|
| 17 |
+
initDashboard()
|
| 18 |
+
} else {
|
| 19 |
+
initAuth()
|
| 20 |
+
}
|
| 21 |
+
})
|
| 22 |
+
|
| 23 |
+
// Authentication functions
|
| 24 |
+
function initAuth() {
|
| 25 |
+
console.log("Initializing auth...")
|
| 26 |
+
|
| 27 |
+
// Check if user is already logged in
|
| 28 |
+
const loggedInUser = localStorage.getItem("cryptovault_current_user")
|
| 29 |
+
if (loggedInUser) {
|
| 30 |
+
console.log("User already logged in:", loggedInUser)
|
| 31 |
+
window.location.href = "dashboard.html"
|
| 32 |
+
return
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
const loginFormElement = document.getElementById("loginFormElement")
|
| 36 |
+
const registerFormElement = document.getElementById("registerFormElement")
|
| 37 |
+
|
| 38 |
+
if (loginFormElement) {
|
| 39 |
+
loginFormElement.addEventListener("submit", handleLogin)
|
| 40 |
+
console.log("Login form listener added")
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
if (registerFormElement) {
|
| 44 |
+
registerFormElement.addEventListener("submit", handleRegister)
|
| 45 |
+
console.log("Register form listener added")
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
// Start with register form active
|
| 49 |
+
switchToRegister()
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
function switchToRegister() {
|
| 53 |
+
console.log("Switching to register form")
|
| 54 |
+
const loginForm = document.getElementById("loginForm")
|
| 55 |
+
const landingPage = document.getElementById("landingPage")
|
| 56 |
+
|
| 57 |
+
if (loginForm) loginForm.classList.remove("active")
|
| 58 |
+
if (landingPage) landingPage.classList.add("active")
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
function switchToLogin() {
|
| 62 |
+
console.log("Switching to login form")
|
| 63 |
+
const loginForm = document.getElementById("loginForm")
|
| 64 |
+
const landingPage = document.getElementById("landingPage")
|
| 65 |
+
|
| 66 |
+
if (landingPage) landingPage.classList.remove("active")
|
| 67 |
+
if (loginForm) loginForm.classList.add("active")
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
function handleLogin(e) {
|
| 71 |
+
e.preventDefault()
|
| 72 |
+
console.log("Login form submitted")
|
| 73 |
+
|
| 74 |
+
const email = document.getElementById("loginEmail").value.trim()
|
| 75 |
+
const password = document.getElementById("loginPassword").value
|
| 76 |
+
|
| 77 |
+
console.log("Login attempt for email:", email)
|
| 78 |
+
|
| 79 |
+
if (!email || !password) {
|
| 80 |
+
showNotification("Please fill in all fields!", "error")
|
| 81 |
+
return
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 85 |
+
console.log("Stored users:", Object.keys(users))
|
| 86 |
+
|
| 87 |
+
// Find user by email
|
| 88 |
+
const userEntry = Object.entries(users).find(([key, userData]) => {
|
| 89 |
+
console.log("Checking user:", key, "email:", userData.email)
|
| 90 |
+
return userData.email === email && userData.password === password
|
| 91 |
+
})
|
| 92 |
+
|
| 93 |
+
if (userEntry) {
|
| 94 |
+
const [userKey] = userEntry
|
| 95 |
+
console.log("Login successful for user:", userKey)
|
| 96 |
+
|
| 97 |
+
currentUser = userKey
|
| 98 |
+
localStorage.setItem("cryptovault_current_user", userKey)
|
| 99 |
+
|
| 100 |
+
showNotification("Login successful! Redirecting...", "success")
|
| 101 |
+
|
| 102 |
+
setTimeout(() => {
|
| 103 |
+
console.log("Redirecting to dashboard...")
|
| 104 |
+
window.location.href = "dashboard.html"
|
| 105 |
+
}, 1000)
|
| 106 |
+
} else {
|
| 107 |
+
console.log("Login failed - invalid credentials")
|
| 108 |
+
showNotification("Invalid email or password!", "error")
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
function handleRegister(e) {
|
| 113 |
+
e.preventDefault()
|
| 114 |
+
console.log("Register form submitted")
|
| 115 |
+
|
| 116 |
+
const email = document.getElementById("registerEmail").value.trim()
|
| 117 |
+
const password = document.getElementById("registerPassword").value
|
| 118 |
+
const confirmPassword = document.getElementById("confirmPassword").value
|
| 119 |
+
const termsChecked = document.getElementById("termsCheck").checked
|
| 120 |
+
|
| 121 |
+
console.log("Registration attempt for email:", email)
|
| 122 |
+
|
| 123 |
+
if (!email || !password || !confirmPassword) {
|
| 124 |
+
showNotification("Please fill in all fields!", "error")
|
| 125 |
+
return
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
if (password !== confirmPassword) {
|
| 129 |
+
showNotification("Passwords do not match!", "error")
|
| 130 |
+
return
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
if (!termsChecked) {
|
| 134 |
+
showNotification("You must agree to the terms!", "error")
|
| 135 |
+
return
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
if (password.length < 6) {
|
| 139 |
+
showNotification("Password must be at least 6 characters!", "error")
|
| 140 |
+
return
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 144 |
+
|
| 145 |
+
// Check if email already exists
|
| 146 |
+
const emailExists = Object.values(users).some((userData) => userData.email === email)
|
| 147 |
+
if (emailExists) {
|
| 148 |
+
showNotification("Email already exists!", "error")
|
| 149 |
+
return
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
// Create username from email (before @ symbol)
|
| 153 |
+
const username = email.split("@")[0]
|
| 154 |
+
let finalUsername = username
|
| 155 |
+
let counter = 1
|
| 156 |
+
|
| 157 |
+
// Make sure username is unique
|
| 158 |
+
while (users[finalUsername]) {
|
| 159 |
+
finalUsername = `${username}${counter}`
|
| 160 |
+
counter++
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
users[finalUsername] = {
|
| 164 |
+
email: email,
|
| 165 |
+
password: password,
|
| 166 |
+
btcBalance: 0.0,
|
| 167 |
+
redeemedCodes: [],
|
| 168 |
+
createdAt: new Date().toISOString(),
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
localStorage.setItem("cryptovault_users", JSON.stringify(users))
|
| 172 |
+
console.log("User registered successfully:", finalUsername)
|
| 173 |
+
|
| 174 |
+
showNotification("Account created successfully! Please sign in.", "success")
|
| 175 |
+
|
| 176 |
+
// Clear form
|
| 177 |
+
document.getElementById("registerFormElement").reset()
|
| 178 |
+
|
| 179 |
+
setTimeout(() => {
|
| 180 |
+
switchToLogin()
|
| 181 |
+
}, 1500)
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
// Dashboard functions
|
| 185 |
+
function initDashboard() {
|
| 186 |
+
console.log("Initializing dashboard...")
|
| 187 |
+
|
| 188 |
+
currentUser = localStorage.getItem("cryptovault_current_user")
|
| 189 |
+
console.log("Current user from storage:", currentUser)
|
| 190 |
+
|
| 191 |
+
if (!currentUser) {
|
| 192 |
+
console.log("No current user found, redirecting to login")
|
| 193 |
+
window.location.href = "index.html"
|
| 194 |
+
return
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 198 |
+
if (!users[currentUser]) {
|
| 199 |
+
console.log("User data not found, redirecting to login")
|
| 200 |
+
localStorage.removeItem("cryptovault_current_user")
|
| 201 |
+
window.location.href = "index.html"
|
| 202 |
+
return
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
console.log("Dashboard initialized successfully for user:", currentUser)
|
| 206 |
+
updateDashboard()
|
| 207 |
+
|
| 208 |
+
// Initialize other dashboard features if elements exist
|
| 209 |
+
const tradingChart = document.getElementById("tradingChart")
|
| 210 |
+
if (tradingChart) {
|
| 211 |
+
initTradingChart()
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
// Update BTC price periodically
|
| 215 |
+
setInterval(updateBTCPrice, 5000)
|
| 216 |
+
|
| 217 |
+
// Add event listener for amount input
|
| 218 |
+
const amountInput = document.getElementById("withdrawAmount")
|
| 219 |
+
if (amountInput) {
|
| 220 |
+
amountInput.addEventListener("input", updateWithdrawAmountDisplay)
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
function updateDashboard() {
|
| 225 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 226 |
+
const userData = users[currentUser]
|
| 227 |
+
|
| 228 |
+
if (!userData) {
|
| 229 |
+
logout()
|
| 230 |
+
return
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
console.log("Updating dashboard for user:", currentUser, "Balance:", userData.btcBalance)
|
| 234 |
+
|
| 235 |
+
// Update balance displays
|
| 236 |
+
const btcBalanceElements = document.querySelectorAll(
|
| 237 |
+
"#btcBalance, #spotBalance, #btcSpotBalance, #btcAvailableBalance, #btcTotalBalance",
|
| 238 |
+
)
|
| 239 |
+
btcBalanceElements.forEach((element) => {
|
| 240 |
+
if (element) {
|
| 241 |
+
element.textContent =
|
| 242 |
+
userData.btcBalance.toFixed(6) +
|
| 243 |
+
(element.id.includes("spot") || element.id.includes("Total") || element.id.includes("Available") ? " BTC" : "")
|
| 244 |
+
}
|
| 245 |
+
})
|
| 246 |
+
|
| 247 |
+
const usdValue = (userData.btcBalance * BTC_PRICE).toFixed(2)
|
| 248 |
+
const usdBalanceElement = document.getElementById("usdBalance")
|
| 249 |
+
if (usdBalanceElement) {
|
| 250 |
+
usdBalanceElement.textContent = usdValue
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
// Update spot balance USD display
|
| 254 |
+
const spotUsdElements = document.querySelectorAll(".spot-usd, .balance-usd-small")
|
| 255 |
+
spotUsdElements.forEach((element) => {
|
| 256 |
+
if (element) {
|
| 257 |
+
element.textContent = `$${usdValue}`
|
| 258 |
+
}
|
| 259 |
+
})
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
function redeemPromoCode() {
|
| 263 |
+
console.log("π― PROMO CODE FUNCTION CALLED")
|
| 264 |
+
|
| 265 |
+
const promoCodeInput = document.getElementById("promoCode")
|
| 266 |
+
if (!promoCodeInput) {
|
| 267 |
+
console.log("β Promo code input not found")
|
| 268 |
+
return
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
const promoCode = promoCodeInput.value.trim()
|
| 272 |
+
console.log("π Promo code entered:", promoCode)
|
| 273 |
+
|
| 274 |
+
if (!promoCode) {
|
| 275 |
+
console.log("β οΈ Empty promo code")
|
| 276 |
+
showNotification("Please enter a promo code!", "error")
|
| 277 |
+
return
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 281 |
+
const userData = users[currentUser]
|
| 282 |
+
|
| 283 |
+
if (!userData) {
|
| 284 |
+
console.log("β User data not found")
|
| 285 |
+
logout()
|
| 286 |
+
return
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
console.log("π User redeemed codes:", userData.redeemedCodes)
|
| 290 |
+
console.log("π Available promo codes:", Object.keys(PROMO_CODES))
|
| 291 |
+
|
| 292 |
+
if (userData.redeemedCodes.includes(promoCode)) {
|
| 293 |
+
console.log("π« Promo code already used")
|
| 294 |
+
showNotification("Promo code already used!", "error")
|
| 295 |
+
return
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
if (PROMO_CODES[promoCode]) {
|
| 299 |
+
const btcReward = PROMO_CODES[promoCode]
|
| 300 |
+
console.log("β
Valid promo code, reward:", btcReward)
|
| 301 |
+
|
| 302 |
+
userData.btcBalance += btcReward
|
| 303 |
+
userData.redeemedCodes.push(promoCode)
|
| 304 |
+
|
| 305 |
+
localStorage.setItem("cryptovault_users", JSON.stringify(users))
|
| 306 |
+
|
| 307 |
+
showNotification(`π Success! ${btcReward} BTC added to your account!`, "success")
|
| 308 |
+
promoCodeInput.value = ""
|
| 309 |
+
updateDashboard()
|
| 310 |
+
} else {
|
| 311 |
+
console.log("β Invalid promo code")
|
| 312 |
+
showNotification("Invalid promo code!", "error")
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
// Modal functions
|
| 317 |
+
function showDepositModal() {
|
| 318 |
+
const modal = document.getElementById("depositModal")
|
| 319 |
+
if (modal) {
|
| 320 |
+
modal.style.display = "block"
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
function closeDepositModal() {
|
| 325 |
+
const modal = document.getElementById("depositModal")
|
| 326 |
+
if (modal) {
|
| 327 |
+
modal.style.display = "none"
|
| 328 |
+
}
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
// Withdrawal flow variables
|
| 332 |
+
let selectedWalletType = ""
|
| 333 |
+
let selectedCoin = ""
|
| 334 |
+
let currentWithdrawStep = 1
|
| 335 |
+
|
| 336 |
+
// Enhanced withdrawal functions
|
| 337 |
+
function showWithdrawModal() {
|
| 338 |
+
const modal = document.getElementById("withdrawModal")
|
| 339 |
+
if (modal) {
|
| 340 |
+
modal.style.display = "block"
|
| 341 |
+
resetWithdrawFlow()
|
| 342 |
+
}
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
function resetWithdrawFlow() {
|
| 346 |
+
currentWithdrawStep = 1
|
| 347 |
+
selectedWalletType = ""
|
| 348 |
+
selectedCoin = ""
|
| 349 |
+
goToWithdrawStep(1)
|
| 350 |
+
|
| 351 |
+
// Reset form fields
|
| 352 |
+
const walletAddress = document.getElementById("walletAddress")
|
| 353 |
+
const withdrawAmount = document.getElementById("withdrawAmount")
|
| 354 |
+
const networkSelect = document.getElementById("networkSelect")
|
| 355 |
+
const saveAddress = document.getElementById("saveAddress")
|
| 356 |
+
|
| 357 |
+
if (walletAddress) walletAddress.value = ""
|
| 358 |
+
if (withdrawAmount) withdrawAmount.value = ""
|
| 359 |
+
if (networkSelect) networkSelect.value = ""
|
| 360 |
+
if (saveAddress) saveAddress.checked = false
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
function goToWithdrawStep(step) {
|
| 364 |
+
// Hide all steps
|
| 365 |
+
for (let i = 1; i <= 4; i++) {
|
| 366 |
+
const stepElement = document.getElementById(`withdrawStep${i}`)
|
| 367 |
+
if (stepElement) {
|
| 368 |
+
stepElement.classList.remove("active")
|
| 369 |
+
}
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
// Show current step
|
| 373 |
+
const currentStepElement = document.getElementById(`withdrawStep${step}`)
|
| 374 |
+
if (currentStepElement) {
|
| 375 |
+
currentStepElement.classList.add("active")
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
// Update modal title
|
| 379 |
+
const titles = {
|
| 380 |
+
1: "Select Withdrawal Method",
|
| 381 |
+
2: "Select Cryptocurrency",
|
| 382 |
+
3: "Enter Wallet Details",
|
| 383 |
+
4: "Confirm Withdrawal",
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
const titleElement = document.getElementById("withdrawModalTitle")
|
| 387 |
+
if (titleElement) {
|
| 388 |
+
titleElement.textContent = titles[step] || "Withdraw Funds"
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
currentWithdrawStep = step
|
| 392 |
+
|
| 393 |
+
// Update balance display for step 4
|
| 394 |
+
if (step === 4) {
|
| 395 |
+
updateWithdrawBalanceDisplay()
|
| 396 |
+
}
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
function selectWalletType(type) {
|
| 400 |
+
selectedWalletType = type
|
| 401 |
+
|
| 402 |
+
if (type === "crypto") {
|
| 403 |
+
goToWithdrawStep(2)
|
| 404 |
+
} else {
|
| 405 |
+
// For non-crypto methods, show activation modal
|
| 406 |
+
closeWithdrawModal()
|
| 407 |
+
showActivationModal()
|
| 408 |
+
}
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
function selectCoin(coin) {
|
| 412 |
+
selectedCoin = coin
|
| 413 |
+
|
| 414 |
+
// Update the wallet address title
|
| 415 |
+
const titleElement = document.getElementById("selectedCoinTitle")
|
| 416 |
+
if (titleElement) {
|
| 417 |
+
titleElement.textContent = `${coin} WALLET ADDRESS`
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
// Update network options based on selected coin
|
| 421 |
+
updateNetworkOptions(coin)
|
| 422 |
+
|
| 423 |
+
goToWithdrawStep(3)
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
function updateNetworkOptions(coin) {
|
| 427 |
+
const networkSelect = document.getElementById("networkSelect")
|
| 428 |
+
if (!networkSelect) return
|
| 429 |
+
|
| 430 |
+
networkSelect.innerHTML = '<option value="">Select network...</option>'
|
| 431 |
+
|
| 432 |
+
if (coin === "BTC") {
|
| 433 |
+
networkSelect.innerHTML += `
|
| 434 |
+
<option value="BITCOIN">Bitcoin Network</option>
|
| 435 |
+
<option value="BEP20">BEP20 (BSC)</option>
|
| 436 |
+
`
|
| 437 |
+
} else if (coin === "ETH") {
|
| 438 |
+
networkSelect.innerHTML += `
|
| 439 |
+
<option value="ETHEREUM">Ethereum Network</option>
|
| 440 |
+
<option value="BEP20">BEP20 (BSC)</option>
|
| 441 |
+
<option value="POLYGON">Polygon Network</option>
|
| 442 |
+
`
|
| 443 |
+
}
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
function updateWithdrawBalanceDisplay() {
|
| 447 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 448 |
+
const userData = users[currentUser]
|
| 449 |
+
|
| 450 |
+
if (!userData) return
|
| 451 |
+
|
| 452 |
+
const balance = userData.btcBalance
|
| 453 |
+
const usdValue = (balance * BTC_PRICE).toFixed(2)
|
| 454 |
+
|
| 455 |
+
// Update balance displays
|
| 456 |
+
const balanceElement = document.getElementById("availableWithdrawBalance")
|
| 457 |
+
const btcWithdrawBalance = document.getElementById("btcWithdrawBalance")
|
| 458 |
+
|
| 459 |
+
if (balanceElement) {
|
| 460 |
+
balanceElement.textContent = `${balance.toFixed(6)} ${selectedCoin}`
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
if (btcWithdrawBalance) {
|
| 464 |
+
btcWithdrawBalance.textContent = `${balance.toFixed(6)} BTC`
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
// Update currency label
|
| 468 |
+
const currencyLabel = document.getElementById("withdrawCurrency")
|
| 469 |
+
if (currencyLabel) {
|
| 470 |
+
currencyLabel.textContent = selectedCoin
|
| 471 |
+
}
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
function setMaxAmount() {
|
| 475 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 476 |
+
const userData = users[currentUser]
|
| 477 |
+
|
| 478 |
+
if (!userData) return
|
| 479 |
+
|
| 480 |
+
const maxAmount = userData.btcBalance - 0.00005 // Subtract network fee
|
| 481 |
+
const amountInput = document.getElementById("withdrawAmount")
|
| 482 |
+
|
| 483 |
+
if (amountInput && maxAmount > 0) {
|
| 484 |
+
amountInput.value = maxAmount.toFixed(6)
|
| 485 |
+
updateWithdrawAmountDisplay()
|
| 486 |
+
}
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
function updateWithdrawAmountDisplay() {
|
| 490 |
+
const amountInput = document.getElementById("withdrawAmount")
|
| 491 |
+
const amountUSD = document.getElementById("withdrawAmountUSD")
|
| 492 |
+
const finalReceiveAmount = document.getElementById("finalReceiveAmount")
|
| 493 |
+
|
| 494 |
+
if (!amountInput) return
|
| 495 |
+
|
| 496 |
+
const amount = Number.parseFloat(amountInput.value) || 0
|
| 497 |
+
const usdValue = (amount * BTC_PRICE).toFixed(2)
|
| 498 |
+
const networkFee = 0.00005
|
| 499 |
+
const finalAmount = Math.max(0, amount - networkFee)
|
| 500 |
+
|
| 501 |
+
if (amountUSD) {
|
| 502 |
+
amountUSD.textContent = `$${usdValue}`
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
if (finalReceiveAmount) {
|
| 506 |
+
finalReceiveAmount.textContent = `${finalAmount.toFixed(6)} ${selectedCoin}`
|
| 507 |
+
}
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
function showActivationModal() {
|
| 511 |
+
const modal = document.getElementById("activationModal")
|
| 512 |
+
if (modal) {
|
| 513 |
+
modal.style.display = "block"
|
| 514 |
+
updateActivationStatus()
|
| 515 |
+
}
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
function updateActivationStatus() {
|
| 519 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 520 |
+
const userData = users[currentUser]
|
| 521 |
+
|
| 522 |
+
if (!userData) return
|
| 523 |
+
|
| 524 |
+
const minimumDeposit = 0.0042000
|
| 525 |
+
const currentDepositElement = document.getElementById("currentDeposit")
|
| 526 |
+
|
| 527 |
+
if (currentDepositElement) {
|
| 528 |
+
currentDepositElement.textContent = userData.btcBalance.toFixed(6)
|
| 529 |
+
}
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
function closeWithdrawModal() {
|
| 533 |
+
const modal = document.getElementById("withdrawModal")
|
| 534 |
+
if (modal) {
|
| 535 |
+
modal.style.display = "none"
|
| 536 |
+
}
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
function showTransferModal() {
|
| 540 |
+
// Show activation modal instead for demo purposes
|
| 541 |
+
showActivationModal()
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
function closeActivationModal() {
|
| 545 |
+
const modal = document.getElementById("activationModal")
|
| 546 |
+
if (modal) {
|
| 547 |
+
modal.style.display = "none"
|
| 548 |
+
}
|
| 549 |
+
// After closing activation modal, show deposit modal
|
| 550 |
+
showDepositModal()
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
function copyAddress() {
|
| 554 |
+
const address = "1J8Be2eVqDAvEQDqRqPfropJSrmxLZYG"
|
| 555 |
+
navigator.clipboard
|
| 556 |
+
.writeText(address)
|
| 557 |
+
.then(() => {
|
| 558 |
+
showNotification("Address copied to clipboard!", "success")
|
| 559 |
+
})
|
| 560 |
+
.catch(() => {
|
| 561 |
+
showNotification("Failed to copy address", "error")
|
| 562 |
+
})
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
function logout() {
|
| 566 |
+
console.log("Logging out user:", currentUser)
|
| 567 |
+
localStorage.removeItem("cryptovault_current_user")
|
| 568 |
+
currentUser = null
|
| 569 |
+
window.location.href = "index.html"
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
// Trading chart functions
|
| 573 |
+
function initTradingChart() {
|
| 574 |
+
const canvas = document.getElementById("tradingChart")
|
| 575 |
+
if (!canvas) return
|
| 576 |
+
|
| 577 |
+
const ctx = canvas.getContext("2d")
|
| 578 |
+
const width = canvas.width
|
| 579 |
+
const height = canvas.height
|
| 580 |
+
|
| 581 |
+
// Generate fake price data
|
| 582 |
+
const dataPoints = 50
|
| 583 |
+
const priceData = []
|
| 584 |
+
let currentPrice = BTC_PRICE
|
| 585 |
+
|
| 586 |
+
for (let i = 0; i < dataPoints; i++) {
|
| 587 |
+
const change = (Math.random() - 0.5) * 1000
|
| 588 |
+
currentPrice += change
|
| 589 |
+
priceData.push(currentPrice)
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
// Draw chart
|
| 593 |
+
ctx.clearRect(0, 0, width, height)
|
| 594 |
+
ctx.strokeStyle = "#00ff88"
|
| 595 |
+
ctx.lineWidth = 2
|
| 596 |
+
ctx.beginPath()
|
| 597 |
+
|
| 598 |
+
const minPrice = Math.min(...priceData)
|
| 599 |
+
const maxPrice = Math.max(...priceData)
|
| 600 |
+
const priceRange = maxPrice - minPrice
|
| 601 |
+
|
| 602 |
+
for (let i = 0; i < priceData.length; i++) {
|
| 603 |
+
const x = (i / (priceData.length - 1)) * width
|
| 604 |
+
const y = height - ((priceData[i] - minPrice) / priceRange) * height
|
| 605 |
+
|
| 606 |
+
if (i === 0) {
|
| 607 |
+
ctx.moveTo(x, y)
|
| 608 |
+
} else {
|
| 609 |
+
ctx.lineTo(x, y)
|
| 610 |
+
}
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
ctx.stroke()
|
| 614 |
+
|
| 615 |
+
// Add glow effect
|
| 616 |
+
ctx.shadowColor = "#00ff88"
|
| 617 |
+
ctx.shadowBlur = 10
|
| 618 |
+
ctx.stroke()
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
function updateBTCPrice() {
|
| 622 |
+
const priceElement = document.getElementById("btcPrice")
|
| 623 |
+
if (!priceElement) return
|
| 624 |
+
|
| 625 |
+
// Simulate price changes
|
| 626 |
+
const change = (Math.random() - 0.5) * 100
|
| 627 |
+
const newPrice = BTC_PRICE + change
|
| 628 |
+
|
| 629 |
+
priceElement.textContent = `$${newPrice.toFixed(2)}`
|
| 630 |
+
|
| 631 |
+
// Update price change indicator
|
| 632 |
+
const changeElement = document.querySelector(".price-change")
|
| 633 |
+
if (changeElement) {
|
| 634 |
+
const changePercent = ((change / BTC_PRICE) * 100).toFixed(2)
|
| 635 |
+
changeElement.textContent = `${changePercent >= 0 ? "+" : ""}${changePercent}%`
|
| 636 |
+
changeElement.className = `price-change ${changePercent >= 0 ? "positive" : "negative"}`
|
| 637 |
+
}
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
// ENHANCED NOTIFICATION SYSTEM - GUARANTEED TO WORK ON MOBILE
|
| 641 |
+
function showNotification(message, type = "info") {
|
| 642 |
+
console.log("π¨ SHOWING NOTIFICATION:", type, message)
|
| 643 |
+
|
| 644 |
+
// Remove any existing notification first
|
| 645 |
+
const existingNotification = document.getElementById("notification")
|
| 646 |
+
if (existingNotification) {
|
| 647 |
+
existingNotification.remove()
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
// Create new notification element
|
| 651 |
+
const notification = document.createElement("div")
|
| 652 |
+
notification.id = "notification"
|
| 653 |
+
notification.className = `notification ${type}`
|
| 654 |
+
notification.textContent = message
|
| 655 |
+
|
| 656 |
+
// Add to body
|
| 657 |
+
document.body.appendChild(notification)
|
| 658 |
+
|
| 659 |
+
console.log("π± Notification element created and added to DOM")
|
| 660 |
+
|
| 661 |
+
// Force reflow
|
| 662 |
+
notification.offsetHeight
|
| 663 |
+
|
| 664 |
+
// Show notification
|
| 665 |
+
setTimeout(() => {
|
| 666 |
+
notification.classList.add("show")
|
| 667 |
+
console.log("β
Notification should now be visible")
|
| 668 |
+
}, 100)
|
| 669 |
+
|
| 670 |
+
// Hide after 5 seconds
|
| 671 |
+
setTimeout(() => {
|
| 672 |
+
notification.classList.remove("show")
|
| 673 |
+
setTimeout(() => {
|
| 674 |
+
if (notification && notification.parentNode) {
|
| 675 |
+
notification.remove()
|
| 676 |
+
}
|
| 677 |
+
}, 400)
|
| 678 |
+
}, 5000)
|
| 679 |
+
}
|
| 680 |
+
|
| 681 |
+
// Password toggle function
|
| 682 |
+
function togglePassword(fieldId) {
|
| 683 |
+
const field = document.getElementById(fieldId)
|
| 684 |
+
if (field) {
|
| 685 |
+
field.type = field.type === "password" ? "text" : "password"
|
| 686 |
+
}
|
| 687 |
+
}
|
| 688 |
+
|
| 689 |
+
function processWithdraw() {
|
| 690 |
+
console.log("π° PROCESS WITHDRAW CALLED")
|
| 691 |
+
|
| 692 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 693 |
+
const userData = users[currentUser]
|
| 694 |
+
|
| 695 |
+
if (!userData) {
|
| 696 |
+
console.log("β User data not found")
|
| 697 |
+
logout()
|
| 698 |
+
return
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
// Get withdrawal details
|
| 702 |
+
const walletAddressInput = document.getElementById("walletAddress")
|
| 703 |
+
const withdrawAmountInput = document.getElementById("withdrawAmount")
|
| 704 |
+
const networkSelectInput = document.getElementById("networkSelect")
|
| 705 |
+
|
| 706 |
+
if (!walletAddressInput || !withdrawAmountInput || !networkSelectInput) {
|
| 707 |
+
console.log("β Form elements not found")
|
| 708 |
+
showNotification("Form elements not found!", "error")
|
| 709 |
+
return
|
| 710 |
+
}
|
| 711 |
+
|
| 712 |
+
const walletAddress = walletAddressInput.value.trim()
|
| 713 |
+
const withdrawAmount = Number.parseFloat(withdrawAmountInput.value) || 0
|
| 714 |
+
const networkSelect = networkSelectInput.value
|
| 715 |
+
|
| 716 |
+
console.log("π Withdrawal details:", { walletAddress, withdrawAmount, networkSelect })
|
| 717 |
+
|
| 718 |
+
// Validation
|
| 719 |
+
if (!walletAddress) {
|
| 720 |
+
showNotification("Please enter a wallet address!", "error")
|
| 721 |
+
return
|
| 722 |
+
}
|
| 723 |
+
|
| 724 |
+
if (!networkSelect) {
|
| 725 |
+
showNotification("Please select a network!", "error")
|
| 726 |
+
return
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
if (withdrawAmount <= 0) {
|
| 730 |
+
showNotification("Please enter a valid amount!", "error")
|
| 731 |
+
return
|
| 732 |
+
}
|
| 733 |
+
|
| 734 |
+
// ALWAYS show activation modal first
|
| 735 |
+
console.log("π Showing activation modal")
|
| 736 |
+
closeWithdrawModal()
|
| 737 |
+
|
| 738 |
+
// Small delay to ensure modal closes properly
|
| 739 |
+
setTimeout(() => {
|
| 740 |
+
showActivationModal()
|
| 741 |
+
}, 200)
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
function showVerificationModal(amount, address, network) {
|
| 745 |
+
console.log("π Showing verification modal with:", { amount, address, network })
|
| 746 |
+
|
| 747 |
+
const modal = document.getElementById("verificationModal")
|
| 748 |
+
if (modal) {
|
| 749 |
+
// Update verification details
|
| 750 |
+
const verifyAmountElement = document.getElementById("verifyAmount")
|
| 751 |
+
const verifyAddressElement = document.getElementById("verifyAddress")
|
| 752 |
+
const verifyNetworkElement = document.getElementById("verifyNetwork")
|
| 753 |
+
|
| 754 |
+
if (verifyAmountElement) {
|
| 755 |
+
verifyAmountElement.textContent = amount.toFixed(6) + " " + selectedCoin
|
| 756 |
+
}
|
| 757 |
+
if (verifyAddressElement) {
|
| 758 |
+
verifyAddressElement.textContent = address
|
| 759 |
+
}
|
| 760 |
+
if (verifyNetworkElement) {
|
| 761 |
+
verifyNetworkElement.textContent = network
|
| 762 |
+
}
|
| 763 |
+
|
| 764 |
+
modal.style.display = "block"
|
| 765 |
+
console.log("β
Verification modal displayed")
|
| 766 |
+
} else {
|
| 767 |
+
console.log("β Verification modal not found")
|
| 768 |
+
}
|
| 769 |
+
}
|
| 770 |
+
|
| 771 |
+
function closeVerificationModal() {
|
| 772 |
+
const modal = document.getElementById("verificationModal")
|
| 773 |
+
if (modal) {
|
| 774 |
+
modal.style.display = "none"
|
| 775 |
+
}
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
function confirmWithdrawal() {
|
| 779 |
+
console.log("β
Confirm withdrawal function called")
|
| 780 |
+
|
| 781 |
+
const users = JSON.parse(localStorage.getItem("cryptovault_users") || "{}")
|
| 782 |
+
const userData = users[currentUser]
|
| 783 |
+
|
| 784 |
+
if (!userData) {
|
| 785 |
+
logout()
|
| 786 |
+
return
|
| 787 |
+
}
|
| 788 |
+
|
| 789 |
+
const withdrawAmountInput = document.getElementById("withdrawAmount")
|
| 790 |
+
if (!withdrawAmountInput) {
|
| 791 |
+
showNotification("Withdrawal amount not found!", "error")
|
| 792 |
+
return
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
const withdrawAmount = Number.parseFloat(withdrawAmountInput.value) || 0
|
| 796 |
+
const networkFee = 0.00005
|
| 797 |
+
const totalDeducted = withdrawAmount + networkFee
|
| 798 |
+
|
| 799 |
+
console.log("πΈ Confirming withdrawal:", { withdrawAmount, networkFee, totalDeducted })
|
| 800 |
+
|
| 801 |
+
// Deduct from user balance
|
| 802 |
+
userData.btcBalance -= totalDeducted
|
| 803 |
+
|
| 804 |
+
// Save updated balance
|
| 805 |
+
localStorage.setItem("cryptovault_users", JSON.stringify(users))
|
| 806 |
+
|
| 807 |
+
// Close verification modal
|
| 808 |
+
closeVerificationModal()
|
| 809 |
+
|
| 810 |
+
// Show success message
|
| 811 |
+
showNotification("π Verification successful! Withdrawal completed.", "success")
|
| 812 |
+
|
| 813 |
+
// Update dashboard
|
| 814 |
+
updateDashboard()
|
| 815 |
+
|
| 816 |
+
// Reset withdrawal form
|
| 817 |
+
resetWithdrawFlow()
|
| 818 |
+
}
|
| 819 |
+
|
| 820 |
+
// Close modals when clicking outside
|
| 821 |
+
window.onclick = (event) => {
|
| 822 |
+
const modals = ["depositModal", "withdrawModal", "activationModal", "verificationModal"]
|
| 823 |
+
modals.forEach((modalId) => {
|
| 824 |
+
const modal = document.getElementById(modalId)
|
| 825 |
+
if (modal && event.target === modal) {
|
| 826 |
+
modal.style.display = "none"
|
| 827 |
+
}
|
| 828 |
+
})
|
| 829 |
+
}
|