ccusage-ui 0.1.4 β†’ 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "ccusage-ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "main": "server.js",
5
5
  "bin": {
6
6
  "ccusage-ui": "server.js"
7
7
  },
8
8
  "scripts": {
9
9
  "start": "node server.js",
10
- "test": "echo \"Error: no test specified\" && exit 1"
10
+ "test": "echo \"Error: no test specified\" && exit 1",
11
+ "deploy": "gh-pages -d public"
11
12
  },
12
13
  "keywords": [],
13
14
  "author": "Doha Park",
@@ -23,5 +24,8 @@
23
24
  },
24
25
  "dependencies": {
25
26
  "ccusage": "^18.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "gh-pages": "^6.3.0"
26
30
  }
27
- }
31
+ }
package/public/index.html CHANGED
@@ -280,7 +280,7 @@
280
280
  <div>
281
281
  <div style="display: flex; align-items: center; gap: 8px;">
282
282
  <h2 style="margin:0; font-size:18px;">Usage Trend</h2>
283
- <span class="tier-info" data-tippy-content="🌱 Starter: <1M<br>⚑ Pro: 1M+ (Daily User)<br>πŸ”΄ Power: 10M+ (Haiku 4.5 Class)<br>🟣 Mega: 50M+ (Sonnet 4.5 Class)<br>🟣 Legendary: 100M+ (Opus 4.5 Class)">?</span>
283
+ <span class="tier-info" data-tippy-content="⬛ Iron: <5M<br>🟫 Bronze: 5M+<br>⬜ Silver: 10M+<br>🟑 Gold: 30M+<br>πŸ’š Platinum: 50M+<br>πŸ’Ž Emerald: 100M+<br>πŸ’  Diamond: 300M+<br>πŸ”΄ Master: 500M+<br>🟠 Grandmaster: 1B+<br>πŸ† Challenger: 1.5B+ (세계 1μœ„κΈ‰)">?</span>
284
284
  </div>
285
285
 
286
286
  <div id="userLevel" style="font-size:12px; color:#0071e3; margin-top:4px; font-weight:500;"></div>
@@ -493,11 +493,16 @@
493
493
  let displayHTML = "";
494
494
 
495
495
  const getLevelName = (val) => {
496
- if (val >= 100) return "🟣 Legendary (Opus 4.5 Class)";
497
- if (val >= 50) return "🟣 Mega (Sonnet 4.5 Class)";
498
- if (val >= 10) return "πŸ”΄ Power (Haiku 4.5 Class)";
499
- if (val >= 1) return "⚑ Pro (Daily User)";
500
- return "🌱 Starter";
496
+ if (val >= 1500) return "πŸ† Challenger";
497
+ if (val >= 1000) return "🟠 Grandmaster";
498
+ if (val >= 500) return "πŸ”΄ Master";
499
+ if (val >= 300) return "πŸ’  Diamond";
500
+ if (val >= 100) return "πŸ’Ž Emerald";
501
+ if (val >= 50) return "πŸ’š Platinum";
502
+ if (val >= 30) return "🟑 Gold";
503
+ if (val >= 10) return "⬜ Silver";
504
+ if (val >= 5) return "🟫 Bronze";
505
+ return "⬛ Iron";
501
506
  };
502
507
 
503
508
  // Only project if the last data point is the current month
