webtools/site/mental-arithmatic/scripts/welcome.js
Leon Mika 70a782d0e4
All checks were successful
/ publish (push) Successful in 1m30s
Added a small mental arithmatic game
2026-01-15 22:51:48 +11:00

14 lines
376 B
JavaScript

import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
export class WelcomeController extends Controller {
startGame(ev) {
ev.preventDefault();
this.element.classList.add('hidden');
window.dispatchEvent(new CustomEvent("startGame"));
}
gameEnded(ev) {
this.element.classList.remove('hidden');
}
}