diff --git a/includes/lang.php b/includes/lang.php index bc617d4..c591149 100644 --- a/includes/lang.php +++ b/includes/lang.php @@ -623,6 +623,34 @@ $translations = [ 'recharge_request_submitted_text' => '您的充值申请已成功提交,请耐心等待审核。', 'matched_desc_short' => '系统已为您分配专属收款账户,请等待详情显示。', 'fees_content' => 'BYRO采用透明的费率结构,旨在为用户提供最具竞争力的交易成本。', + 'demo_title' => '最专业的数字资产交易所', + 'demo_subtitle' => '更低的手续费、更快的交易速度和更强大的 API,BYRO 助您触达每笔交易的极限', + 'margin_trading' => '杠杆交易', + 'perpetual_contract' => '永续合约', + 'option_trading' => '期权交易', + 'order_book' => '订单簿', + 'buy_btc' => '买入 BTC', + 'network_status_normal' => '网络状态正常', + 'latency' => '延迟', + 'api_connected' => 'API: 已连接', + 'buy_btn' => '买入', + 'sell_btn' => '卖出', + 'futures_trading' => '合约交易', + 'binary_trading' => '秒合约', + 'leverage' => '杠杆', + 'cycle' => '周期', + 'quantity' => '数量', + 'seconds' => '秒', + 'profit' => '收益', + 'buy_long' => '看涨', + 'sell_short' => '看跌', + 'long' => '做多', + 'short' => '做空', + 'network_status_normal' => '网络状态正常', + 'latency' => '延迟', + 'api_connected' => 'API: 已连接', + 'app_experience_now' => '立即体验', + 'trade_history' => '成交历史', ], 'en' => [ 'home' => 'Home', @@ -1053,200 +1081,30 @@ $translations = [ 'app_install_auth' => 'Authorize', 'app_experience_now' => 'Experience Now', 'support_anywhere' => 'Support Anywhere', - 'app_mockup_desc' => 'Take control of your digital assets in BYRO mobile app. Trade anywhere.', - 'scan_qr_to_download' => 'Scan QR to Download', - 'vol_unit' => 'M', - 'from' => 'From', - 'to' => 'To', - 'rate' => 'Rate', - 'price_impact' => 'Price Impact', - 'slippage' => 'Slippage', - 'swap_now' => 'Swap Now', - 'start_mining' => 'Start Mining', - 'time_fs' => 'Time', - 'time_1m' => '1m', - 'time_5m' => '5m', - 'time_15m' => '15m', - 'time_30m' => '30m', - 'time_1h' => '1h', - 'time_4h' => '4h', - 'time_1d' => '1d', - 'time_1w' => '1w', - 'indicators' => 'Indicators', - 'chart' => 'Chart', - 'depth' => 'Depth', - 'price' => 'Price', - 'quantity' => 'Quantity', - 'open_orders' => 'Open Orders', - 'settlement_history' => 'Settlement History', - 'details' => 'Details', - 'confirm_close_pos' => 'Confirm to close position?', - 'pos_closed' => 'Position closed', - 'order_in_progress' => 'Order in Progress', - 'current_price' => 'Current Price', - 'opening_price' => 'Opening Price', - 'final_price_settlement' => 'Final price settlement', - 'error_msg_placeholder' => 'Error message', - 'unauthorized' => 'Unauthorized', - 'invalid_amount' => 'Invalid amount', - 'account_frozen' => 'Account frozen', - 'invalid_action' => 'Invalid action', - 'request_failed' => 'Request failed', - 'vip_level' => 'VIP Level', - 'level' => 'Level', - 'recharge_to_upgrade' => 'Recharge %amount% USDT more to reach VIP %level%', - 'highest_level' => 'Highest Level Reached', - 'USDT' => 'USDT', - 'BTC' => 'BTC', - 'ETH' => 'ETH', - 'BNB' => 'BNB', - 'SOL' => 'SOL', - 'XRP' => 'XRP', - 'ADA' => 'ADA', - 'DOGE' => 'DOGE', - 'DOT' => 'DOT', - 'MATIC' => 'MATIC', - 'LINK' => 'LINK', - 'SHIB' => 'SHIB', - 'TRX' => 'TRX', - 'BCH' => 'BCH', - 'LTC' => 'LTC', - 'UNI' => 'UNI', - 'security_level' => 'Security Level', - 'login_password' => 'Login Password', - 'old_password' => 'Old Password', - 'new_password' => 'New Password', - 'confirm_new_password' => 'Confirm New Password', - 'set_password' => 'Set Password', - 'binding_phone' => 'Binding Phone', - 'google_verification' => 'Google Verification', - 'binding_mailbox' => 'Binding Mailbox', - 'update' => 'Update', - 'low' => 'Low', - 'medium' => 'Medium', - 'high' => 'High', - 'bound' => 'Bound', - 'not_bound' => 'Not Bound', - 'copy' => 'Copy', - 'old_pwd_incorrect' => 'Old password is incorrect', - 'pwd_changed_success' => 'Password changed successfully', - 'trade_pwd_updated' => 'Trade password updated', - 'security_step1' => 'For your asset security, please bind your phone and email, and enable Google Verification.', - 'security_step2' => 'Please keep your login and trade passwords safe and never disclose them to others.', - 'trade_password' => 'Trade Password', - 'matched_successfully' => 'Matched Successfully', - 'account_received' => 'Payment Account Received', - 'getting_account_details' => 'Getting Account Details', - 'receiving_bank' => 'Receiving Bank', - 'receiving_account' => 'Receiving Account', - 'receiving_name' => 'Receiving Name', - 'recharge_final_notice' => "Matched successfully. Please strictly follow the account information displayed on the page for transfer.\nThe transfer amount must be consistent with the order amount.\nDo not split transfers or modify amounts.", - 'remaining_time' => 'Remaining Time', - 'secure_pay' => 'Secure Pay', - 'encrypted_channel' => 'Encrypted Channel', - 'complete_transfer' => 'Complete Transfer', - 'waiting_allocation' => 'Allocating', - 'waiting_countdown' => 'Waiting Countdown', - 'secure_channel' => 'Secure Channel', - 'waiting_system_allocation' => 'Waiting for System Allocation', - 'recharge_request_submitted' => 'Recharge Submitted', - 'recharge_request_submitted_text' => 'Your recharge request has been submitted successfully, please wait for review.', - 'matched_desc_short' => 'The system has allocated an exclusive receiving account for you. Please wait for the details.', - 'aud_name' => 'AUD', - 'cad_name' => 'CAD', - 'chf_name' => 'CHF', - 'brl_name' => 'BRL', - 'rub_name' => 'RUB', - 'inr_name' => 'INR', - 'zar_name' => 'ZAR', - 'try_name' => 'TRY', - 'aed_name' => 'AED', - 'sar_name' => 'SAR', - 'mxn_name' => 'MXN', - 'php_name' => 'PHP', - 'idr_name' => 'IDR', - 'processing' => 'Processing...', - 'swap_processing_desc' => 'Please wait while we complete your exchange', - 'swap_success_desc' => 'Your exchange has been completed successfully!', - 'unknown_error' => 'Unknown error occurred', - 'rate_fetch_failed' => 'Failed to fetch exchange rate (Provider issue)', - 'matching_account' => 'Matching Account', - 'matching_desc' => 'System is matching the most suitable recharge account for you, please wait...', - 'security_instructions' => 'Security Instructions', - 'security_tip_1' => 'Please complete the recharge before the countdown ends', - 'security_tip_2' => 'Be sure to note your User ID when transferring', - 'security_tip_3' => 'Contact customer service if you have any questions', - 'safe_payment' => 'Safe Payment', - 'instant_confirmation' => 'Instant Confirmation', - 'remaining_time' => 'Remaining Time', - 'account_matched' => 'Account Matched Successfully', - 'account_matched_desc' => 'Please complete the transfer according to the following info.', - 'bank_name' => 'Bank Name', - 'payee_name' => 'Payee Name', - 'account_number' => 'Account Number', - 'transfer_note' => 'Transfer Note', - 'copy_info' => 'Copy', - 'transfer_steps_title' => 'Transfer Steps', - 'step_1' => 'Open your banking app or wallet', - 'step_2' => 'Transfer exact amount to the matched account', - 'step_3' => 'Keep your transfer receipt for verification', - 'step_4' => 'Click "I have paid" in chat or wait for system sync', - 'recharge_success_title' => 'Request Submitted', - 'recharge_success_text' => 'Your recharge request has been received. Please wait for approval.', - 'recharge_instruction_1' => 'System is allocating an exclusive account for you, please wait patiently.', - 'recharge_instruction_2' => 'Do not refresh the page or resubmit the order during matching.', - 'recharge_instruction_3' => 'If matching fails after the countdown, please contact support.', - 'recharge_instruction_4' => 'After receiving the account, submit the transfer voucher to support.', - 'recharge_instruction_5' => 'Support will confirm your deposit after verifying the funds.', - 'finished_transfer' => 'Finished Transfer', - 'matching_instructions' => 'Matching Instructions', - 'matching_system_active' => 'MATCHING SYSTEM ACTIVE', - 'high_encryption' => 'HIGH ENCRYPTION', - 'online' => 'ONLINE', - 'ip' => 'IP:', - 'news_title_1' => 'BYRO Officially Launches New Binary Trading System', - 'news_title_2' => 'Announcement on New Payment Methods', - 'news_title_3' => 'BYRO Obtains Digital Currency Operation License', - 'news_title_4' => 'Enhance Account Security: Enable Google Authenticator', - 'news_title_5' => '2026 Market Research: The Future of Crypto', - 'news_desc_1' => 'We are excited to announce that BYRO\'s new binary system is live, offering faster settlement.', - 'news_desc_2' => 'To facilitate global users, we have added multiple fiat deposit methods including local bank transfers.', - 'news_desc_3' => 'BYRO is committed to compliant operations and has successfully obtained key licenses.', - 'news_desc_4' => 'Your security is our priority. We recommend all users enable Google 2FA.', - 'news_desc_5' => 'Deep dive into the 2026 crypto market trends and potential opportunities.', - 'news_meta' => 'Published on Feb 21, 2026 • Announcement', - 'help_subtitle' => 'Find answers to all your questions about using BYRO', - 'help_search_placeholder' => 'Search for issues, features or tutorials...', - 'getting_started' => 'Getting Started', - 'getting_started_desc' => 'Learn how to register and start your first trade.', - 'dep_with_title' => 'Deposit & Withdraw', - 'dep_with_desc' => 'Detailed guides on how to fund and withdraw from your account.', - 'trading_tutorials' => 'Trading Tutorials', - 'trading_tutorials_desc' => 'Master spot, contract, and binary trading skills.', - 'sec_acc_title' => 'Account Security', - 'sec_acc_desc' => 'Protect your account from unauthorized access.', - 'api_doc_title' => 'API Documentation', - 'api_doc_desc' => 'Complete API integration documentation for developers.', - 'contact_sup_title' => 'Contact Support', - 'contact_sup_desc' => 'Our team is available 24/7 if you encounter any issues.', - 'fees_content' => 'BYRO uses a transparent fee structure designed to provide competitive trading costs.', - 'platform_home' => 'Platform Home', - 'admin_panel' => 'Admin Panel', - 'agent_panel' => 'Agent Panel', - 'users' => 'Users', - 'agents' => 'Agents', - 'real_name' => 'KYC', - 'finance_management' => 'Finance', - 'finance_details' => 'Finance Details', - 'sec_contract_management' => 'Binary Management', + 'demo_title' => 'Professional Trading Terminal', + 'demo_subtitle' => 'Lower fees, faster transactions, and more powerful APIs. BYRO helps you reach the limits of every trade.', 'spot_trading' => 'Spot Trading', - 'contract_trading' => 'Contract Trading', - 'exchange_management' => 'Exchange Management', - 'mining_management' => 'Mining Management', - 'ai_control' => 'AI Control', - 'online_support' => 'Customer Service', - 'backend_settings' => 'System Settings', - 'personal_settings' => 'Profile Settings', + 'futures_trading' => 'Futures', + 'binary_trading' => 'Binary Options', + 'order_book' => 'Order Book', + 'buy_btn' => 'Buy', + 'sell_btn' => 'Sell', + 'buy_up' => 'Buy Up', + 'buy_down' => 'Buy Down', + 'leverage' => 'Leverage', + 'cycle' => 'Cycle', + 'quantity' => 'Quantity', + 'seconds' => 's', + 'profit' => 'Profit', + 'buy_long' => 'Buy Long', + 'sell_short' => 'Sell Short', + 'long' => 'Long', + 'short' => 'Short', + 'network_status_normal' => 'Network Normal', + 'latency' => 'Latency', + 'api_connected' => 'API Connected', + 'market_list' => 'Markets', + 'trade_history' => 'Trade History', ], ]; diff --git a/index.php b/index.php index 28f7d69..2de1ae9 100644 --- a/index.php +++ b/index.php @@ -247,6 +247,214 @@ require_once __DIR__ . '/includes/header.php'; + +
+
+

