Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Add floating full-name hover reveal for podium [Top 3]
Browse files- frontend/header.html +20 -7
frontend/header.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
| 29 |
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-12">
|
| 30 |
|
| 31 |
<!-- Podium -->
|
| 32 |
-
<div class="rounded-xl p-6 shadow-sm text-white relative overflow-
|
| 33 |
style="background: linear-gradient(to bottom, #2d7d65, #1f604f);">
|
| 34 |
<div class="absolute -right-6 -top-6 w-20 h-20 rounded-full opacity-50 group-hover:scale-[2.5] transition-transform duration-500"
|
| 35 |
style="background-color: #174d3e;"></div>
|
|
@@ -37,7 +37,7 @@
|
|
| 37 |
<p class="text-sm font-medium text-white/80 uppercase tracking-wider">Podium</p>
|
| 38 |
<i data-lucide="trophy" class="w-5 h-5 text-yellow-300"></i>
|
| 39 |
</div>
|
| 40 |
-
<div id="top-performers-list" class="space-y-3 relative z-10"></div>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<!-- Total Models -->
|
|
@@ -125,6 +125,12 @@
|
|
| 125 |
|
| 126 |
function renderHeaderTableStats(data) {
|
| 127 |
const $ = (selector) => document.querySelector(selector);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
if ($('#stat-total-models')) $('#stat-total-models').innerText = data.length;
|
| 129 |
if ($('#stat-metrics') && window.EVAL_COLUMNS) $('#stat-metrics').innerText = window.EVAL_COLUMNS.filter(c => c !== "Average").length;
|
| 130 |
const avgK = Object.keys(data[0] || {}).find(k => k.includes("Average"));
|
|
@@ -132,10 +138,17 @@
|
|
| 132 |
const top3 = [...data].sort((a, b) => parseFloat(b[avgK]) - parseFloat(a[avgK])).slice(0, 3);
|
| 133 |
const rankStyles = ['bg-yellow-400 text-emerald-900', 'bg-slate-300 text-emerald-900', 'bg-orange-300 text-emerald-900'];
|
| 134 |
$('#top-performers-list').innerHTML = top3.map((m, i) => `
|
| 135 |
-
<div class="
|
| 136 |
-
<div class="
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
</div>
|
| 140 |
`).join('');
|
| 141 |
}
|
|
@@ -147,4 +160,4 @@
|
|
| 147 |
</script>
|
| 148 |
|
| 149 |
</body>
|
| 150 |
-
</html>
|
|
|
|
| 29 |
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-12">
|
| 30 |
|
| 31 |
<!-- Podium -->
|
| 32 |
+
<div class="rounded-xl p-6 shadow-sm text-white relative overflow-visible group col-span-1 sm:col-span-2 lg:col-span-1 transition-all duration-300 ease-in-out transform hover:-translate-y-1 cursor-default"
|
| 33 |
style="background: linear-gradient(to bottom, #2d7d65, #1f604f);">
|
| 34 |
<div class="absolute -right-6 -top-6 w-20 h-20 rounded-full opacity-50 group-hover:scale-[2.5] transition-transform duration-500"
|
| 35 |
style="background-color: #174d3e;"></div>
|
|
|
|
| 37 |
<p class="text-sm font-medium text-white/80 uppercase tracking-wider">Podium</p>
|
| 38 |
<i data-lucide="trophy" class="w-5 h-5 text-yellow-300"></i>
|
| 39 |
</div>
|
| 40 |
+
<div id="top-performers-list" class="space-y-3 relative z-10 overflow-visible"></div>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<!-- Total Models -->
|
|
|
|
| 125 |
|
| 126 |
function renderHeaderTableStats(data) {
|
| 127 |
const $ = (selector) => document.querySelector(selector);
|
| 128 |
+
const esc = (v) => String(v ?? "")
|
| 129 |
+
.replace(/&/g, "&")
|
| 130 |
+
.replace(/</g, "<")
|
| 131 |
+
.replace(/>/g, ">")
|
| 132 |
+
.replace(/\"/g, """)
|
| 133 |
+
.replace(/'/g, "'");
|
| 134 |
if ($('#stat-total-models')) $('#stat-total-models').innerText = data.length;
|
| 135 |
if ($('#stat-metrics') && window.EVAL_COLUMNS) $('#stat-metrics').innerText = window.EVAL_COLUMNS.filter(c => c !== "Average").length;
|
| 136 |
const avgK = Object.keys(data[0] || {}).find(k => k.includes("Average"));
|
|
|
|
| 138 |
const top3 = [...data].sort((a, b) => parseFloat(b[avgK]) - parseFloat(a[avgK])).slice(0, 3);
|
| 139 |
const rankStyles = ['bg-yellow-400 text-emerald-900', 'bg-slate-300 text-emerald-900', 'bg-orange-300 text-emerald-900'];
|
| 140 |
$('#top-performers-list').innerHTML = top3.map((m, i) => `
|
| 141 |
+
<div class="group/podium relative py-0.5">
|
| 142 |
+
<div class="flex items-center gap-3">
|
| 143 |
+
<div class="w-4 h-5 shrink-0 rounded-full ${rankStyles[i] || 'bg-slate-100 text-emerald-900'} flex items-center justify-center text-xs font-bold">${i + 1}</div>
|
| 144 |
+
<span class="text-sm font-semibold truncate flex-1 min-w-0 cursor-help">${esc(m["Model Name"])}</span>
|
| 145 |
+
<span class="ml-auto text-xs font-mono text-emerald-300">${parseFloat(m[avgK]).toFixed(1)}</span>
|
| 146 |
+
</div>
|
| 147 |
+
<div class="absolute left-7 top-full mt-1 z-30 pointer-events-none opacity-0 translate-y-1 group-hover/podium:opacity-100 group-hover/podium:translate-y-0 transition-all duration-200 ease-out">
|
| 148 |
+
<div class="inline-block w-max max-w-[34rem] rounded-md border border-emerald-300/60 bg-emerald-950/90 backdrop-blur px-2 py-1 text-[11px] text-emerald-100 break-words shadow-lg">
|
| 149 |
+
${esc(m["Model Name"])}
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
</div>
|
| 153 |
`).join('');
|
| 154 |
}
|
|
|
|
| 160 |
</script>
|
| 161 |
|
| 162 |
</body>
|
| 163 |
+
</html>
|