dont rotate space when clicking shapes

This commit is contained in:
Orion Reed 2024-12-19 19:32:45 -05:00
parent 9bbc37c729
commit 9fe82fc075
1 changed files with 5 additions and 2 deletions

View File

@ -33,9 +33,12 @@
import '@labs/standalone/folk-shape.ts';
const space = document.getElementById('space');
document.addEventListener('click', () => {
document.addEventListener('click', (event) => {
if (event.target !== space) return;
// Random rotation between 30 and 75 degrees
const randomRotation = Math.random() * 45 + 30;
const min = 20;
const max = 70;
const randomRotation = Math.random() * (max - min) + min;
space.rotate(randomRotation);
});
</script>