First commit, phased 1 and 2 created but untested

This commit is contained in:
bepis
2026-10-20 07:40:35 +11:00
commit 7a3e408ffc
66 changed files with 5639 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('create-hero-form');
if (!form) return;
form.addEventListener('submit', async (e) => {
e.preventDefault();
const name = document.getElementById('hero-name').value.trim();
const classKey = document.getElementById('hero-class').value;
if (!name || !classKey) {
showError('Please enter a hero name and choose a class.');
return;
}
try {
await api.post('/character', { name, class: classKey });
window.location.href = '/game.html';
} catch (_) {
// Error already shown via api()
}
});
});