完整榜单

全维度 GitHub 开源项目排行 · 数据每日更新

加载中

加载榜单数据...
键 const BOARDS=[ {key:'surge_daily', label:'今日飙升', icon:'🔥', desc:'Today · 按今日新增', showPeriod:true}, {key:'surge_weekly', label:'本周飙升', icon:'📅', desc:'This Week · 7 日新增', showPeriod:true}, {key:'surge_monthly',label:'本月飙升', icon:'🗓️', desc:'This Month · 30 日新增', showPeriod:true}, {key:'burst', label:'新生爆款', icon:'✨', desc:'快速增长的新项目', showPeriod:true}, {key:'heat', label:'综合热度', icon:'🔥', desc:'综合评分最高', showPeriod:true}, {key:'fork_top', label:'Fork 榜', icon:'🍴', desc:'被 Fork 最多', showPeriod:false, showFork:true}, {key:'giants', label:'巨头榜', icon:'🏛️', desc:'Star 数最高', showPeriod:false}, {key:'zh_daily', label:'中文日榜', icon:'🀄', desc:'中文项目 · 今日', showPeriod:true}, {key:'zh_weekly', label:'中文周榜', icon:'🀄', desc:'中文项目 · 本周', showPeriod:true}, {key:'zh_monthly', label:'中文月榜', icon:'🀄', desc:'中文项目 · 本月', showPeriod:true}, ]; let ALL=null, current='surge_daily'; function renderTabs(){ document.getElementById('tabs').innerHTML=BOARDS.map(b=>{ const rows=(ALL.boards[b.key]||[]); if(!rows.length)return''; return `
${b.icon} ${b.label} ${rows.length}
`; }).join(''); document.querySelectorAll('.tab').forEach(t=>t.onclick=()=>{current=t.dataset.key;renderTabs();renderList();}); } function renderList(){ const def=BOARDS.find(b=>b.key===current); const rows=ALL.boards[current]||[]; document.getElementById('board-name').textContent=`${def.icon} ${def.label}`; document.getElementById('board-count').textContent=`${def.desc} · 共 ${rows.length} 个`; if(!rows.length){document.getElementById('list').innerHTML='
该榜单暂无数据
';return} document.getElementById('list').innerHTML=rows.map((r,i)=>{ const[owner,name]=r.repo_full_name.split('/'); const lang=r.repo_language||'';const color=langColors[lang]||'#6b6b73'; const rc=i===0?'t1':i===1?'t2':i===2?'t3':''; const primary=def.showFork ? `
${fmt(r.forks_total)}
forks
` : def.showPeriod && r.period_stars ? `
+${fmt(r.period_stars)}
新增
` : ''; return `
${r.rank||i+1}
${owner}/${name}
${r.description||''}
${lang||'—'}
★ ${fmt(r.stars_total)}
stars
${primary}
`; }).join(''); } async function load(){ try{ const dates=[ new Date().toISOString().split('T')[0], new Date(Date.now()-86400000).toISOString().split('T')[0], '2026-07-06','2026-06-19' ]; let data=null; for(const d of dates){ try{const resp=await fetch(`data/boards_${d}.json`);if(resp.ok){data=await resp.json();break;}}catch(e){continue;} } if(!data)throw new Error('数据文件不存在'); ALL=data; document.getElementById('subtitle').textContent=`全维度 GitHub 开源项目排行 · 数据更新于 ${data.snapshot_date}`; document.getElementById('footer-date').textContent=`© 2026 · 最后更新 ${data.snapshot_date}`; // 选第一个有数据的榜单 if(!(ALL.boards[current]||[]).length){ const first=BOARDS.find(b=>(ALL.boards[b.key]||[]).length); if(first)current=first.key; } renderTabs();renderList(); }catch(e){ document.getElementById('list').innerHTML=`
加载失败: ${e.message}
`; console.error(e); } } load();