const animations = {}; // animations['black-victory'] = TODO: implement black victory animation // animations['white-victory'] = TODO: implement white victory 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); });