+

+ +

+
+ + +
+
+ + +
+
+ + + +
+
+
+ +
+
+ +
+
+ +
+
+
+ BTC/USDT 68,234.12 +
+
+ + +
+ + +
+
+ +
+
+ +
+
+ + +
+
+
+ BTC/USDT + 68,234.12 + +2.45% +
+
+ + + +
+
+
+ + + +
+
+
+ (0) + +
+
+
+ + +
+
+
+
+ + +
+ + +
+
+ (USDT) + (BTC) +
+
+ +
+
+ + +
+ +
+ +
+ +
+ + + + +
+
+ + +
+
+
+ BTC/USDT + 68,234.12 +
+
+ +
+
+ +
+
+
+
+ + +

@@ -287,16 +495,49 @@ require_once __DIR__ . '/includes/header.php'; const symbols = ['BTCUSDT', 'ETHUSDT', 'BNBUSDT', 'SOLUSDT', 'XRPUSDT', 'ADAUSDT', 'DOGEUSDT', 'DOTUSDT', 'MATICUSDT', 'LINKUSDT', 'SHIBUSDT']; const coinData = {}; +// Platform Demo Global State +let demoMode = 'spot'; +let currentDemoPrice = 68234.12; +const demoCoins = [ + { symbol: 'BTC', name: 'Bitcoin', price: 68234.12, change: '+2.45%' }, + { symbol: 'ETH', name: 'Ethereum', price: 3456.20, change: '+1.12%' }, + { symbol: 'BNB', name: 'Binance', price: 598.40, change: '-0.56%' }, + { symbol: 'SOL', name: 'Solana', price: 145.20, change: '+5.67%' }, + { symbol: 'XRP', name: 'Ripple', price: 0.62, change: '-1.23%' } +]; + async function fetchPrices() { try { const response = await fetch('https://api.binance.com/api/v3/ticker/24hr'); const data = await response.json(); - const relevant = data.filter(t => symbols.includes(t.symbol)); + // Existing UI update + const relevant = data.filter(t => symbols.includes(t.symbol)); relevant.forEach(t => { const symbol = t.symbol.replace('USDT', ''); updateUI(symbol, parseFloat(t.lastPrice), parseFloat(t.priceChangePercent)); }); + + // Sync Demo Module with Real BTC Price + const btcTicker = data.find(t => t.symbol === 'BTCUSDT'); + if (btcTicker) { + const realPrice = parseFloat(btcTicker.lastPrice); + // If demo price is too far from real price, sync it + if (Math.abs(currentDemoPrice - realPrice) > 500) { + currentDemoPrice = realPrice; + } + + // Sync demo market list + demoCoins.forEach(dc => { + const ticker = data.find(t => t.symbol === dc.symbol + 'USDT'); + if (ticker) { + dc.price = parseFloat(ticker.lastPrice); + dc.change = (ticker.priceChangePercent >= 0 ? '+' : '') + ticker.priceChangePercent + '%'; + } + }); + + if (typeof updateDemoMarkets === 'function') updateDemoMarkets(); + } // Handle USDT specially updateUI('USDT', 1.000, 0.01); @@ -310,6 +551,329 @@ function initPriceUpdate() { setInterval(fetchPrices, 5000); } +// Platform Demo Logic +function switchDemoMode(mode) { + demoMode = mode; + document.querySelectorAll('.mode-tab').forEach(t => { + t.classList.toggle('active', t.dataset.mode === mode); + }); + renderTradePanel(); +} + +function renderTradePanel() { + const panel = document.getElementById('demo-trade-panel'); + if (!panel) return; + + let html = ''; + const buyLabel = demoMode === 'futures' ? "" : ""; + const sellLabel = demoMode === 'futures' ? "" : ""; + + if (demoMode === 'spot' || demoMode === 'futures') { + html = ` +
+ + +
+ ${demoMode === 'futures' ? ` +
+ + 100x +
+ ` : ''} +
+ + + USDT +
+
+ + + BTC +
+
+
+ + 12,450.00 USDT +
+ + +
+ `; + } else if (demoMode === 'binary') { + html = ` +
+
+ + +
+
+ + + USDT +
+
+
+
+ + 8.00 USDT +
+
+ + +
+ `; + } + panel.innerHTML = html; +} + +function initDemoModule() { + const canvas = document.getElementById('demo-main-chart'); + const mobileCanvas = document.getElementById('demo-mobile-chart'); + if (!canvas) return; + + const ctx = canvas.getContext('2d'); + const mCtx = mobileCanvas ? mobileCanvas.getContext('2d') : null; + + const marketList = document.getElementById('demo-market-list'); + const orderBook = document.getElementById('demo-order-book'); + const priceDisplays = document.querySelectorAll('.demo-price'); + const changeDisplays = document.querySelectorAll('.demo-change'); + + let candles = []; + const maxCandles = 50; + + // Initialize OHLC candles + function generateInitialData() { + let lastClose = currentDemoPrice; + for(let i=0; i c.l)) * 0.999; + const maxPrice = Math.max(...candles.map(c => c.h)) * 1.001; + const range = maxPrice - minPrice; + + context.clearRect(0, 0, w, h); + + // Grid Lines & Price Axis + context.strokeStyle = 'rgba(255,255,255,0.05)'; + context.setLineDash([5, 5]); + context.font = '10px Arial'; + context.fillStyle = '#848e9c'; + for(let i=0; i<6; i++) { + const y = paddingTop + (chartH / 5) * i; + const price = maxPrice - (range / 5) * i; + context.beginPath(); context.moveTo(0, y); context.lineTo(chartW, y); context.stroke(); + context.fillText(price.toFixed(2), chartW + 5, y + 4); + } + context.setLineDash([]); + + const candleW = (chartW / maxCandles) * 0.8; + const candleSpacing = (chartW / maxCandles); + + candles.forEach((c, i) => { + const x = candleSpacing * i + (candleSpacing - candleW) / 2; + const color = c.c >= c.o ? '#0ecb81' : '#f6465d'; + + // High/Low line + const hY = paddingTop + (1 - (c.h - minPrice) / range) * chartH; + const lY = paddingTop + (1 - (c.l - minPrice) / range) * chartH; + context.strokeStyle = color; + context.lineWidth = 1; + context.beginPath(); + context.moveTo(x + candleW / 2, hY); + context.lineTo(x + candleW / 2, lY); + context.stroke(); + + // Body + const oY = paddingTop + (1 - (c.o - minPrice) / range) * chartH; + const cY = paddingTop + (1 - (c.c - minPrice) / range) * chartH; + context.fillStyle = color; + context.fillRect(x, Math.min(oY, cY), candleW, Math.abs(oY - cY) || 1); + + // Volume bar + const volH = (c.v / 150) * 40; + context.globalAlpha = 0.2; + context.fillRect(x, h - 5, candleW, -volH); + context.globalAlpha = 1.0; + }); + + // Current Price Line + const lastCandle = candles[candles.length - 1]; + const lastY = paddingTop + (1 - (lastCandle.c - minPrice) / range) * chartH; + context.strokeStyle = '#f0b90b'; + context.setLineDash([2, 2]); + context.beginPath(); + context.moveTo(0, lastY); + context.lineTo(chartW, lastY); + context.stroke(); + context.setLineDash([]); + + // Price Label on axis + context.fillStyle = '#f0b90b'; + context.fillRect(chartW, lastY - 8, paddingRight, 16); + context.fillStyle = '#000'; + context.fillText(lastCandle.c.toFixed(2), chartW + 5, lastY + 4); + } + + window.updateDemoMarkets = function() { + if (!marketList) return; + marketList.innerHTML = demoCoins.map(c => ` +
+
+ ${c.symbol} + /USDT +
+
+
${c.price.toLocaleString()}
+
${c.change}
+
+
+ `).join(''); + } + + function updateOrderBook() { + if (!orderBook) return; + let html = ''; + const lastC = candles[candles.length - 1].c; + // Sells + for(let i=0; i<8; i++) { + const p = (lastC + (8 - i) * 1.2).toFixed(2); + const q = (Math.random() * 1.5).toFixed(4); + const depth = Math.random() * 80; + html += `
+
+ ${p}${q} +
`; + } + // Mid Price + html += `
${lastC.toFixed(2)}
`; + // Buys + for(let i=0; i<8; i++) { + const p = (lastC - (i + 1) * 1.2).toFixed(2); + const q = (Math.random() * 1.5).toFixed(4); + const depth = Math.random() * 80; + html += `
+
+ ${p}${q} +
`; + } + orderBook.innerHTML = html; + } + + let tickCount = 0; + function tick() { + const last = candles[candles.length - 1]; + const volatility = demoMode === 'binary' ? 20 : 10; + const change = (Math.random() - 0.5) * volatility; + + // Update current candle + last.c += change; + last.h = Math.max(last.h, last.c); + last.l = Math.min(last.l, last.c); + last.v += Math.random() * 5; + + tickCount++; + // Create new candle every 5 ticks + if(tickCount >= 5) { + tickCount = 0; + candles.shift(); + const newOpen = last.c; + candles.push({o: newOpen, h: newOpen, l: newOpen, c: newOpen, v: Math.random() * 50 + 10}); + } + + const formatted = last.c.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); + currentDemoPrice = last.c; // Update global state + priceDisplays.forEach(el => el.innerText = formatted); + + const priceInput = document.querySelector('.demo-price-input'); + if (priceInput) priceInput.value = formatted; + + updateOrderBook(); + drawChart(ctx, canvas); + if (mCtx) drawChart(mCtx, mobileCanvas); + } + + function updateHistory() { + const historyList = document.getElementById('demo-history-list'); + if (!historyList) return; + + const now = new Date(); + const mockHistory = [ + { pair: 'BTC/USDT', type: 'buy', price: (currentDemoPrice - 5).toFixed(2), amount: '0.0450', time: now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() }, + { pair: 'BTC/USDT', type: 'sell', price: (currentDemoPrice + 12).toFixed(2), amount: '0.1200', time: now.getHours() + ':' + (now.getMinutes()-1) + ':24' } + ]; + + historyList.innerHTML = ` +
+ + + + + + + + + + + ${mockHistory.map(h => ` + + + + + + + `).join('')} + +
${h.time}${h.type === 'buy' ? '' : ''}${h.price}${h.amount}
+
+ `; + } + + switchDemoMode('spot'); + updateHistory(); + window.updateDemoMarkets(); + setInterval(tick, 500); // Faster update for better dynamic feel + window.addEventListener('resize', () => { + drawChart(ctx, canvas); + if (mCtx) drawChart(mCtx, mobileCanvas); + }); +} + + function updateUI(symbol, price, change) { const card = document.querySelector(`.coin-card[data-symbol="${symbol}"]`); if (!card) return; @@ -393,6 +957,7 @@ async function initSparklines() { initSparklines(); initPriceUpdate(); +initDemoModule();