INTEGRATED PLATFORM · LIVE SYNC
1,247 live sessions
📱 MOBILE APP
9:41
DASHBOARD 🔔
BTC$67,420▲2.34%
ETH$3,541▲1.87%
SOL$182.6▲4.21%
NVDA$875.2▲2.95%
BTC$67,420▲2.34%
ETH$3,541▲1.87%
TOTAL PORTFOLIO
$84,210
▲ +$3,142 (+3.88%) today
MY ASSETS
BTC
$67,420
+2.34%
Ξ
ETH
$3,541
+1.87%
T
TSLA
$245.70
-1.23%
0 trades placed via app
📱 OPEN FULL APP →
🛡️ ADMIN PANEL
TIADMIN SUPER ADMIN
1,247 live
USERS
24,891
+0 today
SESSIONS
1,247
● LIVE
REVENUE
$184K
▲ MoM
TRADES
0
All time
LIVE ACTIVITY
@alpha_whale opened 2.5 BTC long
@sigma_x stop-loss triggered
new signup — trader_7842 joined
🔑 YOUR ACCOUNT (ADMIN ACCESS)
Email: [email protected]
Password: User@1234
Role: SUPER ADMIN
🛡️ OPEN ADMIN PANEL →
TRADER'S ISLAND
✕ CLICK OUTSIDE TO CLOSE
🎨
CHOOSE THEME
NIGHT TRADER
Dark · Green · Default
ARCADE PORTAL
Purple · Bold · CrazyGames
NEON GAMING
Purple · Cyber · Glow
WALL STREET PRO
Gold · Navy · Professional
NEON SUNSET
Orange · Coral · Warm
ICE TERMINAL
Cyan · Arctic · Clean
DAY LIGHT
White · Green · Bright
🕯️ CANDLES CATCH
🐢 🐇 1.0×
SCORE: 0
🕯️
CANDLES CATCH
Catch the green candles — dodge the red ones!
Tap or click to move. How long can you last?
Q 1 / 10
IDENTIFY THIS PATTERN
What is this candlestick pattern?
Hammer
BULLISH
EN
हि
ਪੰ
GAME OVER
Score: 0 · Best: 0
☀️ SWITCHED TO DAY
TRADER'SISLAND
TRADING PLATFORM
🎨
🔔
🌙
BTC$67,420▲2.34%
ETH$3,541▲1.87%
SOL$182.6▲4.21%
AAPL$189.34▼0.42%
NVDA$875.2▲2.95%
BTC$67,420▲2.34%
ETH$3,541▲1.87%
SOL$182.6▲4.21%
NEW
🕯️
CANDLES
HOT
🌊
LIQUID
FUN
🏃
JUMP
QUIZ
🎯
GUESS
📣
FEATURED PARTNER
Loading offer...
LEARN MORE →
HOT
MY ASSETS VIEW ALL →
BTC
0.42 Bitcoin
$67,420
+2.34%
Ξ
ETH
3.8 Ethereum
$3,541
+1.87%
SOL
48 Solana
$182.60
+4.21%
T
TSLA
12 shares
$245.70
-1.23%
MARKET NEWS
Bitcoin breaks $68K — bulls target new ATH
CRYPTO · 12 min ago
Tesla shares slip after production guidance miss
STOCKS · 34 min ago
Fed holds rates — traders eye June decision
MACRO · 1 hr ago
BTC / USDT
Perpetual · Crypto
🔍
ALL
🔶
💱
📈
🇺🇸
$67,420
▲ +2.34%
O 65,878 H 68,120 L 65,200 C 67,420 -1.04 (-1.54%)
1m
5m
15m
1H
4H
1D
1W
ƒ
68,500 66,500 64,500
67420
RSI 14 · 61.4
70 30
RSI 1461.4
MACDBULL ▲
EMA 20$66,340
VOL12.8K
24H RANGE
$64,820 – $68,140
VOL: 12,841
Mark Price
$67,420.50
Index Price
$67,418.20
Funding Rate
+0.0100%
Open Interest
$4.82B
24H Volume
$28.4B
Liquidations
$142M
EMOTION AI
🌙
72
EXTREME GREED
⚠️
GREED ALERT
High FOMO & greed detected. Consider reducing position size.
EMOTIONAL STATE
GREED
78%
FOMO
65%
OVERCONF
54%
DISCIPLINE
41%
FEAR
22%
QUICK TRADE
🌙
OPEN ORDER
PAIR
BTC / USDT
AMOUNT (USD)
$5,000
25%
50%
75%
MAX
🌐Google
🍎Apple
OR EMAIL
EMAIL
📧
PASSWORD
🔒👁️
Remember me
Forgot password?
👆FINGERPRINT
🆔FACE ID
No account? Create one →
1
2
3
FULL NAME
👤
EMAIL
📧
PASSWORD
🔒
BASICFREE
Paper trading · 10 alerts · Community
ELITE$99/mo
Everything · API · White-label · No limits
Already have account? Sign In →
MY PROFILE
🌙
?
TOTAL PORTFOLIO
$0
INVESTED
$0
PROFIT / LOSS
$0
WIN RATE
0%
0
TRADES
$0
TOTAL P&L
0%
WIN RATE
📈 TRADE HISTORY
🛒 SHOP HISTORY
No trades yet.
Tap ▲ BUY or ▼ SELL on the Chart screen.
MARKETS
LIVE
🌐 ALL
🔶 CRYPTO
💱 FOREX
📈 STOCKS
🇺🇸 US STOCKS
🚀 TOP GAINERS
📉 TOP LOSERS
Loading...
SORT BY CHANGE
🎮 GAMES
BEST: 0
TRADING GAMES
Learn trading while playing!
Beat your high score on all 4 games 🏆
TOTAL SCORE
0
GAMES PLAYED
0
RANK
#—
SELECT A GAME
quiz
🕯️
NEW
CANDLES
CATCH
Catch green candles, dodge red ones. Learn patterns while playing!
BEST SCORE
0
▶ PLAY
🌊
HOT
LIQUID-
ATION SEA
Drag up to pump price. Survive the rising liquidation wave!
BEST SCORE
0
▶ PLAY
liquidation
🌊
HOT
LIQUID-
ATION SEA
Drag up to pump price. Survive the rising liquidation wave!
BEST SCORE
0
▶ PLAY
game2
🏃
FUN
CRYPTO
JUMP
Jump over bearish red candles. How far can you run?
BEST SCORE
0
▶ PLAY
game3
🎯
QUIZ
GUESS THE
CANDLE
Identify candle & chart patterns. Test your trading knowledge!
BEST SCORE
0
▶ PLAY
deepend
🌊
NEW
THE DEEP END — LIQUIDATION SIM
Trade with leverage in a shark-infested ocean! Move your diver, set leverage & amount, survive liquidation waves. How long can you profit before the sharks get you? 🦈
▶ DIVE IN
cshero
📊
PRO
CANDLESTICK HERO PRO — MASTER EDITION
Random chart generated — identify the candlestick pattern! Streak bonuses, 10 patterns to master. Doji, Hammer, Engulfing, Morning Star & more. Score points before you miss! 🎯
▶ PLAY
sniper
🎯
ARCADE
CHART SNIPER — NEON ARCADE
Tap the GOLDEN candles to profit. Avoid LIQUIDATION spikes. Every miss costs $50. Streak = more speed + bigger gains! 🔫
▶ INITIALIZE TRADE
chess
VS AI
CHESS
Play chess vs AI. Classic strategy — build focus & discipline like a pro trader!
▶ PLAY
ludo
🎲
4P
LUDO
4-player Ludo with dice! Race your tokens home. Play solo vs 3 AI bots!
▶ PLAY
RECENT ACTIVITY
♟ CHESS
YOUR TURN (WHITE)
AI (BLACK)
YOU (WHITE)
CAPTURED
Tap a piece to select, tap highlighted square to move.
🎲 LUDO
ROLL DICE TO START
🎲
YOUR TURN
-
Home: 0/4
Safe squares: 0
Profit $0
LEVERAGE 10x
AMOUNT $1.0k
Risk LOW
UP: SHORT PROFIT • DOWN: LONG PROFIT • $1M WHALE MODE ACTIVE
CANDLESTICK HERO PRO
Streak: 0
Score
0
MASTER MARKET SENTIMENT
Account Balance
$1,000
Streak: 0x
Volatility
HIGH
CHART SNIPER
Tap the GOLDEN CANDLES to profit.
Avoid LIQUIDATION SPIKES.
Every miss costs $50.
⚡ VOLT OPTION
Order Executed!
Mastering Options
Tutorial & Concepts
English
हिंदी
ਪੰਜਾਬੀ
VOLT TRADE
Demo Balance
$10,000.00
Options
Crypto
Forex
0.00
Strategy Visualizer
Projected Price---
Est. P&L
+$0.00
Live Analysis
Volatility (IV)14.2%
Put-Call Ratio1.08
Sentiment: Neutral-Bullish
Calls
Strike
Puts
Order Summary
Selection---
Lot Size---
Price / Unit---
Total Buy Cost$0.00
Breakeven---
Live Positions
0 Open
No active positions
Total P&L
$0.00
Win Rate
0%
Total Order Cost: $0.00
LEARN
🔍
Trading Academy
Master trading from basics to advanced strategies with interactive lessons
LVL 3
620 / 1000 XP
MODULES
📈
Trading Basics
8 lessons · ~30 min
🕯️
Candlestick Patterns
12 lessons · ~45 min
📖
📊
Technical Indicators
15 lessons · ~60 min
🔓
🧠
Trading Psychology
10 lessons · ~40 min
🔒
Risk Management
10 lessons · ~35 min
🔒
🤖
Algo & Bot Trading
8 lessons · ~50 min
🔒
Loading...
MARKET NEWS
🔄
MARKET SENTIMENT
72
GREED
Fear vs Greed Index
EXTREME FEARNEUTRALEXTREME GREED
ALL
CRYPTO
STOCKS
MACRO
DeFi
CryptoNews · CRYPTO
Bitcoin breaks $68K resistance — analysts target $72K next
12 min ago▲ BULLISHBTC
Reuters · MACRO
Fed minutes reveal caution on rate cuts — markets reprice expectations
38 min ago▼ BEARISHMACRO
Bloomberg · STOCKS
NVDA surges 3% on AI chip demand forecast beating expectations
1 hr ago◆ NEUTRALNVDA
DeFiPulse · DeFi
Ethereum DeFi TVL hits $58B — highest since bull peak in 2021
2 hr ago▲ BULLISHETH
WSJ · MACRO
US inflation drops to 2.8% — first time below 3% in 18 months
3 hr ago▲ BULLISHUSD
FT · STOCKS
Tesla misses delivery targets — shares fall 1.2% in pre-market
4 hr ago▼ BEARISHTSLA
TRADE JOURNAL
📥
0
TRADES
0%
WIN RATE
$0
TOTAL P&L
✏️ ADD JOURNAL ENTRY
No entries yet.
Place trades to auto-generate entries.
LEADERBOARD
🔄
💰 P&L
🎯 WIN RATE
🔥 STREAK
📊 VOLUME
SX
@sigma_x
+$142K
2
1
AW
@alpha_whale
+$284K
A2
@alpha_22
+$98K
3
4
RM
@risk_mgr
ELITE · 198 trades
+$98.4K
▲ 67% win
5
BL
@btc_lord
ELITE · 156 trades
+$84K
▲ 64% win
6
FQ
@fx_queen
PRO · 244 trades
+$62K
▲ 61% win
?
You
Login to see rank
RISK CALCULATOR
POSITION SIZING & LIQUIDATION
LEVERAGE
10×
20×
50×
100×
ACCOUNT BALANCE (USD)
USD
ENTRY PRICE
USDT
POSITION SIZE
USD
STOP LOSS (%)
%
MAX LOSS
$200
RISK % OF ACCOUNT
2.0%
LIQUIDATION PRICE
$64,043
LIQ DISTANCE
-5.0%
REWARD/RISK RATIO
1 : 3.0
SUGGESTED SIZE
$200
⚠️
At 5× leverage with 2% stop: max loss is $200 (2% of account). Liquidation occurs at $64,043 — 5% below entry.
AI MENTOR
🗑️
🤖
ARIA — Trading AI
Ask me anything about trading, strategy, risk management, or chart analysis
👋 Hi! I'm ARIA, your AI trading mentor. I can help you with:

