Add animations messages
This commit is contained in:
parent
70a9359c7f
commit
e7221390f3
3 changed files with 37 additions and 0 deletions
18
public/scripts/make-animations.js
Executable file
18
public/scripts/make-animations.js
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
const animations = {};
|
||||
// animations['victory'] = TODO: implement victory animation
|
||||
// animations['defeat'] = TODO: implement defeat animation
|
||||
// animations['draw'] = TODO: implement draw animation
|
||||
|
||||
document.addEventListener('htmx:wsAfterMessage', function (e) {
|
||||
let msg;
|
||||
try {
|
||||
msg = JSON.parse(e.detail.message);
|
||||
} catch (_) {
|
||||
return;
|
||||
}
|
||||
if (msg.type !== 'animation') {
|
||||
return;
|
||||
}
|
||||
// TODO: implement animation playback
|
||||
console.log('Animation requested:', msg.animation);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue