diff options
| author | sillylaird <sillyfanboy@gmail.com> | 2026-09-03 00:33:59 +0000 |
|---|---|---|
| committer | sillylaird <sillyfanboy@gmail.com> | 2026-09-03 00:33:59 +0000 |
| commit | 898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch) | |
| tree | 85c6ee5ad58b860144551184d4cf86b560c62b91 /gaming/stepmania/script.js | |
| download | www-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.tar.gz www-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.zip | |
Diffstat (limited to '')
| -rw-r--r-- | gaming/stepmania/script.js | 46 |
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.';
+ });
+ }
+});
|
