Added a small mental arithmatic game
All checks were successful
/ publish (push) Successful in 1m30s
All checks were successful
/ publish (push) Successful in 1m30s
This commit is contained in:
parent
ca67aadac0
commit
70a782d0e4
6 changed files with 268 additions and 0 deletions
14
site/mental-arithmatic/scripts/welcome.js
Normal file
14
site/mental-arithmatic/scripts/welcome.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue