feat(ui): when the winter comes

This commit is contained in:
Julien Oculi 2025-05-14 17:45:30 +02:00
parent 235cab22b7
commit e0869c5e24

22
islands/Snow.tsx Normal file
View file

@ -0,0 +1,22 @@
import { IS_BROWSER } from 'fresh/runtime'
import { useEffect } from 'preact/hooks'
let getSnow: () => { clear: () => void } | undefined = () => undefined
if (IS_BROWSER) {
const { LetItGo } = await import('jsr:@eastsun5566/let-it-go')
getSnow = () =>
new LetItGo({
radiusRange: [1, 2],
number: globalThis.innerWidth / 4,
})
}
export default function Snow() {
useEffect(() => {
const snow = getSnow()
return () => snow?.clear()
}, [])
return null
}