Onttraders commited on
Commit
994da7d
·
verified ·
1 Parent(s): da7c69a

🐳 13/04 - 18:23 - Check for bugs and fix them

Browse files
Files changed (8) hide show
  1. analytics.html +28 -22
  2. app.js +2 -2
  3. artist.html +1 -0
  4. discover.html +1 -0
  5. library.html +1 -0
  6. profile.html +1 -0
  7. track.html +15 -5
  8. upload.html +38 -12
analytics.html CHANGED
@@ -310,28 +310,7 @@
310
  <i data-lucide="globe" class="w-5 h-5 text-cyan-400"></i>
311
  Top Countries
312
  </h3>
313
- <div class="space-y-3">
314
- ${[
315
- {country: 'Germany', percent: 35, flag: '🇩🇪'},
316
- {country: 'United States', percent: 28, flag: '🇺🇸'},
317
- {country: 'United Kingdom', percent: 15, flag: '🇬🇧'},
318
- {country: 'Netherlands', percent: 12, flag: '🇳🇱'},
319
- {country: 'France', percent: 10, flag: '🇫🇷'}
320
- ].map(c => `
321
- <div class="flex items-center gap-3">
322
- <span class="text-xl">${c.flag}</span>
323
- <div class="flex-1">
324
- <div class="flex items-center justify-between mb-1">
325
- <span class="text-sm text-white">${c.country}</span>
326
- <span class="text-sm text-gray-400">${c.percent}%</span>
327
- </div>
328
- <div class="h-2 bg-white/10 rounded-full overflow-hidden">
329
- <div class="h-full bg-gradient-to-r from-cyan-500 to-purple-500 rounded-full" style="width: ${c.percent}%"></div>
330
- </div>
331
- </div>
332
- </div>
333
- `).join('')}
334
- </div>
335
  </div>
336
 
337
  <div class="glass-panel rounded-2xl p-6">
@@ -368,6 +347,33 @@
368
  BF.init('home');
369
  lucide.createIcons();
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  // Generate chart bars on load
372
  const chartData = [35, 42, 38, 55, 48, 62, 75, 68, 82, 95, 88, 102];
373
  const chartContainer = document.getElementById('revenueChart');
 
310
  <i data-lucide="globe" class="w-5 h-5 text-cyan-400"></i>
311
  Top Countries
312
  </h3>
313
+ <div class="space-y-3" id="countryBars"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  </div>
315
 
316
  <div class="glass-panel rounded-2xl p-6">
 
347
  BF.init('home');
348
  lucide.createIcons();
349
 
350
+ // Render country bars
351
+ (function renderCountryBars() {
352
+ const countries = [
353
+ {country: 'Germany', percent: 35, flag: '🇩🇪'},
354
+ {country: 'United States', percent: 28, flag: '🇺🇸'},
355
+ {country: 'United Kingdom', percent: 15, flag: '🇬🇧'},
356
+ {country: 'Netherlands', percent: 12, flag: '🇳🇱'},
357
+ {country: 'France', percent: 10, flag: '🇫🇷'}
358
+ ];
359
+ const container = document.getElementById('countryBars');
360
+ if (!container) return;
361
+ container.innerHTML = countries.map(c =>
362
+ '<div class="flex items-center gap-3">' +
363
+ '<span class="text-xl">' + c.flag + '</span>' +
364
+ '<div class="flex-1">' +
365
+ '<div class="flex items-center justify-between mb-1">' +
366
+ '<span class="text-sm text-white">' + c.country + '</span>' +
367
+ '<span class="text-sm text-gray-400">' + c.percent + '%</span>' +
368
+ '</div>' +
369
+ '<div class="h-2 bg-white/10 rounded-full overflow-hidden">' +
370
+ '<div class="h-full bg-gradient-to-r from-cyan-500 to-purple-500 rounded-full" style="width: ' + c.percent + '%"></div>' +
371
+ '</div>' +
372
+ '</div>' +
373
+ '</div>'
374
+ ).join('');
375
+ })();
376
+
377
  // Generate chart bars on load
378
  const chartData = [35, 42, 38, 55, 48, 62, 75, 68, 82, 95, 88, 102];
379
  const chartContainer = document.getElementById('revenueChart');