• Reading charts & patterns
• Risk management strategies
• Understanding indicators
• Trade psychology tips

What would you like to learn today?
How do I read RSI?
What is a stop loss?
Explain MACD
Best risk/reward ratio?
What causes liquidation?
🛡️ ADMIN LOGIN
SUPER ADMIN ACCESS ONLY
ADMIN EMAIL
ADMIN PASSWORD
SECRET CODE
ALL SCREENS
NEWS
LEARN
AI ARIA
AI
TRADE
MOOD AI
JOURNAL
NEW
RANKS
TOP
RISK CALC
VOLT OPT
SIM
ACCOUNT
SIGN UP
🎁
GIFTS EARN
NEW
📺
WATCH EARN
NEW
📺 WATCH & EARN
🌙
VIDEO REWARDS
Watch. Learn.
Earn Tokens.
Watch trading videos & earn ₮ tokens and XP for every video completed.
TODAY'S VIDEOS 2 / 5
₮150
EARNED TODAY
₮1,240
TOTAL EARNED
48
VIDEOS WATCHED
5
DAY STREAK
FEATURED VIDEO
FEATURED
12:34
How to Read Candlestick Charts Like a Pro
TradersIsland Academy · 12 min
+₮50 · +150 XP
WATCH QUEUE
Introduction to Technical Analysis
8 min · +₮30 · +80 XP
DONE ✓
Support & Resistance Levels Explained
10 min · +₮40 · +100 XP
DONE ✓
RSI & MACD — The Power Combo
15 min · +₮60 · +160 XP
Risk Management — The #1 Trading Skill
18 min · +₮70 · +180 XP
🔒
Advanced Options Strategies (Bonus)
Unlock at Level 5 · +₮100 · +250 XP
LOCKED
HOME
MARKET
CHART
GAMES
VOLT
MORE
🎁 GIFTS & EARN
🌙
REWARDS CENTER
Earn While You
Trade & Learn
Complete tasks, refer friends & unlock
exclusive rewards every day.
YOUR XP 2,450 / 5,000
LEVEL 4 — 2,550 XP to LEVEL 5
₮840
TOKENS EARNED
12
REFERRALS
7
DAY STREAK
DAILY TASKS 2/5 DONE
📈
Make 1 Trade
+50 XP · +₮10 token
DONE ✓
📰
Read 2 News Articles
+30 XP · +₮5 token
DONE ✓
🎮
Play a Game
+80 XP · +₮15 token
🎯
Complete a Quiz
+100 XP · +₮20 token
🔒
Reach Level 5
+500 XP · +₮100 token · RARE BADGE
LOCKED
REFER & EARN
Share your referral code
Earn ₮50 tokens for every friend who joins & makes their first trade.
TI-ALPHA-99
12
REFERRED
₮600
EARNED
REDEEM REWARDS
🎟️
VIP PASS
1 week premium
₮500
🏆
RARE BADGE
Profile flex
₮200
💸
CASH BONUS
$5 demo credit
₮300
🎨
THEME UNLOCK
Exclusive skin
₮150
// Admin panel moved to tiadmin.html — disabled in this file window._openView = function(v){ var appView = document.getElementById('appView'); var splitHome = document.getElementById('splitHome'); if(v==='app'){ if(appView) appView.style.display='block'; if(splitHome) splitHome.style.display='none'; } else if(v==='mode'){ if(appView) appView.style.display='none'; if(splitHome) { splitHome.style.display='flex'; } } }; // ═══ REMEMBER ME ENGINE ═══ var REMEMBERED_KEY = 'ti_remembered_accounts'; var SESSION_KEY = 'ti_active_session'; function getSavedAccounts(){ try{ return JSON.parse(localStorage.getItem(REMEMBERED_KEY)||'[]'); }catch(e){ return []; } } function saveRememberedAccount(user, pass){ var accounts = getSavedAccounts(); // Remove existing entry for this email accounts = accounts.filter(function(a){ return a.email !== user.email; }); // Add to front accounts.unshift({ email:user.email, pass:pass, name:user.name, avatar:user.avatar, plan:user.plan, role:user.role||'', savedAt:Date.now() }); // Keep max 5 accounts accounts = accounts.slice(0,5); localStorage.setItem(REMEMBERED_KEY, JSON.stringify(accounts)); // Also save active session localStorage.setItem(SESSION_KEY, JSON.stringify({ email:user.email, pass:pass })); renderSavedAccounts(); } function removeSavedAccount(email){ var accounts = getSavedAccounts().filter(function(a){ return a.email !== email; }); localStorage.setItem(REMEMBERED_KEY, JSON.stringify(accounts)); // Clear session if same account try{ var sess = JSON.parse(localStorage.getItem(SESSION_KEY)||'{}'); if(sess.email === email) localStorage.removeItem(SESSION_KEY); }catch(e){} renderSavedAccounts(); } function renderSavedAccounts(){ var wrap = document.getElementById('savedAccountsList'); if(!wrap) return; var accounts = getSavedAccounts(); if(!accounts.length){ wrap.style.display='none'; return; } wrap.style.display = 'block'; var planColor = function(p,r){ return r==='superadmin'?'rgba(255,204,0,.12)':p==='ELITE'?'rgba(191,95,255,.12)':p==='PRO'?'rgba(0,255,136,.12)':'rgba(0,212,255,.12)'; }; var planText = function(p,r){ return r==='superadmin'?'var(--no)':p==='ELITE'?'var(--np)':p==='PRO'?'var(--ng)':'var(--nc)'; }; var html = '
SAVED ACCOUNTS
'; accounts.forEach(function(acc){ html += '
'; html += '
'+acc.avatar+'
'; html += '
'+acc.name+'
'; html += ''+(acc.role==='superadmin'?'🛡️ ADMIN':acc.plan)+''; html += ''; html += '
'; }); wrap.innerHTML = html; } window.quickLogin = function(email, pass){ // Fill fields and trigger login var emailEl = document.getElementById('pLoginEmail'); var passEl = document.getElementById('pLoginPass'); if(emailEl) emailEl.value = email; if(passEl) passEl.value = pass; // Animate fill var finp = document.querySelectorAll('.finp'); finp.forEach(function(f){ f.style.borderColor='rgba(0,255,136,.4)'; setTimeout(function(){ f.style.borderColor=''; },800); }); // Auto submit setTimeout(function(){ var btn = document.getElementById('pLoginBtn'); if(btn) btn.click(); }, 300); }; // Remember-me checkbox visual toggle document.addEventListener('click', function(e){ if(e.target.closest('[onclick*="pRememberMe"]') || e.target.id === 'pRememberBox' || e.target.id === 'pRememberMe'){ var cb = document.getElementById('pRememberMe'); var box = document.getElementById('pRememberBox'); if(!cb || !box) return; setTimeout(function(){ box.style.background = cb.checked ? 'rgba(0,255,136,.12)' : 'transparent'; box.style.borderColor = cb.checked ? 'rgba(0,255,136,.3)' : 'var(--br)'; box.textContent = cb.checked ? '✓' : ''; }, 0); } }); // Auto-restore session on load (function autoRestoreSession(){ try{ var sess = JSON.parse(localStorage.getItem(SESSION_KEY)||'null'); if(sess && sess.email && sess.pass){ // Navigate to login screen then auto-login after a tick setTimeout(function(){ var r = window._appLogin ? window._appLogin(sess.email, sess.pass) : null; // Try via DB internal if(!r){ var emailEl = document.getElementById('pLoginEmail'); var passEl = document.getElementById('pLoginPass'); if(emailEl) emailEl.value = sess.email; if(passEl) passEl.value = sess.pass; var btn = document.getElementById('pLoginBtn'); if(btn) btn.click(); } }, 800); } }catch(e){} // Render saved accounts list on login screen load renderSavedAccounts(); })(); // ═══ GIFTS & EARN — copy referral code ═══ window.copyRefCode = function(){ var code = document.getElementById('giftsRefCode'); var btn = document.getElementById('giftsRefCopyBtn'); if(!code || !btn) return; try { navigator.clipboard.writeText(code.textContent.trim()).then(function(){ btn.textContent = 'COPIED!'; btn.style.background = 'rgba(0,255,136,.2)'; btn.style.borderColor = 'rgba(0,255,136,.5)'; setTimeout(function(){ btn.textContent = 'COPY'; btn.style.background = ''; btn.style.borderColor = ''; }, 2000); }); } catch(e) { btn.textContent = 'COPIED!'; setTimeout(function(){ btn.textContent = 'COPY'; }, 2000); } }; // ═══ GIFTS & EARN — ADMIN JS ═══ window.agSwitchTab = function(tab) { // Update tab styles document.querySelectorAll('.agTab').forEach(function(t) { var isActive = t.getAttribute('onclick') === "agSwitchTab('" + tab + "')"; t.style.borderBottom = isActive ? '2px solid var(--ng)' : '2px solid transparent'; t.style.color = isActive ? 'var(--ng)' : 'var(--tm)'; }); // Show/hide content panels document.querySelectorAll('.agTabContent').forEach(function(c) { c.style.display = 'none'; }); var panel = document.getElementById('agTab-' + tab); if (panel) panel.style.display = 'block'; }; window.adminGiftsSave = function() { addAudit && addAudit('INFO', 'Gifts & Earn config saved', 'admin', 'Tasks/rewards updated'); showToast && showToast('GIFTS SAVED', 'Configuration updated successfully.', 'success'); }; window.adminGiftsReset = function() { if (confirm('Reset all Gifts & Earn config to defaults?')) { showToast && showToast('RESET', 'Config reset to defaults.', 'warn'); } }; window.agToggleTask = function(btn) { var isDisable = btn.textContent === 'DISABLE'; btn.textContent = isDisable ? 'ENABLE' : 'DISABLE'; var row = btn.closest('tr'); if (row) { var badge = row.querySelector('.badge'); if (badge) { badge.textContent = isDisable ? 'DISABLED' : 'ACTIVE'; badge.className = isDisable ? 'badge br2' : 'badge bo'; } } }; window.agAddTask = function() { var tbl = document.getElementById('agTasksTable'); if (!tbl) return; var name = prompt('Task name:'); if (!name) return; var xp = prompt('XP reward:', '50'); var tokens = prompt('Token reward:', '10'); var row = tbl.insertRow(-1); row.innerHTML = '' + name + '' + '' + '' + 'custom' + 'ACTIVE' + ''; }; window.agAddReward = function() { var name = prompt('Reward name:'); if (!name) return; var cost = prompt('Token cost:', '100'); showToast && showToast('REWARD ADDED', name + ' added to shop.', 'success'); }; window.agAwardTokens = function(btn, user) { var amount = prompt('Award how many tokens to @' + user + '?', '50'); if (!amount || isNaN(amount)) return; var row = btn.closest('tr'); var balCell = row ? row.cells[3] : null; if (balCell) { var cur = parseInt(balCell.textContent.replace(/[^\d]/g,'')) || 0; balCell.textContent = '₮' + (cur + parseInt(amount)).toLocaleString(); balCell.style.color = 'var(--ng)'; setTimeout(function(){ balCell.style.color = 'var(--no)'; }, 1000); } showToast && showToast('TOKENS AWARDED', '₮' + amount + ' sent to @' + user, 'success'); addAudit && addAudit('INFO', 'Tokens awarded', 'admin', '₮' + amount + ' → @' + user); }; window.agDeductTokens = function(btn, user) { var amount = prompt('Deduct how many tokens from @' + user + '?', '10'); if (!amount || isNaN(amount)) return; var row = btn.closest('tr'); var balCell = row ? row.cells[3] : null; if (balCell) { var cur = parseInt(balCell.textContent.replace(/[^\d]/g,'')) || 0; var newBal = Math.max(0, cur - parseInt(amount)); balCell.textContent = '₮' + newBal.toLocaleString(); balCell.style.color = 'var(--nr)'; setTimeout(function(){ balCell.style.color = 'var(--no)'; }, 1000); } showToast && showToast('TOKENS DEDUCTED', '₮' + amount + ' removed from @' + user, 'warn'); addAudit && addAudit('WARN', 'Tokens deducted', 'admin', '₮' + amount + ' ← @' + user); }; window.agBulkAward = function() { var amount = prompt('Award tokens to ALL users — how many?', '10'); if (!amount || isNaN(amount)) return; if (!confirm('Award ₮' + amount + ' to all users? This cannot be undone.')) return; showToast && showToast('BULK AWARD SENT', '₮' + amount + ' awarded to all users.', 'success'); addAudit && addAudit('WARN', 'Bulk token award', 'admin', '₮' + amount + ' sent to all users'); }; window.agFilterUsers = function(query) { var rows = document.querySelectorAll('#agUsersTable tr:not(:first-child)'); rows.forEach(function(row) { var name = row.cells[0] ? row.cells[0].textContent.toLowerCase() : ''; row.style.display = name.includes(query.toLowerCase()) ? '' : 'none'; }); }; // ═══ WATCH & EARN — APP JS ═══ var _watchTimer = null; var _watchProgress = 0; var _awClickEvents = []; window.watchEarnPlay = function(el, videoId) { var modal = document.getElementById('watchPlayerModal'); if (!modal) return; modal.style.display = 'flex'; var titles = { featured:'How to Read Candlestick Charts', v3:'RSI & MACD — The Power Combo', v4:'Risk Management — The #1 Skill' }; var rewards = { featured:'+₮50 · +150 XP', v3:'+₮60 · +160 XP', v4:'+₮70 · +180 XP' }; var durations = { featured:120, v3:90, v4:80 }; var titleEl = document.getElementById('wPlayerTitle'); var rewardEl = document.getElementById('wPlayerReward'); var statusEl = document.getElementById('wPlayerStatus'); var progBar = document.getElementById('wProgressBar'); var claimBtn = document.getElementById('wClaimBtn'); if (titleEl) titleEl.textContent = titles[videoId]||'Video'; if (rewardEl) rewardEl.textContent = rewards[videoId]||'+₮50'; if (statusEl) statusEl.textContent = 'PLAYING...'; if (progBar) progBar.style.width = '0%'; if (claimBtn) claimBtn.style.display = 'none'; _watchProgress = 0; clearInterval(_watchTimer); // Log click event _awClickEvents.unshift({time:'Just now',user:'@you',event:'PLAY',video:titles[videoId]||videoId,watchTime:'0s',result:'watching'}); var dur = (durations[videoId]||60) * 1000 / 100; _watchTimer = setInterval(function() { _watchProgress += 1; if (progBar) progBar.style.width = _watchProgress + '%'; if (_watchProgress >= 100) { clearInterval(_watchTimer); if (statusEl) statusEl.textContent = 'COMPLETE! 🎉'; if (claimBtn) claimBtn.style.display = 'block'; _awClickEvents[0].result = 'COMPLETED'; } }, dur < 30 ? 30 : dur); }; window.watchEarnClose = function() { clearInterval(_watchTimer); var modal = document.getElementById('watchPlayerModal'); if (modal) modal.style.display = 'none'; }; window.watchEarnClaim = function() { watchEarnClose(); showToast && showToast('REWARD CLAIMED!', 'Tokens & XP added to your account.', 'success'); var lbl = document.getElementById('watchDailyLbl'); if (lbl) { var parts = lbl.textContent.split(' / '); var done = Math.min(parseInt(parts[0])+1, parseInt(parts[1])); lbl.textContent = done + ' / ' + parts[1]; } }; // ═══ WATCH & EARN — ADMIN JS ═══ window.awSwitchTab = function(tab) { document.querySelectorAll('.awTab').forEach(function(t) { var isActive = t.getAttribute('onclick') === "awSwitchTab('" + tab + "')"; t.style.borderBottom = isActive ? '2px solid var(--ng)' : '2px solid transparent'; t.style.color = isActive ? 'var(--ng)' : 'var(--tm)'; }); document.querySelectorAll('.awTabContent').forEach(function(c) { c.style.display = 'none'; }); var panel = document.getElementById('awTab-' + tab); if (panel) panel.style.display = 'block'; }; window.adminWatchSave = function() { addAudit && addAudit('INFO','Watch & Earn config saved','admin','Settings updated'); showToast && showToast('SAVED','Watch & Earn configuration updated.','success'); }; window.awToggleVideo = function(btn) { var isDisable = btn.textContent.trim() === 'DISABLE'; btn.textContent = isDisable ? 'ENABLE' : 'DISABLE'; var row = btn.closest('tr'); if (!row) return; var badge = row.querySelector('.badge'); if (badge) { badge.textContent = isDisable ? 'DISABLED' : 'LIVE'; badge.className = isDisable ? 'badge br2' : 'badge bo'; } }; window.awAddVideo = function() { var title = prompt('Video title:'); if (!title) return; var platform = prompt('Platform (YouTube/Vimeo/Custom):', 'YouTube'); var url = prompt('Video ID or URL:', ''); var tokens = prompt('Token reward:', '40'); var xp = prompt('XP reward:', '100'); var dur = prompt('Duration (e.g. 10 min):', '10 min'); var tbl = document.getElementById('awVideosTable'); if (!tbl) return; var row = tbl.insertRow(-1); var ptBadge = platform === 'YouTube' ? '▶ YT' : '' + (platform||'YT') + ''; row.innerHTML = '' + title + '' + '' + ptBadge + '' + '' + '' + (dur||'?') + '' + '' + '' + '0' + '' + 'LIVE' + ''; showToast && showToast('VIDEO ADDED', title + ' added.', 'success'); addAudit && addAudit('INFO','Video added','admin',title); }; window.awFilterUsers = function(query) { document.querySelectorAll('#awUsersTable tr:not(:first-child)').forEach(function(row) { var name = row.cells[0] ? row.cells[0].textContent.toLowerCase() : ''; row.style.display = name.includes(query.toLowerCase()) ? '' : 'none'; }); }; window.awSortUsers = function(by) { var tbl = document.getElementById('awUsersTable'); if (!tbl) return; var rows = Array.from(tbl.querySelectorAll('tr:not(:first-child)')); var colMap = {tokens:5, time:2, videos:1, xp:4}; var col = colMap[by] || 5; rows.sort(function(a,b) { var av = parseInt(a.cells[col]&&a.cells[col].textContent.replace(/[^\d]/g,''))||0; var bv = parseInt(b.cells[col]&&b.cells[col].textContent.replace(/[^\d]/g,''))||0; return bv - av; }); rows.forEach(function(r){ tbl.querySelector('tbody') ? tbl.querySelector('tbody').appendChild(r) : tbl.appendChild(r); }); }; window.awViewUser = function(username) { var panel = document.getElementById('awUserDetail'); var title = document.getElementById('awUserDetailTitle'); if (!panel || !title) return; title.textContent = '@' + username + ' — Video Watch History'; panel.style.display = 'block'; panel.scrollIntoView({behavior:'smooth', block:'start'}); }; window.awRefreshClickLog = function() { showToast && showToast('REFRESHED','Click log updated.','success'); var now = new Date(); var timeStr = now.getHours() + ':' + String(now.getMinutes()).padStart(2,'0'); var tbl = document.getElementById('awClickLog'); if (!tbl) return; var row = tbl.insertRow(1); var events = ['PLAY','CLAIM','PLAY']; var users = ['@alpha_99','@zephyr_t','@trader_mx']; var videos = ['Candlestick Charts Pro','Intro to Technical Analysis','RSI & MACD Combo']; var results = ['COMPLETED ✓','₮40 + 100 XP','DROPPED OFF']; var ri = Math.floor(Math.random()*3); row.innerHTML = '' + timeStr + '' + '' + users[ri] + '' + '' + events[ri] + '' + '' + videos[ri] + '' + '' + (ri===0?'12m 00s':ri===1?'8m 00s':'6m 30s') + '' + '' + results[ri] + ''; }; window.awExportCSV = function() { var csv = 'User,Videos Watched,Watch Time,Completion Rate,XP Earned,Tokens Earned,Streak\n'; csv += '@alpha_99,48,7h 24m,91%,3840,1240,12d\n'; csv += '@zephyr_t,35,5h 10m,80%,2800,920,7d\n'; csv += '@trader_mx,22,3h 05m,68%,1760,580,3d\n'; var blob = new Blob([csv], {type:'text/csv'}); var a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'watch-earn-users.csv'; a.click(); }; // ═══ ASSIGN VIDEOS — ADMIN JS ═══ window.awAssignVideo = function() { var user = document.getElementById('assignUserSel').value; var video = document.getElementById('assignVideoSel').options[document.getElementById('assignVideoSel').selectedIndex].text; var tokens = document.getElementById('assignTokens').value; var xp = document.getElementById('assignXP').value; var cash = document.getElementById('assignCash').value; var deadline = document.getElementById('assignDeadline').value || 'No deadline'; if (!user || !video || video === '— Choose Video —') { showToast && showToast('ERROR', 'Please select a user and video.', 'error'); return; } var tbl = document.getElementById('awAssignLog'); if (tbl) { var row = tbl.insertRow(1); var now = new Date(); var t = now.toLocaleString('en-GB',{day:'2-digit',month:'short',hour:'2-digit',minute:'2-digit'}); row.innerHTML = '' + t + '' + '' + user + '' + '' + video + '' + '₮' + tokens + '' + '$' + cash + '' + '' + deadline + '' + 'ACTIVE'; } addAudit && addAudit('INFO', 'Video assigned', 'admin', video + ' → ' + user + ' (₮' + tokens + ')'); showToast && showToast('VIDEO ASSIGNED', video + ' assigned to ' + user + ' · ₮' + tokens + ' reward', 'success'); }; window.awBulkAssign = function() { var group = document.getElementById('bulkGroupSel').value; var playlist = document.getElementById('bulkPlaylistSel').value; var tokens = document.getElementById('bulkTokens').value; var cash = document.getElementById('bulkCash').value; var campaign = document.getElementById('bulkCampaign').value || 'Unnamed Campaign'; if (!confirm('Bulk assign "' + playlist + '" to ' + group + '? \u20ae' + tokens + ' per video · $' + cash + ' cash value')) return; var tbl = document.getElementById('awAssignLog'); if (tbl) { var row = tbl.insertRow(1); var now = new Date(); var t = now.toLocaleString('en-GB',{day:'2-digit',month:'short',hour:'2-digit',minute:'2-digit'}); row.innerHTML = '' + t + '' + '' + group + '' + '' + playlist + '' + '₮' + tokens + '' + '$' + cash + '' + 'Campaign: ' + campaign + '' + 'ACTIVE'; } addAudit && addAudit('WARN', 'Bulk video assign', 'admin', playlist + ' → ' + group); showToast && showToast('BULK ASSIGNED', playlist + ' assigned to ' + group, 'success'); }; window.awClearAssignLog = function() { if (!confirm('Clear assignment log?')) return; var tbl = document.getElementById('awAssignLog'); if (!tbl) return; var rows = Array.from(tbl.querySelectorAll('tr:not(:first-child)')); rows.forEach(function(r){ r.remove(); }); showToast && showToast('LOG CLEARED', 'Assignment log cleared.', 'warn'); }; // ═══ TIads — ADMIN JS ═══ window.tiadsSwitchTab = function(tab) { document.querySelectorAll('.tiadsTab').forEach(function(t) { var isActive = t.getAttribute('onclick') === "tiadsSwitchTab('" + tab + "')"; t.style.borderBottom = isActive ? '2px solid var(--no)' : '2px solid transparent'; t.style.color = isActive ? 'var(--no)' : 'var(--tm)'; }); document.querySelectorAll('.tiadsTabContent').forEach(function(c) { c.style.display = 'none'; }); var panel = document.getElementById('tiadsTab-' + tab); if (panel) panel.style.display = 'block'; }; window.tiadsAddAffiliate = function() { var detail = document.getElementById('tiadsAffDetail'); var title = document.getElementById('tiadsAffDetailTitle'); if (!detail) return; if (title) title.textContent = 'New Affiliate'; ['tiadsAffName','tiadsAffEmail','tiadsAffWebsite','tiadsAffApp','tiadsAffPixel'].forEach(function(id){ var el = document.getElementById(id); if(el) el.value = ''; }); detail.style.display = 'block'; detail.scrollIntoView({behavior:'smooth', block:'start'}); }; window.tiadsViewAffiliate = function(btn) { var row = btn.closest('tr'); if (!row) return; var name = row.cells[0].querySelector('div').textContent; var email = row.cells[0].querySelectorAll('div')[1].textContent; var site = row.cells[1].textContent.trim(); var share = row.cells[3].querySelector('input').value; var detail = document.getElementById('tiadsAffDetail'); if (!detail) return; document.getElementById('tiadsAffDetailTitle').textContent = name + ' — Details'; document.getElementById('tiadsAffName').value = name; document.getElementById('tiadsAffEmail').value = email; document.getElementById('tiadsAffWebsite').value = 'https://' + site; document.getElementById('tiadsAffShare').value = share; document.getElementById('tiadsAffPixel').value = 'ti_pixel_' + name.toLowerCase().replace(/\s/g,'_') + '_' + Math.random().toString(36).substr(2,8); detail.style.display = 'block'; detail.scrollIntoView({behavior:'smooth', block:'start'}); }; window.tiadsApproveAffiliate = function(btn) { var row = btn.closest('tr'); if (!row) return; var td = row.cells[7]; if (td) { td.innerHTML = 'ACTIVE'; } btn.textContent = 'VIEW'; btn.className = 'abtn'; btn.setAttribute('onclick', 'tiadsViewAffiliate(this)'); showToast && showToast('AFFILIATE APPROVED', row.cells[0].querySelector('div').textContent + ' is now active.', 'success'); addAudit && addAudit('INFO', 'Affiliate approved', 'admin', row.cells[0].querySelector('div').textContent); }; window.tiadsSaveAffiliate = function() { var name = document.getElementById('tiadsAffName').value; if (!name) { showToast && showToast('ERROR','Name required.','error'); return; } showToast && showToast('SAVED', name + ' affiliate saved.', 'success'); addAudit && addAudit('INFO', 'Affiliate saved', 'admin', name); document.getElementById('tiadsAffDetail').style.display = 'none'; }; window.tiadsGenPixel = function() { var name = document.getElementById('tiadsAffName').value || 'affiliate'; var key = 'ti_' + name.toLowerCase().replace(/[^a-z0-9]/g,'_') + '_' + Date.now().toString(36); var pxEl = document.getElementById('tiadsAffPixel'); if (pxEl) { pxEl.value = key; pxEl.style.color = 'var(--ng)'; setTimeout(function(){ pxEl.style.color = ''; }, 1500); } showToast && showToast('KEY GENERATED', key, 'success'); }; window.tiadsAddCampaign = function() { var name = prompt('Campaign name:', ''); if (!name) return; var aff = prompt('Affiliate:', 'CryptoLearn Pro'); var cpm = prompt('CPM Rate ($):', '4.50'); var budget = prompt('Budget ($):', '1000'); var type = prompt('Placement (PRE-ROLL/MID-ROLL/POST-ROLL):', 'PRE-ROLL'); var tbl = document.getElementById('tiadsCampaignTable'); if (!tbl) return; var row = tbl.insertRow(-1); var badgeColor = type==='PRE-ROLL' ? 'rgba(0,212,255,.12);color:var(--nc)' : type==='MID-ROLL' ? 'rgba(191,95,255,.12);color:var(--np)' : 'rgba(0,255,136,.1);color:var(--ng)'; row.innerHTML = '' + name + '' + '' + (aff||'') + '' + '—' + '' + (type||'PRE-ROLL') + '' + '' + '' + '$00' + 'RUNNING' + ''; showToast && showToast('CAMPAIGN CREATED', name, 'success'); }; window.tiadsToggleCampaign = function(btn) { var isPause = btn.textContent.trim() === 'PAUSE'; btn.textContent = isPause ? 'RESUME' : 'PAUSE'; var row = btn.closest('tr'); var badge = row && row.cells[8] ? row.cells[8].querySelector('.badge') : null; if (badge) { badge.textContent = isPause ? 'PAUSED' : 'RUNNING'; badge.className = isPause ? 'badge br2' : 'badge bo'; } }; window.tiadsApproveAd = function(btn) { var row = btn.closest('tr'); if (!row) return; var title = row.cells[1].textContent; row.style.background = 'rgba(0,255,136,.04)'; btn.textContent = '✓ APPROVED'; btn.disabled = true; btn.style.opacity = '.5'; showToast && showToast('AD APPROVED', title + ' added to library.', 'success'); addAudit && addAudit('INFO','Ad approved','admin',title); }; // ═══ DRAGGABLE SWITCH PILL ═══ (function(){ var pill = document.getElementById('switchPill'); var handle = document.getElementById('spDragHandle'); if(!pill || !handle) return; var PILL_POS_KEY = 'ti_pill_pos'; // Restore saved position var savedPos = null; try{ savedPos = JSON.parse(localStorage.getItem(PILL_POS_KEY)||'null'); }catch(e){} if(savedPos){ pill.style.left = savedPos.x + 'px'; pill.style.top = savedPos.y + 'px'; pill.style.right = 'auto'; pill.style.bottom = 'auto'; } var dragging = false; var startX, startY, origX, origY; function clampToBounds(x, y){ var pw = pill.offsetWidth || 110; var ph = pill.offsetHeight || 36; var maxX = window.innerWidth - pw - 8; var maxY = window.innerHeight - ph - 8; return { x: Math.max(8, Math.min(x, maxX)), y: Math.max(8, Math.min(y, maxY)) }; } function getPos(){ var r = pill.getBoundingClientRect(); return { x: r.left, y: r.top }; } function startDrag(cx, cy){ dragging = true; var pos = getPos(); origX = pos.x; origY = pos.y; startX = cx; startY = cy; pill.classList.add('dragging'); pill.style.left = origX + 'px'; pill.style.top = origY + 'px'; pill.style.right = 'auto'; pill.style.bottom = 'auto'; pill.style.transition = 'none'; } function moveDrag(cx, cy){ if(!dragging) return; var dx = cx - startX; var dy = cy - startY; var c = clampToBounds(origX + dx, origY + dy); pill.style.left = c.x + 'px'; pill.style.top = c.y + 'px'; } function endDrag(cx, cy){ if(!dragging) return; dragging = false; pill.classList.remove('dragging'); pill.style.transition = ''; // Snap to nearest edge var pw = pill.offsetWidth; var ph = pill.offsetHeight; var winW = window.innerWidth; var winH = window.innerHeight; var pos = getPos(); var cx2 = pos.x + pw / 2; var distLeft = cx2; var distRight = winW - cx2; var snapX = distLeft < distRight ? 8 : winW - pw - 8; var c = clampToBounds(snapX, pos.y); pill.style.left = c.x + 'px'; pill.style.top = c.y + 'px'; // Save position try{ localStorage.setItem(PILL_POS_KEY, JSON.stringify({x: c.x, y: c.y})); }catch(e){} } // Mouse events — only drag from handle handle.addEventListener('mousedown', function(e){ e.preventDefault(); startDrag(e.clientX, e.clientY); }); document.addEventListener('mousemove', function(e){ if(dragging) moveDrag(e.clientX, e.clientY); }); document.addEventListener('mouseup', function(e){ if(dragging) endDrag(e.clientX, e.clientY); }); // Touch events — only drag from handle handle.addEventListener('touchstart', function(e){ e.preventDefault(); var t = e.touches[0]; startDrag(t.clientX, t.clientY); }, {passive:false}); document.addEventListener('touchmove', function(e){ if(!dragging) return; e.preventDefault(); var t = e.touches[0]; moveDrag(t.clientX, t.clientY); }, {passive:false}); document.addEventListener('touchend', function(e){ if(!dragging) return; var t = e.changedTouches[0]; endDrag(t.clientX, t.clientY); }); // Reposition on window resize window.addEventListener('resize', function(){ var pos = getPos(); var c = clampToBounds(pos.x, pos.y); pill.style.left = c.x + 'px'; pill.style.top = c.y + 'px'; }); })(); // ═══ SWITCH PILL LOGIC ═══ window.switchToUser = function(){ if(window._openView) window._openView('app'); document.getElementById('spUserBtn').classList.add('active-tab'); document.getElementById('spAdminBtn').classList.remove('active-tab'); }; window.switchToAdmin = function(){ // If not logged in as admin, show the modal var adminApp = document.getElementById('adminApp'); var adminIsOpen = adminApp && adminApp.style.display === 'flex'; if(!adminIsOpen){ // Switch to app view first so modal shows on phone if(window._openView) window._openView('app'); setTimeout(function(){ window.showAdminLoginModal && window.showAdminLoginModal(); }, 100); } else { if(window._openView) window._openView('admin'); document.getElementById('spAdminBtn').classList.add('active-tab'); document.getElementById('spUserBtn').classList.remove('active-tab'); } }; // Update pill state when view changes — patch openView var _origOpenView = window._openView; window._openView = function(v){ if(_origOpenView) _origOpenView(v); var pill = document.getElementById('switchPill'); var spU = document.getElementById('spUserBtn'); var spA = document.getElementById('spAdminBtn'); if(!pill) return; if(v === 'app'){ pill.classList.add('show'); if(spU){ spU.classList.add('active-tab'); spU.classList.remove('inactive-tab'); } if(spA){ spA.classList.remove('active-tab'); } } else if(v === 'admin'){ pill.classList.add('show'); if(spA){ spA.classList.add('active-tab'); spA.classList.remove('inactive-tab'); } if(spU){ spU.classList.remove('active-tab'); } } };