summaryrefslogtreecommitdiff
path: root/gaming/stepmania/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'gaming/stepmania/script.js')
-rw-r--r--gaming/stepmania/script.js46
1 files changed, 46 insertions, 0 deletions
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 = `
+ <thead><tr>
+ <th>Rank</th><th>Player</th><th>Song</th><th>Score</th>
+ </tr></thead>
+ <tbody>
+ ${data.map(r => `<tr>
+ <td>${r.rank}</td><td>${r.player}</td><td>${r.song}</td><td>${r.score}</td>
+ </tr>`).join('')}
+ </tbody>`;
+ 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.';
+ });
+ }
+});