app.js CHANGED
@@ -87,10 +87,10 @@ const BF = (() => {
87
  if (user) {
88
  const exists = defaultArtists.find(a => a.id === user.id);
89
  if (!exists) {
90
- return [{ id: user.id, name: user.displayName || user.username, followers: "0", image: user.avatar || `http://static.photos/people/200x200/${Math.floor(Math.random()*100)}`, genre: "Electronic", verified: false, isUser: true }, ...defaultArtists];
91
  }
92
  }
93
- } catch {}
94
  return [...defaultArtists];
95
  };
96
 
 
87
  if (user) {
88
  const exists = defaultArtists.find(a => a.id === user.id);
89
  if (!exists) {
90
+ return [{ id: user.id, name: user.displayName || user.username, followers: user.followers || "0", image: user.avatar || 'http://static.photos/people/200x200/42', genre: "Electronic", verified: false, isUser: true }, ...defaultArtists];
91
  }
92
  }
93
+ } catch (e) { console.error('getArtists error:', e); }
94
  return [...defaultArtists];
95
  };
96
 
artist.html CHANGED
@@ -584,6 +584,7 @@
584
  </div>
585
  </div>
586
 
 
587
  <script src="app.js"></script>
588
  <script>
589
  BF.init('home');
 
584
  </div>
585
  </div>
586
 
587
+ <script src="mobile-nav.js"></script>
588
  <script src="app.js"></script>
589
  <script>
590
  BF.init('home');
discover.html CHANGED
@@ -348,6 +348,7 @@
348
  </div>
349
  </div>
350
 
 
351
  <script src="app.js"></script>
352
  <script>
353
  BF.init('search');
 
348
  </div>
349
  </div>
350
 
351
+ <script src="mobile-nav.js"></script>
352
  <script src="app.js"></script>
353
  <script>
354
  BF.init('search');
library.html CHANGED
@@ -388,6 +388,7 @@
388
  </div>
389
  </div>
390
 
 
391
  <script src="app.js"></script>
392
  <script>
393
  BF.init('home');
 
388
  </div>
389
  </div>
390
 
391
+ <script src="mobile-nav.js"></script>
392
  <script src="app.js"></script>
393
  <script>
394
  BF.init('home');
profile.html CHANGED
@@ -197,6 +197,7 @@
197
  // Stats
198
  const following = JSON.parse(localStorage.getItem('following') || '[]');
199
  document.getElementById('statFollowing').textContent = following.length;
 
200
 
201
  // Get user's tracks
202
  const allTracks = BF.getAllTracks();
 
197
  // Stats
198
  const following = JSON.parse(localStorage.getItem('following') || '[]');
199
  document.getElementById('statFollowing').textContent = following.length;
200
+ document.getElementById('statFollowers').textContent = user.followers || '0';
201
 
202
  // Get user's tracks
203
  const allTracks = BF.getAllTracks();
track.html CHANGED
@@ -279,11 +279,7 @@
279
  <span>4:08</span>
280
  </div>
281
  <div class="h-24 bg-white/5 rounded-lg overflow-hidden relative cursor-pointer" id="waveformContainer">
282
- <div class="absolute inset-0 flex items-center justify-center gap-1 px-4">
283
- ${Array(100).fill(0).map((_, i) => `
284
- <div class="w-1 bg-cyan-400/30 rounded-full waveform-bar" style="height: ${30 + Math.random() * 70}%; animation-delay: ${i * 0.02}s"></div>
285
- `).join('')}
286
- </div>
287
  <div class="absolute inset-0 bg-gradient-to-r from-cyan-500/20 to-transparent w-[35%] pointer-events-none"></div>
288
  </div>
289
  </div>
@@ -638,6 +634,7 @@
638
  </div>
639
  </div>
640
 
 
641
  <script src="app.js"></script>
642
  <script>
643
  BF.init('home');
@@ -936,6 +933,19 @@
936
  lucide.createIcons();
937
  }
938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
939
  // Load initial state
940
  loadGlobalState();
941
 
 
279
  <span>4:08</span>
280
  </div>
281
  <div class="h-24 bg-white/5 rounded-lg overflow-hidden relative cursor-pointer" id="waveformContainer">
