Skip to content

Commit bac2147

Browse files
committed
feat: add community page
1 parent adf52e1 commit bac2147

2 files changed

Lines changed: 214 additions & 14 deletions

File tree

community.html

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>BalatroBench Community</title>
8+
<script src="https://cdn.jsdelivr.net/npm/heroicons@2.0.18/24/outline/index.js"></script>
9+
<script src="https://cdn.tailwindcss.com"></script>
10+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11+
<script src="script.js"></script>
12+
</head>
13+
14+
<body class="bg-gray-50 min-h-screen py-8">
15+
<div class="container mx-auto px-4">
16+
<h1 class="text-4xl font-bold text-center text-gray-800 mb-8">BalatroBench Community</h1>
17+
18+
<div class="overflow-x-auto bg-white rounded-lg shadow-lg">
19+
<table id="leaderboard" class="w-full table-auto">
20+
<thead class="bg-gray-100">
21+
<tr class="border-b border-gray-200">
22+
<!-- Rank Section -->
23+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 border-r-2 border-gray-300">#</th>
24+
<!-- Author Section -->
25+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700">Author</th>
26+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden lg:table-cell">
27+
Strategy</th>
28+
<!-- Stats Section -->
29+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 border-l-2 border-gray-300">
30+
Round</th>
31+
<!-- Tool Calls Section -->
32+
<th
33+
class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden sm:table-cell border-l-2 border-gray-300">
34+
<div class="flex items-center justify-center space-x-1">
35+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"
36+
class="w-4 h-4 text-green-600">
37+
<path fill-rule="evenodd"
38+
d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm3.844-8.791a.75.75 0 0 0-1.188-.918l-3.7 4.79-1.649-1.833a.75.75 0 1 0-1.114 1.004l2.25 2.5a.75.75 0 0 0 1.15-.043l4.25-5.5Z"
39+
clip-rule="evenodd" />
40+
</svg>
41+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
42+
<path fill-rule="evenodd"
43+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
44+
clip-rule="evenodd" />
45+
<path
46+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
47+
</svg>
48+
</div>
49+
</th>
50+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden sm:table-cell">
51+
<div class="flex items-center justify-center space-x-1">
52+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"
53+
class="w-4 h-4 text-yellow-500">
54+
<path fill-rule="evenodd"
55+
d="M6.701 2.25c.577-1 2.02-1 2.598 0l5.196 9a1.5 1.5 0 0 1-1.299 2.25H2.804a1.5 1.5 0 0 1-1.3-2.25l5.197-9ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 1 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
56+
clip-rule="evenodd" />
57+
</svg>
58+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
59+
<path fill-rule="evenodd"
60+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
61+
clip-rule="evenodd" />
62+
<path
63+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
64+
</svg>
65+
</div>
66+
</th>
67+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden sm:table-cell">
68+
<div class="flex items-center justify-center space-x-1">
69+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"
70+
class="w-4 h-4 text-red-600">
71+
<path fill-rule="evenodd"
72+
d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
73+
clip-rule="evenodd" />
74+
</svg>
75+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
76+
<path fill-rule="evenodd"
77+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
78+
clip-rule="evenodd" />
79+
<path
80+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
81+
</svg>
82+
</div>
83+
</th>
84+
<!-- Tokens Section -->
85+
<th
86+
class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden lg:table-cell border-l-2 border-gray-300">
87+
<div class="flex items-center justify-center space-x-1">
88+
<span>In</span>
89+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
90+
<path d="M8 7c3.314 0 6-1.343 6-3s-2.686-3-6-3-6 1.343-6 3 2.686 3 6 3Z" />
91+
<path
92+
d="M8 8.5c1.84 0 3.579-.37 4.914-1.037A6.33 6.33 0 0 0 14 6.78V8c0 1.657-2.686 3-6 3S2 9.657 2 8V6.78c.346.273.72.5 1.087.683C4.42 8.131 6.16 8.5 8 8.5Z" />
93+
<path
94+
d="M8 12.5c1.84 0 3.579-.37 4.914-1.037.366-.183.74-.41 1.086-.684V12c0 1.657-2.686 3-6 3s-6-1.343-6-3v-1.22c.346.273.72.5 1.087.683C4.42 12.131 6.16 12.5 8 12.5Z" />
95+
</svg>
96+
<span class="text-xs">/</span>
97+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
98+
<path fill-rule="evenodd"
99+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
100+
clip-rule="evenodd" />
101+
<path
102+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
103+
</svg>
104+
</div>
105+
</th>
106+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden lg:table-cell">
107+
<div class="flex items-center justify-center space-x-1">
108+
<span>Out</span>
109+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
110+
<path d="M8 7c3.314 0 6-1.343 6-3s-2.686-3-6-3-6 1.343-6 3 2.686 3 6 3Z" />
111+
<path
112+
d="M8 8.5c1.84 0 3.579-.37 4.914-1.037A6.33 6.33 0 0 0 14 6.78V8c0 1.657-2.686 3-6 3S2 9.657 2 8V6.78c.346.273.72.5 1.087.683C4.42 8.131 6.16 8.5 8 8.5Z" />
113+
<path
114+
d="M8 12.5c1.84 0 3.579-.37 4.914-1.037.366-.183.74-.41 1.086-.684V12c0 1.657-2.686 3-6 3s-6-1.343-6-3v-1.22c.346.273.72.5 1.087.683C4.42 12.131 6.16 12.5 8 12.5Z" />
115+
</svg>
116+
<span class="text-xs">/</span>
117+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
118+
<path fill-rule="evenodd"
119+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
120+
clip-rule="evenodd" />
121+
<path
122+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
123+
</svg>
124+
</div>
125+
</th>
126+
<!-- Performance Section -->
127+
<th
128+
class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden md:table-cell border-l-2 border-gray-300">
129+
<div class="flex items-center justify-center space-x-1">
130+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
131+
<path fill-rule="evenodd"
132+
d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8Zm7.75-4.25a.75.75 0 0 0-1.5 0V8c0 .414.336.75.75.75h3.25a.75.75 0 0 0 0-1.5h-2.5v-3.5Z"
133+
clip-rule="evenodd" />
134+
</svg>
135+
<span class="text-xs">/</span>
136+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
137+
<path fill-rule="evenodd"
138+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
139+
clip-rule="evenodd" />
140+
<path
141+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
142+
</svg>
143+
<span class="text-xs">[s]</span>
144+
</div>
145+
</th>
146+
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 hidden md:table-cell">
147+
<div class="flex items-center justify-center space-x-1">
148+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
149+
<path
150+
d="M6.375 5.5h.875v1.75h-.875a.875.875 0 1 1 0-1.75ZM8.75 10.5V8.75h.875a.875.875 0 0 1 0 1.75H8.75Z" />
151+
<path fill-rule="evenodd"
152+
d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM7.25 3.75a.75.75 0 0 1 1.5 0V4h2.5a.75.75 0 0 1 0 1.5h-2.5v1.75h.875a2.375 2.375 0 1 1 0 4.75H8.75v.25a.75.75 0 0 1-1.5 0V12h-2.5a.75.75 0 0 1 0-1.5h2.5V8.75h-.875a2.375 2.375 0 1 1 0-4.75h.875v-.25Z"
153+
clip-rule="evenodd" />
154+
</svg>
155+
<span class="text-xs">/</span>
156+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
157+
<path fill-rule="evenodd"
158+
d="M15 4.5A3.5 3.5 0 0 1 11.435 8c-.99-.019-2.093.132-2.7.913l-4.13 5.31a2.015 2.015 0 1 1-2.827-2.828l5.309-4.13c.78-.607.932-1.71.914-2.7L8 4.5a3.5 3.5 0 0 1 4.477-3.362c.325.094.39.497.15.736L10.6 3.902a.48.48 0 0 0-.033.653c.271.314.565.608.879.879a.48.48 0 0 0 .653-.033l2.027-2.027c.239-.24.642-.175.736.15.09.31.138.637.138.976ZM3.75 13a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
159+
clip-rule="evenodd" />
160+
<path
161+
d="M11.5 9.5c.313 0 .62-.029.917-.084l1.962 1.962a2.121 2.121 0 0 1-3 3l-2.81-2.81 1.35-1.734c.05-.064.158-.158.426-.233.278-.078.639-.11 1.062-.102l.093.001ZM5 4l1.446 1.445a2.256 2.256 0 0 1-.047.21c-.075.268-.169.377-.233.427l-.61.474L4 5H2.655a.25.25 0 0 1-.224-.139l-1.35-2.7a.25.25 0 0 1 .047-.289l.745-.745a.25.25 0 0 1 .289-.047l2.7 1.35A.25.25 0 0 1 5 2.654V4Z" />
162+
</svg>
163+
<span class="text-xs">[m$]</span>
164+
</div>
165+
</th>
166+
</tr>
167+
</thead>
168+
<tbody id="leaderboard-body" class="divide-y divide-gray-200 text-sm">
169+
</tbody>
170+
</table>
171+
</div>
172+
</div>
173+
174+
</body>
175+
176+
</html>

