Code4Scene / assets /leaderboard-controls.js
KoeYe's picture
Unify task examples, add chart tooltips and bound scene loading
7d419bd
Raw History Blame Contribute Delete
574 Bytes
const input=document.getElementById('model-search'),tables=[...document.querySelectorAll('table.board')];
function filter(){let shown=0;for(const table of tables){let rank=0;for(const row of table.tBodies[0].rows){row.hidden=!row.dataset.search.includes(input.value.trim().toLowerCase());if(!row.hidden)row.cells[0].textContent=++rank;}shown=rank;}document.getElementById('ranking-count').textContent=shown+' of 14 configurations';}
input.addEventListener('input',filter);tables.forEach(t=>t.querySelectorAll('th[data-k]').forEach(th=>th.addEventListener('click',filter)));