gomoku/public/scripts/make-animations.js

19 lines
502 B
JavaScript
Executable File

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