aboutsummaryrefslogtreecommitdiff
path: root/lib/components
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-04-22 09:09:27 +0530
committerBobby <[email protected]>2026-04-22 09:09:27 +0530
commitbbb8a51490f98dfc02ab9a0fd79248806c80e705 (patch)
tree3ab7941d74eaff2b01990f42a253d9c02b9d1196 /lib/components
parent2c89a4173b5705e329d6a1e1dbdb408ac5a43811 (diff)
downloadhollowdark-bbb8a51490f98dfc02ab9a0fd79248806c80e705.tar.xz
hollowdark-bbb8a51490f98dfc02ab9a0fd79248806c80e705.zip
Expand Settings with Display and About sections and a reduce-motion override for the leaf scene
Diffstat (limited to 'lib/components')
-rw-r--r--lib/components/LeafScene.svelte5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/components/LeafScene.svelte b/lib/components/LeafScene.svelte
index d60b555..53dce6b 100644
--- a/lib/components/LeafScene.svelte
+++ b/lib/components/LeafScene.svelte
@@ -1,6 +1,7 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte'
import { createRNG } from '@hollowdark/rng/seeded'
+ import { reduceMotion } from '@hollowdark/lib/display/state'
import { LEAF_VARIANTS } from '@hollowdark/lib/leaves/variants'
import { spawnLeaf } from '@hollowdark/lib/leaves/spawn'
import { isLeafOffscreen, stepLeaf } from '@hollowdark/lib/leaves/physics'
@@ -17,7 +18,7 @@
const rng = createRNG(Math.floor(performance.now() * 1000) | 0)
- let container: HTMLDivElement | null = null
+ let container: HTMLDivElement | null = $state(null)
let scene: SceneDimensions = $state({ width: 0, height: 0, groundY: 0 })
let leaves: Leaf[] = $state([])
let wind: WindSystem = $state(initialWindSystem(rng))
@@ -92,6 +93,7 @@
})
</script>
+{#if !$reduceMotion}
<div class="leaf-scene" bind:this={container} aria-hidden="true">
<svg class="defs" width="0" height="0" focusable="false">
<defs>
@@ -139,6 +141,7 @@
</svg>
{/each}
</div>
+{/if}
<style>
.leaf-scene {