Add animations messages

This commit is contained in:
sepia 2025-07-29 17:56:07 -05:00
parent 70a9359c7f
commit e7221390f3
3 changed files with 37 additions and 0 deletions

View 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);
});