script.js

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Load details for a specific model
2-
async function loadDetails(vendor, model) {
2+
async function loadDetails(vendor, model, basePath = 'data/benchmarks/v0.8.0/default') {
33
try {
4-
const response = await fetch(`data/benchmarks/v0.8.0/default/${vendor}/${model}.json`);
4+
const response = await fetch(`${basePath}/${vendor}/${model}.json`);
55
const data = await response.json();
66
return data;
77
} catch (error) {
@@ -406,9 +406,9 @@ function createDetailRow(stats, modelName, data) {
406406
}
407407

408408
// Load and display leaderboard data
409-
async function loadLeaderboard() {
409+
async function loadLeaderboard(basePath = 'data/benchmarks/v0.8.0/default', displayMode = 'model') {
410410
try {
411-
const response = await fetch('data/benchmarks/v0.8.0/default/leaderboard.json');
411+
const response = await fetch(`${basePath}/leaderboard.json`);
412412
const data = await response.json();
413413

414414
const tableBody = document.getElementById('leaderboard-body');
@@ -417,6 +417,25 @@ async function loadLeaderboard() {
417417
const row = document.createElement('tr');
418418
row.className = 'hover:bg-gray-50 transition-colors duration-150 lg:cursor-pointer';
419419

420+
// Parse data based on display mode
421+
let primaryValue, secondaryValue, vendor, model;
422+
423+
if (displayMode === 'community') {
424+
primaryValue = entry.config.author || 'Unknown Author';
425+
secondaryValue = entry.config.strategy || 'Unknown Strategy';
426+
// For detail loading, we still need vendor/model from config.model
427+
const modelParts = entry.config.model.split('/');
428+
vendor = modelParts[0];
429+
model = modelParts[1];
430+
} else {
431+
// Parse model and vendor from config.model (format: "vendor/model")
432+
const modelParts = entry.config.model.split('/');
433+
vendor = modelParts[0];
434+
model = modelParts[1];
435+
primaryValue = model;
436+
secondaryValue = vendor;
437+
}
438+
420439
// Make row clickable on lg+ screens
421440
row.addEventListener('click', async () => {
422441
if (window.innerWidth >= 1024) { // lg breakpoint
@@ -431,18 +450,14 @@ async function loadLeaderboard() {
431450
document.querySelectorAll('.detail-row').forEach(dr => dr.remove());
432451

433452
// Load and show details
434-
const data = await loadDetails(vendor, model);
435-
const detailRow = createDetailRow(data.stats, model, data);
453+
const data = await loadDetails(vendor, model, basePath);
454+
const detailRow = createDetailRow(data.stats, displayMode === 'community' ?
455+
primaryValue : model, data);
436456
row.insertAdjacentElement('afterend', detailRow);
437457
}
438458
}
439459
});
440460

441-
// Parse model and vendor from config.model (format: "vendor/model")
442-
const modelParts = entry.config.model.split('/');
443-
const vendor = modelParts[0];
444-
const model = modelParts[1];
445-
446461
// Calculate percentages
447462
const successRate = ((entry.calls.successful / entry.calls.total) * 100).toFixed(0);
448463
const failureRate = ((entry.calls.failed / entry.calls.total) * 100).toFixed(0);
@@ -468,8 +483,8 @@ async function loadLeaderboard() {
468483

469484
row.innerHTML = `
470485
<td class="px-4 py-3 text-left text-gray-700 font-mono">${index + 1}</td>
471-
<td class="px-4 py-3 text-center text-gray-700 font-mono whitespace-nowrap">${model}</td>
472-
<td class="px-4 py-3 text-center text-gray-700 font-mono whitespace-nowrap hidden lg:table-cell">${vendor}</td>
486+
<td class="px-4 py-3 text-center text-gray-700 font-mono whitespace-nowrap">${primaryValue}</td>
487+
<td class="px-4 py-3 text-center text-gray-700 font-mono whitespace-nowrap hidden lg:table-cell">${secondaryValue}</td>
473488
<td class="px-4 py-3 text-center text-gray-700 font-mono">
474489
<div class="flex justify-center items-center">
475490
<span class="w-8 text-center">${avgRound}</span>
@@ -521,4 +536,13 @@ async function loadLeaderboard() {
521536
}
522537

523538
// Load data when page loads
524-
document.addEventListener('DOMContentLoaded', loadLeaderboard);
539+
document.addEventListener('DOMContentLoaded', () => {
540+
// Detect if this is the community page
541+
const isCommunityPage = document.title.includes('Community');
542+
543+
if (isCommunityPage) {
544+
loadLeaderboard('data/community/v0.8.0/default', 'community');
545+
} else {
546+
loadLeaderboard();
547+
}
548+
});

0 commit comments

Comments
 (0)