@@ -534,50 +539,67 @@
534
539
  {
535
540
  id: 'custom_lines',
536
541
  beforeDraw: (chart) => {
537
- if (currentMetric === 'tokens') {
538
- const ctx = chart.ctx;
539
- const yAxis = chart.scales.y;
540
- const xAxis = chart.scales.x;
541
-
542
- const drawLine = (value, color, text) => {
543
- const y = yAxis.getPixelForValue(value);
544
- if (y <= yAxis.bottom && y >= yAxis.top) {
545
- ctx.save();
546
- ctx.beginPath();
547
- ctx.strokeStyle = color;
548
- ctx.lineWidth = 2;
549
- ctx.setLineDash([5, 5]);
550
- ctx.moveTo(xAxis.left, y);
551
- ctx.lineTo(xAxis.right, y);
552
- ctx.stroke();
553
-
554
- ctx.fillStyle = color;
555
- ctx.font = "bold 11px -apple-system";
556
- ctx.fillText(text, xAxis.left + 5, y - 6);
557
- ctx.restore();
558
- }
559
- };
542
+ const ctx = chart.ctx;
543
+ const yAxis = chart.scales.y;
544
+ const xAxis = chart.scales.x;
545
+
546
+ const drawLine = (value, color, text) => {
547
+ const y = yAxis.getPixelForValue(value);
548
+ if (y <= yAxis.bottom && y >= yAxis.top) {
549
+ ctx.save();
550
+ ctx.beginPath();
551
+ ctx.strokeStyle = color;
552
+ ctx.lineWidth = 2;
553
+ ctx.setLineDash([5, 5]);
554
+ ctx.moveTo(xAxis.left, y);
555
+ ctx.lineTo(xAxis.right, y);
556
+ ctx.stroke();
557
+
558
+ ctx.fillStyle = color;
559
+ ctx.font = "bold 11px -apple-system";
560
+ ctx.fillText(text, xAxis.left + 5, y - 6);
561
+ ctx.restore();
562
+ }
563
+ };
560
564
 
565
+ if (currentMetric === 'tokens') {
561
566
  if (currentView === 'monthly') {
562
- drawLine(10, '#ff3b30', 'Power (10M)');
563
- drawLine(50, '#af52de', 'Mega (50M)');
564
- drawLine(100, '#5856d6', 'Legendary (100M)');
567
+ drawLine(30, '#ffd700', 'Gold (30M)');
568
+ drawLine(100, '#00e5a0', 'Emerald (100M)');
569
+ drawLine(300, '#00bcd4', 'Diamond (300M)');
570
+ drawLine(500, '#e74c3c', 'Master (500M)');
571
+ drawLine(1000, '#ff9800', 'Grandmaster (1B)');
572
+ drawLine(1500, '#9b59b6', 'Challenger (1.5B)');
565
573
  } else {
566
574
  // Daily Benchmarks
567
-
568
- // 1. Tier Thresholds (Lighter, background context)
569
- // Legendary (100M/mo -> ~3.3M/day)
570
- drawLine(3.3, 'rgba(88, 86, 214, 0.4)', 'Legendary (3.3M)');
571
- // Mega (50M/mo -> ~1.6M/day)
572
- drawLine(1.6, 'rgba(175, 82, 222, 0.4)', 'Mega (1.6M)');
573
- // Power (10M/mo -> ~0.33M/day)
574
- drawLine(0.33, 'rgba(255, 59, 48, 0.4)', 'Power (0.33M)');
575
-
576
- // 2. User Average (Stronger, personal metric)
575
+ // Challenger (1.5B/mo -> ~50M/day)
576
+ drawLine(50, 'rgba(155, 89, 182, 0.5)', 'Challenger (50M)');
577
+ // Grandmaster (1B/mo -> ~33M/day)
578
+ drawLine(33, 'rgba(255, 152, 0, 0.5)', 'Grandmaster (33M)');
579
+ // Master (500M/mo -> ~16.7M/day)
580
+ drawLine(16.7, 'rgba(231, 76, 60, 0.5)', 'Master (16.7M)');
581
+ // Diamond (300M/mo -> ~10M/day)
582
+ drawLine(10, 'rgba(0, 188, 212, 0.5)', 'Diamond (10M)');
583
+ // Gold (30M/mo -> ~1M/day)
584
+ drawLine(1, 'rgba(255, 215, 0, 0.5)', 'Gold (1M)');
585
+
586
+ // User Average
577
587
  const sum = datasetData.reduce((a, b) => a + b, 0);
578
588
  const avg = sum / datasetData.length;
579
589
  drawLine(avg, '#0071e3', `My Avg (${avg.toFixed(1)}M)`);
580
590
  }
591
+ } else if (currentMetric === 'cost') {
592
+ // Subscription plan benchmarks
593
+ if (currentView === 'monthly') {
594
+ drawLine(20, '#34c759', '$20 (Free tier value)');
595
+ drawLine(100, '#ff9500', '$100 Pro');
596
+ drawLine(200, '#ff3b30', '$200 Max');
597
+ } else {
598
+ // Daily cost benchmarks
599
+ drawLine(0.67, 'rgba(52, 199, 89, 0.5)', '$20/mo (~$0.67/day)');
600
+ drawLine(3.3, 'rgba(255, 149, 0, 0.5)', '$100 Pro (~$3.3/day)');
601
+ drawLine(6.7, 'rgba(255, 59, 48, 0.5)', '$200 Max (~$6.7/day)');
602
+ }
581
603
  }
582
604
  }
583
605
  }
@@ -753,18 +775,28 @@
753
775
  }
754
776
 
755
777
  const getLevelName = (val) => {
756
- if (val >= 100) return "Legendary (Opus 4.5 Class)";
757
- if (val >= 50) return "Mega (Sonnet 4.5 Class)";
758
- if (val >= 10) return "Power (Haiku 4.5 Class)";
759
- if (val >= 1) return "Pro (Daily User)";
760
- return "Starter";
778
+ if (val >= 1500) return "Challenger";
779
+ if (val >= 1000) return "Grandmaster";
780
+ if (val >= 500) return "Master";
781
+ if (val >= 300) return "Diamond";
782
+ if (val >= 100) return "Emerald";
783
+ if (val >= 50) return "Platinum";
784
+ if (val >= 30) return "Gold";
785
+ if (val >= 10) return "Silver";
786
+ if (val >= 5) return "Bronze";
787
+ return "Iron";
761
788
  };
762
-
789
+
763
790
  const level = getLevelName(projected);
764
- const levelId = projected >= 100 ? 'legendary' :
765
- projected >= 50 ? 'mega' :
766
- projected >= 10 ? 'power' :
767
- projected >= 1 ? 'pro' : 'starter';
791
+ const levelId = projected >= 1500 ? 'challenger' :
792
+ projected >= 1000 ? 'grandmaster' :
793
+ projected >= 500 ? 'master' :
794
+ projected >= 300 ? 'diamond' :
795
+ projected >= 100 ? 'emerald' :
796
+ projected >= 50 ? 'platinum' :
797
+ projected >= 30 ? 'gold' :
798
+ projected >= 10 ? 'silver' :
799
+ projected >= 5 ? 'bronze' : 'iron';
768
800
 
769
801
  const shareUrl = `https://sowonlabs.github.io/ccusage-ui/share/${levelId}.html`;
770
802
 
Binary file