282
+ <div class="absolute inset-0 flex items-center justify-center gap-1 px-4" id="trackWaveform"></div>
 
 
 
 
283
  <div class="absolute inset-0 bg-gradient-to-r from-cyan-500/20 to-transparent w-[35%] pointer-events-none"></div>
284
  </div>
285
  </div>
 
634
  </div>
635
  </div>
636
 
637
+ <script src="mobile-nav.js"></script>
638
  <script src="app.js"></script>
639
  <script>
640
  BF.init('home');
 
933
  lucide.createIcons();
934
  }
935
 
936
+ // Render track waveform
937
+ (function renderTrackWaveform() {
938
+ const container = document.getElementById('trackWaveform');
939
+ if (!container) return;
940
+ let bars = '';
941
+ for (let i = 0; i < 100; i++) {
942
+ const h = 30 + Math.random() * 70;
943
+ const delay = (i * 0.02);
944
+ bars += '<div class="w-1 bg-cyan-400/30 rounded-full waveform-bar" style="height: ' + h + '%; animation-delay: ' + delay + 's"></div>';
945
+ }
946
+ container.innerHTML = bars;
947
+ })();
948
+
949
  // Load initial state
950
  loadGlobalState();
951
 
upload.html CHANGED
@@ -248,11 +248,7 @@
248
 
249
  <!-- Waveform Preview -->
250
  <div class="mt-4 h-16 bg-white/5 rounded-lg overflow-hidden relative">
251
- <div class="absolute inset-0 flex items-center justify-center gap-[2px] px-4">
252
- ${Array(60).fill(0).map(() => `
253
- <div class="w-1 bg-cyan-400/50 rounded-full" style="height: ${20 + Math.random() * 80}%"></div>
254
- `).join('')}
255
- </div>
256
  </div>
257
  </div>
258
  </div>
@@ -427,16 +423,16 @@
427
  </div>
428
 
429
  <!-- Pro Feature: Exclusive Content (Keep existing) -->
430
- <div class="glass-panel rounded-2xl p-6 mb-6 ${!isPro ? 'opacity-50' : ''}">
431
  <div class="flex items-center justify-between mb-4">
432
  <h3 class="text-sm font-semibold text-gray-300 flex items-center gap-2">
433
  <i data-lucide="crown" class="w-4 h-4 text-orange-400"></i>
434
  Monetization
435
- ${!isPro ? '<span class="ml-2 px-2 py-0.5 rounded bg-orange-500/20 text-orange-400 text-xs">PRO</span>' : ''}
436
  </h3>
437
  </div>
438
 
439
- <div class="space-y-4 ${!isPro ? 'pointer-events-none' : ''}">
440
  <label class="flex items-start gap-3 cursor-pointer">
441
  <input type="checkbox" id="isExclusive" class="w-4 h-4 rounded border-white/10 bg-white/5 text-orange-400 focus:ring-orange-400 mt-0.5" onchange="toggleMonetization(this)">
442
  <div>
@@ -460,14 +456,12 @@
460
  </div>
461
  </div>
462
 
463
- ${!isPro ? `
464
- <div class="mt-4 p-4 rounded-xl bg-gradient-to-r from-orange-500/20 to-purple-500/20 border border-orange-500/30 text-center">
465
  <p class="text-sm text-white font-medium mb-2">Upgrade to Pro to monetize</p>
466
  <button class="px-4 py-2 rounded-lg bg-orange-500 text-black text-sm font-semibold hover:bg-orange-400 transition glow-orange" onclick="showProUpgrade()">
467
  Upgrade to Pro
468
  </button>
469
  </div>
470
- ` : ''}
471
  </div>
472
 
473
  <!-- License -->
@@ -502,6 +496,7 @@
502
  </p>
503
  </div>
504
  </div>
 
505
  <script src="app.js"></script>
506
  <script>
507
  lucide.createIcons();
@@ -1013,7 +1008,9 @@
1013
  location: '',
1014
  followers: 0,
1015
  following: [],
1016
- tracks: []
 
 
1017
  };
1018
 
1019
  // Save to users database
@@ -1126,6 +1123,35 @@
1126
  loadGlobalState();
1127
  lucide.createIcons();
1128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1129
  // Set default visibility
