import { fetchEditors, fetchList, fetchLeaderboard, fetchPacks } from '../content.js'; import { store } from '../main.js'; export default { name: 'HomePage', template: ` LOADING... geometry dash; evil dash Browse the List Leaderboard {{ stat.value }} {{ stat.label }} john evil {{ editor.name }} YouTube {{ activeEditor.name }} {{ activeEditor.role || 'List Member' }} {{ activeEditor.completions + activeEditor.verifications ?? '—' }} Total Completions {{ activeEditor.verifications ?? '—' }} First Completions {{ activeEditor.rank != null ? '#' + activeEditor.rank : '—' }} Leaderboard Rank {{ activeEditor.score }} List Score HARDEST DEMON {{ activeEditor.hardest.level }} #{{ activeEditor.hardest.rank }} on the list ← → {{ fact.icon }} {{ fact.text }} ↓ view the list ↓ yeah View the List `, data: () => ({ store, rawEditors: [], leaderboardMap: {}, enrichedEditors: [], loading: true, activeIdx: 0, stats: [ { value: '—', label: 'Demons Ranked' }, { value: '—', label: 'Total Completions' }, { value: '—', label: 'Active Members' }, { value: '—', label: 'Level Packs' }, ], funFacts: [ { icon: '🔥', text: 'i got molested when i was 7' }, { icon: '🤤', text: 'zorpikgmd is our one and only goongod and we are all his bellyslaves' }, { icon: '💀', text: 'we are evil. john ai vs jew bot incident 3/23/2026 never forget ✊' }, ], backgroundLevels: [], }), watch: { 'store.listType'() { resetHome(this); } }, computed: { activeEditor() { return this.enrichedEditors[this.activeIdx] || null; }, spotlightBgStyle() { const ed = this.activeEditor; if (!ed || !ed.hardest) return {}; const p = ed.hardest.path ? `/assets/levels/${ed.hardest.path}.png` : '/assets/levels/default.png'; return { backgroundImage: `url('${p}')` }; }, }, async mounted() { await resetHome(this); }, methods: { setActive(i) { this.activeIdx = i; }, next() { this.activeIdx = (this.activeIdx + 1) % this.enrichedEditors.length; }, prev() { this.activeIdx = (this.activeIdx - 1 + this.enrichedEditors.length) % this.enrichedEditors.length; }, onIconError(e) { e.target.src = '/assets/icons/default.png'; }, }, }; export async function resetHome(ctx) { console.log("evil"); ctx.loading = true; try { const [rawEditors, listData, [leaderboard]] = await Promise.all([ fetchEditors(), fetchList(), fetchLeaderboard(), ]); ctx.rawEditors = (rawEditors || []).map((e) => typeof e === 'string' ? { name: e } : e ); // Build leaderboard lookup keyed by lowercase name const leaderboardMap = {}; if (leaderboard && Array.isArray(leaderboard)) { leaderboard.forEach((entry, idx) => { leaderboardMap[entry.user.toLowerCase()] = { ...entry, rank: idx + 1 }; }); } ctx.leaderboardMap = leaderboardMap; // Stats from list if (listData) { const valid = listData.filter(([, rank, level]) => rank !== null && level !== null); const totalRecords = valid.reduce((s, [,, lv]) => s + (lv?.records?.length ?? 0), 0); ctx.stats[0].value = valid.length; ctx.stats[1].value = totalRecords + valid.length; ctx.stats[2].value = ctx.rawEditors.length; } if (listData) { const valid = listData.filter(([, rank, level]) => rank !== null && level !== null); // pick random levels (like 20–30 so it looks full) const shuffled = valid.sort(() => 0.5 - Math.random()); ctx.backgroundLevels = shuffled.slice(0, 25).map(([, , lv]) => { return `/assets/levels/${lv.path || lv.name}.png`; }); } // Enrich each editor from leaderboard ctx.enrichedEditors = ctx.rawEditors.map((editor) => { const lb = leaderboardMap[editor.name.toLowerCase()]; if (!lb) return { ...editor }; const completions = lb.completed?.length ?? 0; const verifications = lb.verified?.length ?? 0; const allFinished = [...(lb.verified || []), ...(lb.completed || [])]; let hardest = null; if (allFinished.length > 0) { const best = allFinished.reduce((p, c) => c.rank < p.rank ? c : p); hardest = { level: best.level, rank: best.rank, path: best.path, link: best.link }; } return { ...editor, completions, verifications, rank: lb.rank, score: lb.total, hardest }; }); // Pack count try { const packs = await fetchPacks(); if (packs) ctx.stats[3].value = packs.length; } catch { /* non-critical */ } } catch (err) { console.error('HomePage: failed to load data:', err); } finally { ctx.loading = false; } }
LOADING...
geometry dash; evil dash
{{ activeEditor.role || 'List Member' }}
{{ fact.text }}