document.addEventListener('DOMContentLoaded', () => {
// Simple active link when clicking nav
const links = Array.from(document.querySelectorAll('nav a[href^="#"]'));
links.forEach(a => {
a.addEventListener('click', e => {
const id = a.getAttribute('href');
const target = document.querySelector(id);
if (!target) return;
e.preventDefault();
links.forEach(x => x.classList.remove('is-active'));
a.classList.add('is-active');
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
history.replaceState(null, '', id);
});
});
// Minimal demo scoreboard
const data = [
{ rank: 1, player: 'NeoStep', song: 'PARANOiA Rebirth', score: '997,450' },
{ rank: 2, player: 'LainDance', song: 'MAX 300', score: '995,210' },
{ rank: 3, player: 'PadWizard', song: 'vanity angel', score: '992,880' },
];
const board = document.getElementById('score-board');
if (board) {
const table = document.createElement('table');
table.innerHTML = `
Rank Player Song Score