1130
  document.querySelectorAll('.visibility-option').forEach(opt => {
1131
  opt.addEventListener('click', function() {
 
248
 
249
  <!-- Waveform Preview -->
250
  <div class="mt-4 h-16 bg-white/5 rounded-lg overflow-hidden relative">
251
+ <div class="absolute inset-0 flex items-center justify-center gap-[2px] px-4" id="uploadWaveform"></div>
 
 
 
 
252
  </div>
253
  </div>
254
  </div>
 
423
  </div>
424
 
425
  <!-- Pro Feature: Exclusive Content (Keep existing) -->
426
+ <div class="glass-panel rounded-2xl p-6 mb-6" id="monetizationPanel">
427
  <div class="flex items-center justify-between mb-4">
428
  <h3 class="text-sm font-semibold text-gray-300 flex items-center gap-2">
429
  <i data-lucide="crown" class="w-4 h-4 text-orange-400"></i>
430
  Monetization
431
+ <span class="ml-2 px-2 py-0.5 rounded bg-orange-500/20 text-orange-400 text-xs" id="proBadge">PRO</span>
432
  </h3>
433
  </div>
434
 
435
+ <div class="space-y-4" id="monetizationContent">
436
  <label class="flex items-start gap-3 cursor-pointer">
437
  <input type="checkbox" id="isExclusive" class="w-4 h-4 rounded border-white/10 bg-white/5 text-orange-400 focus:ring-orange-400 mt-0.5" onchange="toggleMonetization(this)">
438
  <div>
 
456
  </div>
457
  </div>
458
 
459
+ <div class="mt-4 p-4 rounded-xl bg-gradient-to-r from-orange-500/20 to-purple-500/20 border border-orange-500/30 text-center" id="proUpgradeCta">
 
460
  <p class="text-sm text-white font-medium mb-2">Upgrade to Pro to monetize</p>
461
  <button class="px-4 py-2 rounded-lg bg-orange-500 text-black text-sm font-semibold hover:bg-orange-400 transition glow-orange" onclick="showProUpgrade()">
462
  Upgrade to Pro
463
  </button>
464
  </div>
 
465
  </div>
466
 
467
  <!-- License -->
 
496
  </p>
497
  </div>
498
  </div>
499
+ </div>
500
  <script src="app.js"></script>
501
  <script>
502
  lucide.createIcons();
 
1008
  location: '',
1009
  followers: 0,
1010
  following: [],
1011
+ tracks: [],
1012
+ likes: 0,
1013
+ reposts: 0
1014
  };
1015
 
1016
  // Save to users database
 
1123
  loadGlobalState();
1124
  lucide.createIcons();
1125
 
1126
+ // Render upload waveform placeholder
1127
+ function renderUploadWaveform() {
1128
+ const container = document.getElementById('uploadWaveform');
1129
+ if (!container) return;
1130
+ container.innerHTML = Array(60).fill(0).map(() =>
1131
+ '<div class="w-1 bg-cyan-400/50 rounded-full" style="height: ' + (20 + Math.random() * 80) + '%"></div>'
1132
+ ).join('');
1133
+ }
1134
+ renderUploadWaveform();
1135
+
1136
+ // Handle monetization section based on pro status
1137
+ (function initMonetization() {
1138
+ const panel = document.getElementById('monetizationPanel');
1139
+ const badge = document.getElementById('proBadge');
1140
+ const cta = document.getElementById('proUpgradeCta');
1141
+ const content = document.getElementById('monetizationContent');
1142
+ if (isPro) {
1143
+ if (panel) panel.classList.remove('opacity-50');
1144
+ if (badge) badge.classList.add('hidden');
1145
+ if (cta) cta.classList.add('hidden');
1146
+ if (content) content.classList.remove('pointer-events-none');
1147
+ } else {
1148
+ if (panel) panel.classList.add('opacity-50');
1149
+ if (badge) badge.classList.remove('hidden');
1150
+ if (cta) cta.classList.remove('hidden');
1151
+ if (content) content.classList.add('pointer-events-none');
1152
+ }
1153
+ })();
1154
+
1155
  // Set default visibility
1156
  document.querySelectorAll('.visibility-option').forEach(opt => {
1157
  opt.addEventListener('click', function() {