From 720d752748b793a2f5cf3cc14cb75ad86e8919c0 Mon Sep 17 00:00:00 2001 From: sillylaird Date: Tue, 3 Feb 2026 21:27:57 -0500 Subject: First commit --- gaming/stepmania/script.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 gaming/stepmania/script.js (limited to 'gaming/stepmania/script.js') diff --git a/gaming/stepmania/script.js b/gaming/stepmania/script.js new file mode 100644 index 0000000..1deb43c --- /dev/null +++ b/gaming/stepmania/script.js @@ -0,0 +1,46 @@ +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 = ` + + RankPlayerSongScore + + + ${data.map(r => ` + ${r.rank}${r.player}${r.song}${r.score} + `).join('')} + `; + board.replaceChildren(table); + } + + // Join button feedback + const btn = document.getElementById('join-event'); + if (btn) { + btn.addEventListener('click', () => { + btn.disabled = true; + btn.textContent = 'You’re in! Check your inbox.'; + }); + } +}); -- cgit v1.2.3