|
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | | - <title>Platform Stats | RMKR Dev</title> |
7 | | - |
8 | | - <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23FFC300' d='M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm400 96c0-17.7-14.3-32-32-32s-32 14.3-32 32V320c0 17.7 14.3 32 32 32s32-14.3 32-32V160zm-128 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V224zm-128 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v32c0 17.7 14.3 32 32 32s32-14.3 32-32V288z'/%3E%3C/svg%3E"> |
| 6 | + <title>System Telemetry | RMKR Dev</title> |
9 | 7 | <script src="https://cdn.tailwindcss.com"></script> |
10 | 8 | <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet"> |
11 | 9 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" /> |
|
17 | 15 | --color-muted: #A0AEC0; --color-line: #2D3748; |
18 | 16 | } |
19 | 17 | body { font-family: 'Inter', sans-serif; background-color: var(--color-bg); color: var(--color-text); } |
20 | | - .wrap { max-width: 900px; margin: 0 auto; padding: 2rem; } |
| 18 | + .wrap { max-width: 1000px; margin: 0 auto; padding: 3rem 1rem; } |
21 | 19 |
|
22 | 20 | .stat-card { |
23 | | - background: var(--color-card); border-radius: 12px; padding: 2rem; |
24 | | - border: 1px solid var(--color-line); text-align: center; |
25 | | - transition: transform 0.3s ease; |
| 21 | + background: var(--color-card); |
| 22 | + border: 1px solid var(--color-line); |
| 23 | + border-radius: 16px; |
| 24 | + padding: 1.5rem; |
| 25 | + transition: transform 0.2s; |
26 | 26 | } |
27 | | - .stat-card:hover { transform: translateY(-5px); border-color: var(--color-accent); } |
28 | | - .number { font-size: 3rem; font-weight: 900; color: var(--color-accent); font-family: 'Courier New', monospace; } |
29 | | - .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--color-muted); font-weight: 700; } |
| 27 | + .stat-card:hover { transform: translateY(-4px); border-color: var(--color-accent); } |
| 28 | + .label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-muted); margin-bottom: 0.5rem; } |
| 29 | + .number { font-family: 'Inter', sans-serif; font-weight: 900; } |
30 | 30 | </style> |
31 | 31 | </head> |
32 | 32 | <body> |
33 | 33 |
|
34 | | -<div class="wrap min-h-screen"> |
35 | | - <header class="flex justify-between items-center mb-12 border-b border-[--color-line] pb-6"> |
| 34 | +<div class="wrap"> |
| 35 | + <header class="flex justify-between items-end mb-12 border-b border-[--color-line] pb-8"> |
36 | 36 | <div> |
37 | | - <h1 class="text-3xl font-bold tracking-tight">System <span class="text-[--color-accent]">Telemetry</span></h1> |
38 | | - <p class="text-sm text-[--color-muted]">All-time page interaction metrics.</p> |
| 37 | + <h1 class="text-3xl font-black text-white italic">SYSTEM<span class="text-[--color-accent] not-italic">STATS</span></h1> |
| 38 | + <p class="text-xs text-[--color-muted] font-bold uppercase tracking-[0.3em] mt-2 text-blue-400">Real-time Telemetry Dashboard</p> |
39 | 39 | </div> |
40 | | - <a href="../" class="text-[--color-accent] hover:scale-110 transition"><i class="fa-solid fa-circle-xmark text-2xl"></i></a> |
| 40 | + <a href="../" class="bg-[--color-card] px-4 py-2 rounded-lg border border-[--color-line] text-[--color-accent] text-xs font-bold uppercase hover:bg-[--color-accent] hover:text-[--color-bg] transition"> |
| 41 | + Back to Hub |
| 42 | + </a> |
41 | 43 | </header> |
42 | 44 |
|
43 | | - <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
44 | | - <div class="stat-card md:col-span-2"> |
45 | | - <div class="label mb-2">Total Hub Entrances</div> |
46 | | - <div id="stat-home" class="number">----</div> |
47 | | - <div class="text-[10px] text-gray-500 mt-4 italic">Tracking unique page loads across rmkr-dev.github.io</div> |
48 | | - </div> |
49 | | - |
| 45 | + <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> |
50 | 46 | <div class="stat-card"> |
51 | | - <i class="fa-solid fa-key text-[--color-muted] mb-4"></i> |
52 | | - <div class="label">JWT Debugger</div> |
53 | | - <div id="stat-jwt" class="number text-2xl text-white">---</div> |
| 47 | + <i class="fa-solid fa-house-laptop text-[--color-muted] mb-4"></i> |
| 48 | + <div class="label">Main Hub Access</div> |
| 49 | + <div id="stat-home" class="number text-3xl text-white">---</div> |
54 | 50 | </div> |
55 | 51 |
|
56 | 52 | <div class="stat-card"> |
57 | | - <i class="fa-solid fa-file-lines text-[--color-muted] mb-4"></i> |
58 | | - <div class="label">Markdown Viewer</div> |
59 | | - <div id="stat-md" class="number text-2xl text-white">---</div> |
| 53 | + <i class="fa-solid fa-clock text-[--color-muted] mb-4"></i> |
| 54 | + <div class="label">Time Overlay</div> |
| 55 | + <div id="stat-time" class="number text-3xl text-white">---</div> |
60 | 56 | </div> |
61 | 57 |
|
62 | 58 | <div class="stat-card"> |
63 | | - <i class="fa-solid fa-clock text-[--color-muted] mb-4"></i> |
64 | | - <div class="label">Time Overlay</div> |
65 | | - <div id="stat-time" class="number text-2xl text-white">---</div> |
| 59 | + <i class="fa-solid fa-paintbrush text-[--color-muted] mb-4"></i> |
| 60 | + <div class="label">Architect Draw</div> |
| 61 | + <div id="stat-draw" class="number text-3xl text-white">---</div> |
66 | 62 | </div> |
67 | 63 |
|
68 | 64 | <div class="stat-card"> |
69 | | - <i class="fa-solid fa-user-tie text-[--color-muted] mb-4"></i> |
70 | | - <div class="label">Profile Deep Dives</div> |
71 | | - <div id="stat-profile" class="number text-2xl text-white">---</div> |
| 65 | + <i class="fa-solid fa-wand-magic-sparkles text-[--color-muted] mb-4"></i> |
| 66 | + <div class="label">Payload Knife</div> |
| 67 | + <div id="stat-transform" class="number text-3xl text-white">---</div> |
72 | 68 | </div> |
73 | 69 |
|
74 | 70 | <div class="stat-card"> |
75 | | - <i class="fa-solid fa-diagram-project text-[--color-muted] mb-4"></i> |
76 | | - <div class="label">Architect Draw</div> |
77 | | - <div id="stat-draw" class="number text-2xl text-white">---</div> |
| 71 | + <i class="fa-solid fa-key text-[--color-muted] mb-4"></i> |
| 72 | + <div class="label">JWT Debugger</div> |
| 73 | + <div id="stat-jwt" class="number text-3xl text-white">---</div> |
78 | 74 | </div> |
79 | 75 |
|
80 | 76 | <div class="stat-card"> |
81 | | - <i class="fa-solid fa-wand-magic-sparkles text-[--color-muted] mb-4"></i> |
82 | | - <div class="label">Payload Knife</div> |
83 | | - <div id="stat-transform" class="number text-2xl text-white">---</div> |
| 77 | + <i class="fa-solid fa-file-code text-[--color-muted] mb-4"></i> |
| 78 | + <div class="label">MD Previewer</div> |
| 79 | + <div id="stat-md" class="number text-3xl text-white">---</div> |
84 | 80 | </div> |
85 | 81 | </div> |
86 | | - |
87 | | - <footer class="mt-16 text-center text-[10px] text-[--color-line] font-mono tracking-widest uppercase"> |
88 | | - Real-time Data fetched from CountAPI Namespace: rmkr-dev.github.io |
89 | | - </footer> |
90 | 82 | </div> |
91 | 83 |
|
92 | 84 | <script> |
93 | 85 | const namespace = "rmkr-dev.github.io"; |
| 86 | + const apiBase = "https://api.countapi.net"; // Stable Endpoint |
94 | 87 |
|
95 | 88 | async function fetchStat(key, elementId) { |
| 89 | + const el = document.getElementById(elementId); |
96 | 90 | try { |
97 | | - // We use 'get' here so viewing the stats page doesn't increment the counts |
98 | | - const response = await fetch(`https://api.countapi.xyz/get/${namespace}/${key}`); |
| 91 | + const response = await fetch(`${apiBase}/get/${namespace}/${key}`); |
| 92 | + if (!response.ok) throw new Error(); |
99 | 93 | const data = await response.json(); |
100 | | - document.getElementById(elementId).innerText = data.value.toLocaleString(); |
| 94 | + el.innerText = data.value.toLocaleString(); |
101 | 95 | } catch (e) { |
102 | | - document.getElementById(elementId).innerText = "ERROR"; |
103 | | - console.error(e); |
| 96 | + el.innerText = "OFFLINE"; |
| 97 | + el.classList.add('text-red-500', 'text-sm'); |
104 | 98 | } |
105 | 99 | } |
106 | 100 |
|
107 | | - // Load all stats on page mount |
108 | 101 | window.onload = () => { |
109 | | - fetchStat('home', 'stat-home'); |
110 | | - fetchStat('jwt', 'stat-jwt'); |
111 | | - fetchStat('md', 'stat-md'); |
112 | | - fetchStat('time', 'stat-time'); |
113 | | - fetchStat('profile', 'stat-profile'); |
114 | | - fetchStat('draw', 'stat-draw'); |
115 | | - fetchStat('transform', 'stat-transform'); |
| 102 | + const statsMap = { |
| 103 | + 'home': 'stat-home', |
| 104 | + 'time': 'stat-time', |
| 105 | + 'draw': 'stat-draw', |
| 106 | + 'transform': 'stat-transform', |
| 107 | + 'jwt': 'stat-jwt', |
| 108 | + 'md': 'stat-md' |
| 109 | + }; |
| 110 | + |
| 111 | + Object.entries(statsMap).forEach(([key, id]) => fetchStat(key, id)); |
116 | 112 | }; |
117 | 113 | </script> |
118 | | - |
119 | 114 | </body> |
120 | 115 | </html> |
0 commit comments