From 1dad8963b1cf837a2aeeea86b143826bf32e39ee Mon Sep 17 00:00:00 2001 From: Michael Brusegard <56915010+michaelbrusegard@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:35:54 +0200 Subject: [PATCH] chore: make dev index more consistant with example --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3e89f79..d4c1947 100644 --- a/index.html +++ b/index.html @@ -23,12 +23,13 @@ window.addEventListener('keydown', function (event) { if (event.code === 'Space') { - const dx = 1000 * (Math.random() - 0.5); - const dy = 1000 * (Math.random() - 0.5); - //simulation.splatAtLocation(500, 500, dx, dy); simulation.multipleSplats(1); } }); + + window.addEventListener('beforeunload', () => { + simulation.stop(); + });