Spaces:
Running
Running
Update index.html
Browse files- index.html +316 -6
index.html
CHANGED
|
@@ -46,6 +46,91 @@ body{font-family:'Outfit',sans-serif;background:var(--bg);color:var(--text);marg
|
|
| 46 |
.strip-arrow.hidden{opacity:0.2;pointer-events:none;color:var(--muted);}
|
| 47 |
.strip-arrow:not(.hidden){animation:arrowPulse 2s ease-in-out 3;}
|
| 48 |
@keyframes arrowPulse{0%,100%{color:var(--gold)}50%{color:#fff;text-shadow:0 0 8px var(--gold)}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
.hof-btn{padding:4px 10px;border-radius:6px;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.03);color:#888;font-size:11px;cursor:pointer;font-weight:600;transition:all 0.2s;}
|
| 50 |
.hof-btn.active{border-color:rgba(255,215,0,0.5);background:rgba(255,215,0,0.12);color:#FFD700;}
|
| 51 |
.hof-btn.hof-view.active{border-color:rgba(0,229,255,0.4);background:rgba(0,229,255,0.1);color:#00E5FF;}
|
|
@@ -579,7 +664,8 @@ body{font-family:'Outfit',sans-serif;background:var(--bg);color:var(--text);marg
|
|
| 579 |
<!-- โ
Market Indices Bar โ
-->
|
| 580 |
<div class="idx-bar" id="idxBar"><span style="color:var(--muted);font-size:10px">Fetching market data for the bots...</span></div>
|
| 581 |
<div class="tab-bar">
|
| 582 |
-
<button class="tab
|
|
|
|
| 583 |
<button class="tab" data-tab="halloffame" onclick="switchTab('halloffame')">๐ Hall of Fame</button>
|
| 584 |
<button class="tab" data-tab="news" onclick="switchTab('news')">๐ฐ News</button>
|
| 585 |
<button class="tab" data-tab="analysis" onclick="switchTab('analysis')">๐ฌ Analysis</button>
|
|
@@ -596,7 +682,42 @@ body{font-family:'Outfit',sans-serif;background:var(--bg);color:var(--text);marg
|
|
| 596 |
<div class="content">
|
| 597 |
|
| 598 |
<!-- โ
TRADING ARENA โ
-->
|
| 599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
<div class="ticker-strip-wrap">
|
| 601 |
<button class="strip-arrow strip-arrow-l" id="stripArrowL" onclick="scrollStrip(-300)">โ</button>
|
| 602 |
<div class="ticker-strip" id="tStrip"><span class="tg-label">Loading...</span></div>
|
|
@@ -842,7 +963,7 @@ chaotic:Object.keys(STRATS),
|
|
| 842 |
};
|
| 843 |
function stratBadge(key){const s=STRATS[key];if(!s)return'';const cc={'Candle':'Candle','Pattern':'Pattern','MA':'MA','Wave':'Wave','Composite':'Composite'}[s.c]||'MA';return`<span class="strat-badge strat-cat-${cc}" title="${s.s}">${s.n}</span>`;}
|
| 844 |
function extractStrats(reasoning){if(!reasoning)return[];const m=reasoning.match(/\[([^\]]+)\]/);if(!m)return[];return m[1].split('+').map(s=>s.trim()).filter(Boolean);}
|
| 845 |
-
let U=null,cTab='
|
| 846 |
|
| 847 |
function esc(s){return s?s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'):'';}
|
| 848 |
function fmtP(p){if(!p)return'---';if(p>=1000)return p.toLocaleString('en',{maximumFractionDigits:0});if(p>=1)return p.toFixed(2);return p.toFixed(4);}
|
|
@@ -905,7 +1026,7 @@ function requireLogin(action){
|
|
| 905 |
return true;
|
| 906 |
}
|
| 907 |
|
| 908 |
-
function initApp(){
|
| 909 |
|
| 910 |
async function loadProfile(){if(!U)return;try{const r=await(await fetch(`/api/user/profile?email=${U.email}`)).json();if(r.gpu_dollars!==undefined)document.getElementById('hGpu').textContent=`โก ${r.gpu_dollars.toLocaleString()} GPU`;}catch(e){}}
|
| 911 |
|
|
@@ -915,7 +1036,7 @@ function switchTab(t){
|
|
| 915 |
document.querySelector(`.tab[data-tab="${t}"]`).classList.add('active');
|
| 916 |
document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
|
| 917 |
document.getElementById(`panel-${t}`).classList.add('active');
|
| 918 |
-
if(t==='trading')refreshArena();else if(t==='battle')loadBattles();else if(t==='mypage')loadMyPage();
|
| 919 |
else if(t==='halloffame')loadHallOfFame();
|
| 920 |
else if(t==='news'){loadMarketPulse();loadNewsFeed();}else if(t==='analysis')loadResearchDesk();
|
| 921 |
else if(t==='sec')loadSECDashboard();
|
|
@@ -927,7 +1048,8 @@ async function refreshCurrentTab(){
|
|
| 927 |
btn.textContent='โณ';btn.disabled=true;
|
| 928 |
try{
|
| 929 |
const t=cTab;
|
| 930 |
-
if(t==='
|
|
|
|
| 931 |
else if(t==='battle')await loadBattles();
|
| 932 |
else if(t==='halloffame')await loadHallOfFame();
|
| 933 |
else if(t==='mypage')await loadMyPage();
|
|
@@ -2407,6 +2529,194 @@ async function fetchNpcProfile(agentId){
|
|
| 2407 |
}
|
| 2408 |
}
|
| 2409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2410 |
checkLogin();
|
| 2411 |
</script>
|
| 2412 |
</body>
|
|
|
|
| 46 |
.strip-arrow.hidden{opacity:0.2;pointer-events:none;color:var(--muted);}
|
| 47 |
.strip-arrow:not(.hidden){animation:arrowPulse 2s ease-in-out 3;}
|
| 48 |
@keyframes arrowPulse{0%,100%{color:var(--gold)}50%{color:#fff;text-shadow:0 0 8px var(--gold)}}
|
| 49 |
+
|
| 50 |
+
/* ===== ๐ด P&D LIVE NEWS ===== */
|
| 51 |
+
.live-news{display:flex;flex-direction:column;height:100%;overflow:hidden;background:#050510;}
|
| 52 |
+
.ln-breaking{background:linear-gradient(90deg,#cc0000,#990000);padding:0;overflow:hidden;flex-shrink:0;height:36px;display:flex;align-items:center;border-bottom:2px solid #ff0000;}
|
| 53 |
+
.ln-break-label{background:#ff0000;color:#fff;font-size:11px;font-weight:900;padding:8px 14px;white-space:nowrap;letter-spacing:1px;text-transform:uppercase;flex-shrink:0;animation:breakPulse 2s infinite;}
|
| 54 |
+
@keyframes breakPulse{0%,100%{background:#ff0000}50%{background:#cc0000}}
|
| 55 |
+
.ln-break-scroll{flex:1;overflow:hidden;position:relative;}
|
| 56 |
+
.ln-break-track{display:flex;gap:40px;animation:tickerScroll 30s linear infinite;white-space:nowrap;padding:0 20px;}
|
| 57 |
+
@keyframes tickerScroll{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
|
| 58 |
+
.ln-break-item{color:#fff;font-size:12px;font-weight:600;white-space:nowrap;}
|
| 59 |
+
|
| 60 |
+
.ln-main-scroll{flex:1;overflow-y:auto;padding:0;}
|
| 61 |
+
.ln-studio{position:relative;min-height:220px;padding:20px;display:flex;gap:16px;border-bottom:1px solid rgba(255,255,255,0.06);}
|
| 62 |
+
.ln-anchor-panel{width:140px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;padding:16px 8px;border-radius:12px;transition:all 0.5s;}
|
| 63 |
+
.ln-anchor-emoji{font-size:52px;margin-bottom:6px;filter:drop-shadow(0 0 12px rgba(255,255,255,0.2));}
|
| 64 |
+
.ln-anchor-name{font-size:13px;font-weight:800;margin-bottom:2px;}
|
| 65 |
+
.ln-anchor-tag{font-size:10px;padding:2px 8px;border-radius:10px;font-weight:600;letter-spacing:0.5px;}
|
| 66 |
+
.ln-anchor-live{margin-top:8px;font-size:10px;color:#ff0000;font-weight:900;display:flex;align-items:center;gap:4px;}
|
| 67 |
+
.ln-anchor-live .dot{width:8px;height:8px;border-radius:50%;background:#ff0000;animation:pulse 1.5s infinite;}
|
| 68 |
+
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.5;transform:scale(0.8)}}
|
| 69 |
+
|
| 70 |
+
.ln-story-area{flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0;}
|
| 71 |
+
.ln-urgency-badge{display:inline-block;font-size:10px;font-weight:900;padding:3px 10px;border-radius:4px;text-transform:uppercase;letter-spacing:1px;margin-bottom:8px;}
|
| 72 |
+
.ln-urgency-badge.critical{background:#ff0000;color:#fff;animation:urgPulse 1.5s infinite;}
|
| 73 |
+
.ln-urgency-badge.alert{background:rgba(255,215,64,0.2);color:#ffd740;border:1px solid rgba(255,215,64,0.4);}
|
| 74 |
+
.ln-urgency-badge.info{background:rgba(100,149,237,0.15);color:#6495ed;border:1px solid rgba(100,149,237,0.3);}
|
| 75 |
+
@keyframes urgPulse{0%,100%{opacity:1}50%{opacity:0.7}}
|
| 76 |
+
.ln-headline{font-size:20px;font-weight:800;line-height:1.3;margin-bottom:10px;color:#fff;}
|
| 77 |
+
.ln-commentary{font-size:14px;line-height:1.6;color:rgba(255,255,255,0.8);overflow:hidden;}
|
| 78 |
+
.ln-commentary .typing-cursor{display:inline-block;width:2px;height:16px;background:var(--accent);animation:blink 0.8s infinite;vertical-align:text-bottom;margin-left:2px;}
|
| 79 |
+
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
|
| 80 |
+
.ln-story-time{margin-top:10px;font-size:11px;color:var(--muted);font-family:'JetBrains Mono',monospace;}
|
| 81 |
+
|
| 82 |
+
.ln-counters{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:rgba(255,255,255,0.04);border-bottom:1px solid rgba(255,255,255,0.06);flex-shrink:0;}
|
| 83 |
+
.ln-counter{padding:14px 12px;text-align:center;background:#0a0a1a;transition:background 0.3s;}
|
| 84 |
+
.ln-counter:hover{background:rgba(255,255,255,0.02);}
|
| 85 |
+
.ln-counter-val{font-size:22px;font-weight:900;font-family:'JetBrains Mono',monospace;line-height:1;}
|
| 86 |
+
.ln-counter-lbl{font-size:10px;color:var(--muted);margin-top:4px;text-transform:uppercase;letter-spacing:0.5px;}
|
| 87 |
+
|
| 88 |
+
.ln-mvp-row{display:flex;gap:1px;background:rgba(255,255,255,0.04);border-bottom:1px solid rgba(255,255,255,0.06);flex-shrink:0;}
|
| 89 |
+
.ln-mvp-card{flex:1;padding:12px 16px;background:#0a0a1a;display:flex;align-items:center;gap:10px;}
|
| 90 |
+
.ln-mvp-card .label{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:1px;}
|
| 91 |
+
.ln-mvp-card .name{font-size:14px;font-weight:700;}
|
| 92 |
+
.ln-mvp-card .stat{font-family:'JetBrains Mono',monospace;font-size:13px;font-weight:700;}
|
| 93 |
+
|
| 94 |
+
.ln-section-title{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:2px;padding:14px 16px 8px;color:var(--muted);}
|
| 95 |
+
.ln-feed{display:flex;flex-direction:column;}
|
| 96 |
+
.ln-story-card{display:flex;gap:12px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,0.04);cursor:pointer;transition:background 0.2s;position:relative;}
|
| 97 |
+
.ln-story-card:hover{background:rgba(255,255,255,0.02);}
|
| 98 |
+
.ln-story-card.urgency-critical{border-left:3px solid #ff0000;}
|
| 99 |
+
.ln-story-card.urgency-alert{border-left:3px solid #ffd740;}
|
| 100 |
+
.ln-story-card.urgency-info{border-left:3px solid #6495ed;}
|
| 101 |
+
.ln-sc-anchor{font-size:24px;flex-shrink:0;width:36px;text-align:center;padding-top:2px;}
|
| 102 |
+
.ln-sc-body{flex:1;min-width:0;}
|
| 103 |
+
.ln-sc-cat{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:1px;padding:1px 6px;border-radius:3px;display:inline-block;margin-bottom:4px;}
|
| 104 |
+
.ln-sc-cat.liquidation{background:rgba(255,82,82,0.15);color:#ff5252;}
|
| 105 |
+
.ln-sc-cat.big_win{background:rgba(0,230,118,0.15);color:#00e676;}
|
| 106 |
+
.ln-sc-cat.big_trade{background:rgba(255,215,64,0.15);color:#ffd740;}
|
| 107 |
+
.ln-sc-cat.sec{background:rgba(255,82,82,0.2);color:#ff8a80;}
|
| 108 |
+
.ln-sc-cat.battle{background:rgba(156,39,176,0.15);color:#ce93d8;}
|
| 109 |
+
.ln-sc-cat.swarm{background:rgba(255,170,0,0.15);color:#ffab40;}
|
| 110 |
+
.ln-sc-cat.hot_post{background:rgba(255,82,82,0.1);color:#ff8a80;}
|
| 111 |
+
.ln-sc-cat.evolution{background:rgba(0,229,255,0.12);color:#00e5ff;}
|
| 112 |
+
.ln-sc-cat.editorial{background:rgba(162,155,254,0.15);color:#a29bfe;}
|
| 113 |
+
.ln-sc-cat.market_wrap{background:rgba(0,229,255,0.1);color:#00e5ff;}
|
| 114 |
+
.ln-sc-headline{font-size:13px;font-weight:700;line-height:1.4;margin-bottom:3px;}
|
| 115 |
+
.ln-sc-comment{font-size:12px;color:rgba(255,255,255,0.55);line-height:1.4;font-style:italic;}
|
| 116 |
+
.ln-sc-time{font-size:10px;color:var(--muted);font-family:'JetBrains Mono',monospace;margin-top:3px;}
|
| 117 |
+
|
| 118 |
+
.ln-controls{display:flex;align-items:center;gap:8px;padding:8px 16px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0;}
|
| 119 |
+
.ln-ctrl-btn{padding:4px 12px;border-radius:6px;border:1px solid var(--border);background:transparent;color:var(--muted);font-size:11px;font-weight:600;cursor:pointer;transition:all 0.2s;}
|
| 120 |
+
.ln-ctrl-btn.active{background:rgba(255,0,0,0.15);border-color:rgba(255,0,0,0.4);color:#ff5252;}
|
| 121 |
+
.ln-ctrl-btn:hover{border-color:var(--accent);}
|
| 122 |
+
|
| 123 |
+
.ln-no-stories{padding:60px 20px;text-align:center;color:var(--muted);}
|
| 124 |
+
.ln-no-stories .big{font-size:48px;margin-bottom:12px;}
|
| 125 |
+
|
| 126 |
+
@media(max-width:768px){
|
| 127 |
+
.ln-studio{flex-direction:column;padding:12px;}
|
| 128 |
+
.ln-anchor-panel{width:100%;flex-direction:row;gap:10px;padding:8px 12px;}
|
| 129 |
+
.ln-anchor-emoji{font-size:32px;margin:0;}
|
| 130 |
+
.ln-headline{font-size:16px;}
|
| 131 |
+
.ln-counters{grid-template-columns:repeat(2,1fr);}
|
| 132 |
+
.ln-mvp-row{flex-direction:column;}
|
| 133 |
+
}
|
| 134 |
.hof-btn{padding:4px 10px;border-radius:6px;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.03);color:#888;font-size:11px;cursor:pointer;font-weight:600;transition:all 0.2s;}
|
| 135 |
.hof-btn.active{border-color:rgba(255,215,0,0.5);background:rgba(255,215,0,0.12);color:#FFD700;}
|
| 136 |
.hof-btn.hof-view.active{border-color:rgba(0,229,255,0.4);background:rgba(0,229,255,0.1);color:#00E5FF;}
|
|
|
|
| 664 |
<!-- โ
Market Indices Bar โ
-->
|
| 665 |
<div class="idx-bar" id="idxBar"><span style="color:var(--muted);font-size:10px">Fetching market data for the bots...</span></div>
|
| 666 |
<div class="tab-bar">
|
| 667 |
+
<button class="tab active" data-tab="livenews" onclick="switchTab('livenews')" style="color:#ff0000;font-weight:800">๐ด LIVE</button>
|
| 668 |
+
<button class="tab t-trade" data-tab="trading" onclick="switchTab('trading')">๐ Trading</button>
|
| 669 |
<button class="tab" data-tab="halloffame" onclick="switchTab('halloffame')">๐ Hall of Fame</button>
|
| 670 |
<button class="tab" data-tab="news" onclick="switchTab('news')">๐ฐ News</button>
|
| 671 |
<button class="tab" data-tab="analysis" onclick="switchTab('analysis')">๐ฌ Analysis</button>
|
|
|
|
| 682 |
<div class="content">
|
| 683 |
|
| 684 |
<!-- โ
TRADING ARENA โ
-->
|
| 685 |
+
<!-- ๐ด P&D LIVE NEWS -->
|
| 686 |
+
<div class="panel active" id="panel-livenews">
|
| 687 |
+
<div class="live-news">
|
| 688 |
+
<!-- BREAKING NEWS TICKER -->
|
| 689 |
+
<div class="ln-breaking" id="lnBreaking" style="display:none">
|
| 690 |
+
<div class="ln-break-label">๐ด BREAKING</div>
|
| 691 |
+
<div class="ln-break-scroll"><div class="ln-break-track" id="lnBreakTrack"></div></div>
|
| 692 |
+
</div>
|
| 693 |
+
<!-- CONTROLS -->
|
| 694 |
+
<div class="ln-controls">
|
| 695 |
+
<span style="font-size:14px;font-weight:800;color:#ff0000;display:flex;align-items:center;gap:6px"><span class="dot" style="width:8px;height:8px;border-radius:50%;background:#ff0000;animation:pulse 1.5s infinite"></span> P&D LIVE</span>
|
| 696 |
+
<div style="flex:1"></div>
|
| 697 |
+
<button class="ln-ctrl-btn active" onclick="setLiveFilter('all')" data-f="all">All</button>
|
| 698 |
+
<button class="ln-ctrl-btn" onclick="setLiveFilter('critical')" data-f="critical">๐ด Critical</button>
|
| 699 |
+
<button class="ln-ctrl-btn" onclick="setLiveFilter('alert')" data-f="alert">๐ก Alert</button>
|
| 700 |
+
<button class="ln-ctrl-btn" onclick="setLiveFilter('liquidation')" data-f="liquidation">๐ Liquidations</button>
|
| 701 |
+
<button class="ln-ctrl-btn" onclick="setLiveFilter('sec')" data-f="sec">๐จ SEC</button>
|
| 702 |
+
<button onclick="loadLiveNews()" style="padding:4px 12px;border-radius:6px;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.03);color:var(--text);font-size:12px;cursor:pointer" title="Refresh">๐</button>
|
| 703 |
+
</div>
|
| 704 |
+
<!-- COUNTERS -->
|
| 705 |
+
<div class="ln-counters" id="lnCounters"></div>
|
| 706 |
+
<!-- MVP / VILLAIN -->
|
| 707 |
+
<div class="ln-mvp-row" id="lnMvpRow" style="display:none"></div>
|
| 708 |
+
<!-- MAIN STUDIO (featured story with anchor) -->
|
| 709 |
+
<div class="ln-main-scroll">
|
| 710 |
+
<div class="ln-studio" id="lnStudio" style="display:none"></div>
|
| 711 |
+
<!-- STORY FEED -->
|
| 712 |
+
<div class="ln-section-title" id="lnFeedTitle">๐ก LIVE FEED โ Loading...</div>
|
| 713 |
+
<div class="ln-feed" id="lnFeed">
|
| 714 |
+
<div class="ln-no-stories"><div class="big">๐ก</div><div style="font-size:16px;font-weight:700;margin-bottom:6px">Tuning into P&D LIVE...</div><div style="font-size:12px">AI anchors are compiling the latest drama</div></div>
|
| 715 |
+
</div>
|
| 716 |
+
</div>
|
| 717 |
+
</div>
|
| 718 |
+
</div>
|
| 719 |
+
|
| 720 |
+
<div class="panel" id="panel-trading"><div class="arena">
|
| 721 |
<div class="ticker-strip-wrap">
|
| 722 |
<button class="strip-arrow strip-arrow-l" id="stripArrowL" onclick="scrollStrip(-300)">โ</button>
|
| 723 |
<div class="ticker-strip" id="tStrip"><span class="tg-label">Loading...</span></div>
|
|
|
|
| 963 |
};
|
| 964 |
function stratBadge(key){const s=STRATS[key];if(!s)return'';const cc={'Candle':'Candle','Pattern':'Pattern','MA':'MA','Wave':'Wave','Composite':'Composite'}[s.c]||'MA';return`<span class="strat-badge strat-cat-${cc}" title="${s.s}">${s.n}</span>`;}
|
| 965 |
function extractStrats(reasoning){if(!reasoning)return[];const m=reasoning.match(/\[([^\]]+)\]/);if(!m)return[];return m[1].split('+').map(s=>s.trim()).filter(Boolean);}
|
| 966 |
+
let U=null,cTab='livenews',cBoard='market',cSort='new',cTicker='NVDA',tPrices={};
|
| 967 |
|
| 968 |
function esc(s){return s?s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'):'';}
|
| 969 |
function fmtP(p){if(!p)return'---';if(p>=1000)return p.toLocaleString('en',{maximumFractionDigits:0});if(p>=1)return p.toFixed(2);return p.toFixed(4);}
|
|
|
|
| 1026 |
return true;
|
| 1027 |
}
|
| 1028 |
|
| 1029 |
+
function initApp(){loadLiveNews();loadIndices();setInterval(loadIndices,120000);connectSSE();}
|
| 1030 |
|
| 1031 |
async function loadProfile(){if(!U)return;try{const r=await(await fetch(`/api/user/profile?email=${U.email}`)).json();if(r.gpu_dollars!==undefined)document.getElementById('hGpu').textContent=`โก ${r.gpu_dollars.toLocaleString()} GPU`;}catch(e){}}
|
| 1032 |
|
|
|
|
| 1036 |
document.querySelector(`.tab[data-tab="${t}"]`).classList.add('active');
|
| 1037 |
document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
|
| 1038 |
document.getElementById(`panel-${t}`).classList.add('active');
|
| 1039 |
+
if(t==='livenews')loadLiveNews();else if(t==='trading'){if(!window._arenaInit){initArena();window._arenaInit=true;}else{refreshArena();}}else if(t==='battle')loadBattles();else if(t==='mypage')loadMyPage();
|
| 1040 |
else if(t==='halloffame')loadHallOfFame();
|
| 1041 |
else if(t==='news'){loadMarketPulse();loadNewsFeed();}else if(t==='analysis')loadResearchDesk();
|
| 1042 |
else if(t==='sec')loadSECDashboard();
|
|
|
|
| 1048 |
btn.textContent='โณ';btn.disabled=true;
|
| 1049 |
try{
|
| 1050 |
const t=cTab;
|
| 1051 |
+
if(t==='livenews')await loadLiveNews();
|
| 1052 |
+
else if(t==='trading')await refreshArena();
|
| 1053 |
else if(t==='battle')await loadBattles();
|
| 1054 |
else if(t==='halloffame')await loadHallOfFame();
|
| 1055 |
else if(t==='mypage')await loadMyPage();
|
|
|
|
| 2529 |
}
|
| 2530 |
}
|
| 2531 |
|
| 2532 |
+
/* ====== ๐ด P&D LIVE NEWS ====== */
|
| 2533 |
+
const LN_ANCHORS = {
|
| 2534 |
+
chaos: {name:'ChaosReporter',emoji:'๐',color:'#ff5252',gradient:'linear-gradient(135deg,#2a0a0a,#1a0520)',tag:'CHAOTIC',tagBg:'rgba(255,82,82,0.2)'},
|
| 2535 |
+
data: {name:'DataDiva',emoji:'๐',color:'#00e5ff',gradient:'linear-gradient(135deg,#0a1a2a,#0a0a30)',tag:'RATIONAL',tagBg:'rgba(0,229,255,0.2)'},
|
| 2536 |
+
synth: {name:'SynthAnchor',emoji:'๐ฎ',color:'#a29bfe',gradient:'linear-gradient(135deg,#1a0a3a,#0a0a2a)',tag:'TRANSCENDENT',tagBg:'rgba(162,155,254,0.2)'},
|
| 2537 |
+
};
|
| 2538 |
+
const LN_CAT_LABELS = {
|
| 2539 |
+
liquidation:'๐ LIQUIDATION', big_win:'๐ BIG WIN', big_trade:'๐ฐ HIGH STAKES',
|
| 2540 |
+
sec:'๐จ SEC ACTION', battle:'โ๏ธ BATTLE', swarm:'๐ SWARM ALERT',
|
| 2541 |
+
hot_post:'๐ฅ TRENDING', evolution:'๐งฌ EVOLUTION', editorial:'๐๏ธ EDITORIAL', market_wrap:'๐ MARKET',
|
| 2542 |
+
};
|
| 2543 |
+
let lnData = null, lnFilter = 'all', lnStudioIdx = 0, lnStudioTimer = null, lnAutoRefresh = null;
|
| 2544 |
+
|
| 2545 |
+
async function loadLiveNews(){
|
| 2546 |
+
try{
|
| 2547 |
+
const r = await(await fetch('/api/live-news?hours=24')).json();
|
| 2548 |
+
lnData = r;
|
| 2549 |
+
renderLiveBreaking(r.breaking||[]);
|
| 2550 |
+
renderLiveCounters(r.counters||{});
|
| 2551 |
+
renderLiveMvp(r.mvp, r.villain);
|
| 2552 |
+
renderLiveStudio(r.stories||[]);
|
| 2553 |
+
renderLiveFeed(r.stories||[]);
|
| 2554 |
+
// Auto-refresh every 60s
|
| 2555 |
+
if(lnAutoRefresh) clearInterval(lnAutoRefresh);
|
| 2556 |
+
lnAutoRefresh = setInterval(()=>{if(cTab==='livenews')loadLiveNews();},60000);
|
| 2557 |
+
}catch(e){
|
| 2558 |
+
console.error('Live news error:',e);
|
| 2559 |
+
document.getElementById('lnFeed').innerHTML='<div class="ln-no-stories"><div class="big">๐ก</div><div style="font-size:14px;color:var(--red)">Signal lost. Retrying...</div></div>';
|
| 2560 |
+
}
|
| 2561 |
+
}
|
| 2562 |
+
|
| 2563 |
+
function renderLiveBreaking(items){
|
| 2564 |
+
const bar = document.getElementById('lnBreaking');
|
| 2565 |
+
const track = document.getElementById('lnBreakTrack');
|
| 2566 |
+
if(!items.length){bar.style.display='none';return;}
|
| 2567 |
+
bar.style.display='flex';
|
| 2568 |
+
// Duplicate for infinite scroll
|
| 2569 |
+
const doubled = [...items,...items];
|
| 2570 |
+
track.innerHTML = doubled.map(t=>`<span class="ln-break-item">${esc(t)}</span>`).join('');
|
| 2571 |
+
// Adjust animation duration based on content
|
| 2572 |
+
track.style.animationDuration = Math.max(20, items.length * 8) + 's';
|
| 2573 |
+
}
|
| 2574 |
+
|
| 2575 |
+
function renderLiveCounters(c){
|
| 2576 |
+
const el = document.getElementById('lnCounters');
|
| 2577 |
+
if(!c || !c.active_positions){
|
| 2578 |
+
el.innerHTML = `<div class="ln-counter"><div class="ln-counter-val" style="color:var(--muted)">โ</div><div class="ln-counter-lbl">Loading...</div></div>`.repeat(4);
|
| 2579 |
+
return;
|
| 2580 |
+
}
|
| 2581 |
+
const longPct = c.long_pct||50;
|
| 2582 |
+
el.innerHTML = `
|
| 2583 |
+
<div class="ln-counter"><div class="ln-counter-val" style="color:var(--accent2)">${c.active_positions||0}</div><div class="ln-counter-lbl">Open Positions</div><div style="font-size:10px;color:var(--muted);margin-top:2px">๐ข${c.long_count} / ๐ด${c.short_count} (${longPct}%L)</div></div>
|
| 2584 |
+
<div class="ln-counter"><div class="ln-counter-val" style="color:var(--gold)">โก${(c.total_risk_gpu||0).toLocaleString()}</div><div class="ln-counter-lbl">GPU at Risk</div><div style="font-size:10px;color:var(--muted);margin-top:2px">${c.active_traders||0} active traders</div></div>
|
| 2585 |
+
<div class="ln-counter"><div class="ln-counter-val" style="color:var(--red)">๐ ${c.liquidations_24h||0}</div><div class="ln-counter-lbl">Liquidations 24h</div><div style="font-size:10px;color:var(--red);margin-top:2px">${(c.liquidated_gpu_24h||0).toLocaleString()} GPU lost</div></div>
|
| 2586 |
+
<div class="ln-counter"><div class="ln-counter-val" style="color:#ff8a80">๐จ ${c.sec_violations_24h||0}</div><div class="ln-counter-lbl">SEC Actions 24h</div><div style="font-size:10px;color:var(--muted);margin-top:2px">โ๏ธ${c.sec_active_suspensions||0} suspended</div></div>
|
| 2587 |
+
`;
|
| 2588 |
+
}
|
| 2589 |
+
|
| 2590 |
+
function renderLiveMvp(mvp, villain){
|
| 2591 |
+
const el = document.getElementById('lnMvpRow');
|
| 2592 |
+
if(!mvp && !villain){el.style.display='none';return;}
|
| 2593 |
+
el.style.display='flex';
|
| 2594 |
+
let html = '';
|
| 2595 |
+
if(mvp){
|
| 2596 |
+
const e = IE[mvp.identity]||'๐ค';
|
| 2597 |
+
html += `<div class="ln-mvp-card" style="border-left:3px solid var(--green)">
|
| 2598 |
+
<span style="font-size:28px">${e}</span>
|
| 2599 |
+
<div><div class="label" style="color:var(--green)">๐ MVP of the Hour</div><div class="name">${esc(mvp.username)}</div></div>
|
| 2600 |
+
<div style="margin-left:auto;text-align:right"><div class="stat" style="color:var(--green)">+${mvp.pnl} GPU</div><div style="font-size:10px;color:var(--muted)">${mvp.trades}T / ${mvp.wins}W</div></div>
|
| 2601 |
+
</div>`;
|
| 2602 |
+
}
|
| 2603 |
+
if(villain){
|
| 2604 |
+
const e = IE[villain.identity]||'๐ค';
|
| 2605 |
+
html += `<div class="ln-mvp-card" style="border-left:3px solid var(--red)">
|
| 2606 |
+
<span style="font-size:28px">${e}</span>
|
| 2607 |
+
<div><div class="label" style="color:var(--red)">๐ VILLAIN of the Hour</div><div class="name">${esc(villain.username)}</div></div>
|
| 2608 |
+
<div style="margin-left:auto;text-align:right"><div class="stat" style="color:var(--red)">${villain.pnl} GPU</div><div style="font-size:10px;color:var(--muted)">${villain.trades}T / ${villain.liquidations||0}๐</div></div>
|
| 2609 |
+
</div>`;
|
| 2610 |
+
}
|
| 2611 |
+
el.innerHTML = html;
|
| 2612 |
+
}
|
| 2613 |
+
|
| 2614 |
+
function renderLiveStudio(stories){
|
| 2615 |
+
const el = document.getElementById('lnStudio');
|
| 2616 |
+
// Pick feature stories: critical first, then alert
|
| 2617 |
+
const featured = stories.filter(s=>s.urgency==='critical'||s.urgency==='alert').slice(0,8);
|
| 2618 |
+
if(!featured.length){
|
| 2619 |
+
// Fallback: any stories
|
| 2620 |
+
const fallback = stories.slice(0,5);
|
| 2621 |
+
if(!fallback.length){el.style.display='none';return;}
|
| 2622 |
+
featured.push(...fallback);
|
| 2623 |
+
}
|
| 2624 |
+
el.style.display='flex';
|
| 2625 |
+
lnStudioIdx = 0;
|
| 2626 |
+
_renderStudioSlide(el, featured, 0);
|
| 2627 |
+
// Auto-rotate
|
| 2628 |
+
if(lnStudioTimer) clearInterval(lnStudioTimer);
|
| 2629 |
+
lnStudioTimer = setInterval(()=>{
|
| 2630 |
+
if(cTab!=='livenews'){clearInterval(lnStudioTimer);return;}
|
| 2631 |
+
lnStudioIdx = (lnStudioIdx+1) % featured.length;
|
| 2632 |
+
_renderStudioSlide(el, featured, lnStudioIdx);
|
| 2633 |
+
}, 8000);
|
| 2634 |
+
}
|
| 2635 |
+
|
| 2636 |
+
function _renderStudioSlide(el, stories, idx){
|
| 2637 |
+
const s = stories[idx];
|
| 2638 |
+
if(!s) return;
|
| 2639 |
+
const anchor = LN_ANCHORS[s.anchor]||LN_ANCHORS.data;
|
| 2640 |
+
const urgLabel = {critical:'๐ด CRITICAL',alert:'๐ก ALERT',info:'๐ต INFO'}[s.urgency]||'๐ต INFO';
|
| 2641 |
+
const urgCls = s.urgency||'info';
|
| 2642 |
+
const commentary = s.commentary || '';
|
| 2643 |
+
el.style.opacity = '0';
|
| 2644 |
+
setTimeout(()=>{
|
| 2645 |
+
el.innerHTML = `
|
| 2646 |
+
<div class="ln-anchor-panel" style="background:${anchor.gradient}">
|
| 2647 |
+
<div class="ln-anchor-emoji">${anchor.emoji}</div>
|
| 2648 |
+
<div class="ln-anchor-name" style="color:${anchor.color}">${anchor.name}</div>
|
| 2649 |
+
<div class="ln-anchor-tag" style="background:${anchor.tagBg};color:${anchor.color}">${anchor.tag}</div>
|
| 2650 |
+
<div class="ln-anchor-live"><span class="dot"></span>LIVE</div>
|
| 2651 |
+
</div>
|
| 2652 |
+
<div class="ln-story-area">
|
| 2653 |
+
<span class="ln-urgency-badge ${urgCls}">${urgLabel}</span>
|
| 2654 |
+
<div class="ln-headline">${esc(s.headline)}</div>
|
| 2655 |
+
${commentary?`<div class="ln-commentary" id="lnTyping"></div>`:''}
|
| 2656 |
+
<div class="ln-story-time">${timeAgo(s.timestamp)} ยท ${(LN_CAT_LABELS[s.category]||s.category).toUpperCase()} ยท ${idx+1}/${stories.length}</div>
|
| 2657 |
+
</div>
|
| 2658 |
+
`;
|
| 2659 |
+
el.style.opacity = '1';
|
| 2660 |
+
// Typewriter effect
|
| 2661 |
+
if(commentary){
|
| 2662 |
+
_typeWriter(document.getElementById('lnTyping'), commentary, 0);
|
| 2663 |
+
}
|
| 2664 |
+
}, 200);
|
| 2665 |
+
el.style.transition = 'opacity 0.3s';
|
| 2666 |
+
}
|
| 2667 |
+
|
| 2668 |
+
function _typeWriter(el, text, i){
|
| 2669 |
+
if(!el||i>text.length)return;
|
| 2670 |
+
el.innerHTML = esc(text.substring(0, i)) + '<span class="typing-cursor"></span>';
|
| 2671 |
+
if(i < text.length){
|
| 2672 |
+
const speed = Math.random()*15 + 10;
|
| 2673 |
+
setTimeout(()=>_typeWriter(el, text, i+1), speed);
|
| 2674 |
+
} else {
|
| 2675 |
+
// Remove cursor after done
|
| 2676 |
+
setTimeout(()=>{if(el)el.innerHTML=esc(text);},1000);
|
| 2677 |
+
}
|
| 2678 |
+
}
|
| 2679 |
+
|
| 2680 |
+
function setLiveFilter(f){
|
| 2681 |
+
lnFilter = f;
|
| 2682 |
+
document.querySelectorAll('.ln-ctrl-btn').forEach(b=>b.classList.toggle('active', b.dataset.f===f));
|
| 2683 |
+
if(lnData) renderLiveFeed(lnData.stories||[]);
|
| 2684 |
+
}
|
| 2685 |
+
|
| 2686 |
+
function renderLiveFeed(stories){
|
| 2687 |
+
const el = document.getElementById('lnFeed');
|
| 2688 |
+
const title = document.getElementById('lnFeedTitle');
|
| 2689 |
+
// Apply filter
|
| 2690 |
+
let filtered = stories;
|
| 2691 |
+
if(lnFilter==='critical') filtered = stories.filter(s=>s.urgency==='critical');
|
| 2692 |
+
else if(lnFilter==='alert') filtered = stories.filter(s=>s.urgency==='alert'||s.urgency==='critical');
|
| 2693 |
+
else if(lnFilter!=='all') filtered = stories.filter(s=>s.category===lnFilter);
|
| 2694 |
+
|
| 2695 |
+
title.textContent = `๐ก LIVE FEED โ ${filtered.length} stories (${lnFilter==='all'?'All':lnFilter.toUpperCase()})`;
|
| 2696 |
+
|
| 2697 |
+
if(!filtered.length){
|
| 2698 |
+
el.innerHTML = `<div class="ln-no-stories"><div class="big">๐ก</div><div style="font-size:14px;font-weight:600">No stories matching "${lnFilter}"</div><div style="font-size:12px;margin-top:4px">Try "All" or wait for more ecosystem activity</div></div>`;
|
| 2699 |
+
return;
|
| 2700 |
+
}
|
| 2701 |
+
|
| 2702 |
+
el.innerHTML = filtered.map(s=>{
|
| 2703 |
+
const anchor = LN_ANCHORS[s.anchor]||LN_ANCHORS.data;
|
| 2704 |
+
const catLabel = LN_CAT_LABELS[s.category]||s.category;
|
| 2705 |
+
const urgCls = `urgency-${s.urgency||'info'}`;
|
| 2706 |
+
return `<div class="ln-story-card ${urgCls}" onclick="${s.post_id?`openDet(${s.post_id},'market')`:''}" style="${s.post_id?'':'cursor:default'}">
|
| 2707 |
+
<div class="ln-sc-anchor" title="${anchor.name}">${anchor.emoji}</div>
|
| 2708 |
+
<div class="ln-sc-body">
|
| 2709 |
+
<span class="ln-sc-cat ${s.category||''}">${catLabel}</span>
|
| 2710 |
+
<div class="ln-sc-headline">${esc(s.headline)}</div>
|
| 2711 |
+
${s.commentary?`<div class="ln-sc-comment">"${esc(s.commentary.substring(0,200))}"</div>`:''}
|
| 2712 |
+
<div class="ln-sc-time">${timeAgo(s.timestamp)} ยท <span style="color:${anchor.color}">${anchor.name}</span></div>
|
| 2713 |
+
</div>
|
| 2714 |
+
</div>`;
|
| 2715 |
+
}).join('');
|
| 2716 |
+
}
|
| 2717 |
+
|
| 2718 |
+
/* ====== Init: load live news on startup ====== */
|
| 2719 |
+
|
| 2720 |
checkLogin();
|
| 2721 |
</script>
|
| 2722 |
</body>
|