Brozy123 commited on
Commit
0cc8979
·
verified ·
1 Parent(s): ece74a6

Update dashboard.html

Browse files
Files changed (1) hide show
  1. dashboard.html +162 -3
dashboard.html CHANGED
@@ -24,6 +24,37 @@
24
  --text-mid: rgba(255,255,255,0.7);
25
  --radius: 16px;
26
  --radius-sm: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  body {
@@ -488,10 +519,10 @@ input:checked + .slider:before {
488
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="8.5" cy="7" r="4"/><line x1="20" y1="8" x2="20" y2="14"/><line x1="23" y1="11" x2="17" y2="11"/></svg>
489
  Invite Bot
490
  </div>
491
- <a class="nav-item" href="/premium" aria-label="Premium" style="color:var(--gold, #FFD700);">
492
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
493
  Premium
494
- </a>
495
  </div>
496
  </div>
497
  <div class="sidebar-footer">
@@ -659,6 +690,87 @@ input:checked + .slider:before {
659
  </div>
660
  </div>
661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  <!-- ===== SERVER SETTINGS PAGE ===== -->
663
  <div class="page" id="page-server-settings">
664
  <div class="topbar">
@@ -828,6 +940,7 @@ function showDashboard() {
828
  loadServers();
829
  loadCommands();
830
  loadLogs();
 
831
 
832
  // Regular intervals
833
  setInterval(loadStats, 15000);
@@ -1084,6 +1197,52 @@ function autoResize(el) {
1084
  el.style.height = 'auto';
1085
  el.style.height = el.scrollHeight + 'px';
1086
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1087
  </script>
1088
  </body>
1089
- </html>
 
24
  --text-mid: rgba(255,255,255,0.7);
25
  --radius: 16px;
26
  --radius-sm: 10px;
27
+ --gold: #FFD700;
28
+ --gold-glow: rgba(255, 215, 0, 0.2);
29
+ }
30
+
31
+ .premium-locked {
32
+ opacity: 0.6;
33
+ filter: grayscale(0.8);
34
+ cursor: not-allowed !important;
35
+ position: relative;
36
+ }
37
+ .premium-locked::after {
38
+ content: '🔒 LOCKED';
39
+ position: absolute;
40
+ top: 12px;
41
+ right: 12px;
42
+ background: rgba(0,0,0,0.5);
43
+ color: white;
44
+ padding: 4px 8px;
45
+ border-radius: 4px;
46
+ font-size: 10px;
47
+ font-weight: 800;
48
+ }
49
+
50
+ .stat-card.premium-unlocked {
51
+ border-color: var(--gold) !important;
52
+ background: linear-gradient(145deg, var(--surface), rgba(255,215,0,0.05)) !important;
53
+ box-shadow: 0 8px 32px var(--gold-glow) !important;
54
+ }
55
+ .stat-card.premium-unlocked:hover {
56
+ transform: translateY(-3px) scale(1.02);
57
+ box-shadow: 0 12px 48px var(--gold-glow) !important;
58
  }
59
 
60
  body {
 
519
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="8.5" cy="7" r="4"/><line x1="20" y1="8" x2="20" y2="14"/><line x1="23" y1="11" x2="17" y2="11"/></svg>
520
  Invite Bot
521
  </div>
522
+ <div class="nav-item" onclick="showPage('premium', this)" style="color:var(--gold, #FFD700);">
523
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
524
  Premium
525
+ </div>
526
  </div>
527
  </div>
528
  <div class="sidebar-footer">
 
690
  </div>
691
  </div>
692
 
693
+ <!-- ===== PREMIUM PAGE ===== -->
694
+ <div class="page" id="page-premium">
695
+ <div class="topbar">
696
+ <h2>⭐ Premium Features</h2>
697
+ <div class="topbar-right">
698
+ <div class="status-pill" id="premium-status-badge" style="background:rgba(255,215,0,0.1); color:var(--gold);">
699
+ <div class="status-dot" style="background:var(--gold);"></div> Checking...
700
+ </div>
701
+ </div>
702
+ </div>
703
+
704
+ <div id="premium-content">
705
+ <div class="panel" id="premium-hero" style="background:linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color:#000; text-align:center; padding:30px;">
706
+ <h3 style="font-size:22px; font-weight:800; margin-bottom:10px;">⭐ FriendlyBot Premium</h3>
707
+ <p style="opacity:0.8; margin-bottom:0;">Unlock exclusive features by winning a league match. Premium is granted automatically when you record a win with <code style="background:rgba(0,0,0,0.1); padding:2px 8px; border-radius:4px;">!win</code>.</p>
708
+ </div>
709
+
710
+ <div class="stats-grid" id="premium-features">
711
+ <div class="stat-card premium-locked" data-premium="0">
712
+ <div class="label">📊 Advanced Stats & Analytics</div>
713
+ <div class="sub">Track goals, assists, clean sheets, and weekly leaderboards for every player.</div>
714
+ </div>
715
+ <div class="stat-card premium-locked" data-premium="1">
716
+ <div class="label">📅 Match Scheduling & Reminders</div>
717
+ <div class="sub">Auto-post scheduled matches with DM reminders before kickoff.</div>
718
+ </div>
719
+ <div class="stat-card premium-locked" data-premium="2">
720
+ <div class="label">🎴 Player Profile Cards</div>
721
+ <div class="sub">Advanced profile images with extra stats and custom backgrounds.</div>
722
+ </div>
723
+ <div class="stat-card premium-locked" data-premium="3">
724
+ <div class="label">🔧 Custom Command Aliases</div>
725
+ <div class="sub">Rename bot commands to fit your server.</div>
726
+ </div>
727
+ </div>
728
+
729
+ <!-- Premium Config Panel (only visible if premium) -->
730
+ <div class="panel" id="premium-config-panel" style="display:none;">
731
+ <div class="panel-header"><h3>⚙️ Premium Settings</h3></div>
732
+ <div class="panel-body" style="padding:24px;">
733
+ <div style="margin-bottom:32px;">
734
+ <h4 style="margin-bottom:16px; font-size:15px; color:var(--gold);">📅 Match Reminders</h4>
735
+ <div style="display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap:24px">
736
+ <div>
737
+ <label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">DM Reminders</label>
738
+ <div style="display:flex; align-items:center; gap:12px">
739
+ <label class="switch">
740
+ <input type="checkbox" id="config-premium-reminders">
741
+ <span class="slider"></span>
742
+ </label>
743
+ <span style="font-size:14px; color:var(--text-mid)">Enabled</span>
744
+ </div>
745
+ </div>
746
+ <div>
747
+ <label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">Reminder Timer (Minutes)</label>
748
+ <input type="number" id="config-premium-reminder-timer" placeholder="60" min="5" max="1440" style="width:100%; padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); color:white; font-size:16px; outline:none">
749
+ <p style="font-size:12px; color:var(--text-dim); margin-top:6px">Players will be DM'd this many minutes before a scheduled league match.</p>
750
+ </div>
751
+ <div>
752
+ <label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">Current Timer</label>
753
+ <div style="padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm);">
754
+ <span id="premium-timer-display" style="font-size:16px; font-weight:700; color:var(--text);">—</span>
755
+ </div>
756
+ </div>
757
+ </div>
758
+ </div>
759
+ <div style="border-top:1px solid var(--border); padding-top:24px; text-align:right">
760
+ <button class="invite-btn" onclick="savePremiumConfig()" style="background:var(--gold); color:#000; padding:12px 32px; font-weight:800;">Save Premium Settings</button>
761
+ </div>
762
+ </div>
763
+ </div>
764
+
765
+ <div class="panel">
766
+ <div class="panel-header"><h3>🏆 Premium Users</h3></div>
767
+ <div class="panel-body" id="premium-users-list" style="padding:24px;">
768
+ <p style="color:var(--text-dim)">Loading...</p>
769
+ </div>
770
+ </div>
771
+ </div>
772
+ </div>
773
+
774
  <!-- ===== SERVER SETTINGS PAGE ===== -->
775
  <div class="page" id="page-server-settings">
776
  <div class="topbar">
 
940
  loadServers();
941
  loadCommands();
942
  loadLogs();
943
+ loadPremium();
944
 
945
  // Regular intervals
946
  setInterval(loadStats, 15000);
 
1197
  el.style.height = 'auto';
1198
  el.style.height = el.scrollHeight + 'px';
1199
  }
1200
+
1201
+ async function loadPremium() {
1202
+ const statusEl = document.getElementById('premium-status-badge');
1203
+ const cards = document.querySelectorAll('#premium-features .stat-card');
1204
+ const listEl = document.getElementById('premium-users-list');
1205
+
1206
+ try {
1207
+ const r = await fetch('/api/premium');
1208
+ const data = await r.json();
1209
+
1210
+ if (data.premium) {
1211
+ statusEl.innerHTML = '<div class="status-dot" style="background:var(--gold);"></div> ACTIVE';
1212
+ statusEl.style.color = 'var(--gold)';
1213
+ cards.forEach(c => {
1214
+ c.classList.remove('premium-locked');
1215
+ c.classList.add('premium-unlocked');
1216
+ c.style.cursor = 'pointer';
1217
+
1218
+ const feature = c.getAttribute('data-premium');
1219
+ c.onclick = () => {
1220
+ if (feature === '0') window.location.href = '/stats';
1221
+ else if (feature === '1') window.location.href = '/scheduling';
1222
+ else if (feature === '2') window.location.href = '/profiles';
1223
+ else if (feature === '3') window.location.href = '/aliases';
1224
+ };
1225
+ });
1226
+ } else {
1227
+ statusEl.innerHTML = '<div class="status-dot" style="background:var(--text-dim);"></div> LOCKED';
1228
+ statusEl.style.color = 'var(--text-dim)';
1229
+ }
1230
+
1231
+ const listR = await fetch('/api/premium/list');
1232
+ const listData = await listR.json();
1233
+ if (listData.list && listData.list.length > 0) {
1234
+ listEl.innerHTML = listData.list.map(u => `
1235
+ <div style="display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid var(--border)">
1236
+ <div style="display:flex; align-items:center; gap:10px">
1237
+ <img src="${u.avatarUrl || '/logo.png'}" style="width:24px; height:24px; border-radius:50%">
1238
+ <span style="font-size:14px">${u.userTag}</span>
1239
+ </div>
1240
+ <span style="font-size:12px; color:var(--text-dim)">${new Date(u.grantedAt).toLocaleDateString()}</span>
1241
+ </div>
1242
+ `).join('');
1243
+ }
1244
+ } catch (e) {}
1245
+ }
1246
  </script>
1247
  </body>
1248
+ </html>