diff --git a/node/server/public/app.js b/node/server/public/app.js index e69de29..f214776 100644 --- a/node/server/public/app.js +++ b/node/server/public/app.js @@ -0,0 +1,12 @@ +// Im Client (public/app.js) +const ws = new WebSocket(`ws://${location.host}`); + +ws.addEventListener('message', async (event) => { + const msg = JSON.parse(event.data); + if (msg.type === 'spirit') { + const spirit = msg.data; + // Lade spirit.modelUrl (GLTF), spirit.name, spirit.desc etc. + // (Dein Rendercode wie bisher, nur Spirit-Daten dynamisch) + showSpirit(spirit); + } +}); \ No newline at end of file