UNPKG

@llds/bg-dots

Version:

A lightweight background dot animation using PixiJS and Simplex Noise.

34 lines (28 loc) 576 B
## Setup ```bash npm i @llds/bg-dots ``` ```bash pnpm add @llds/bg-dots ``` ## Usage ```ts <script setup lang="ts"> import { useBackgroundDots } from '@llds/bg-dots' import { onMounted, ref } from 'vue' const bg = ref<HTMLDivElement | null>(null) onMounted(() => { if (bg.value) { useBackgroundDots(bg.value, false) } }) </script> <template> <div id="bg-dots__project"> <div ref="bg" class="h-full w-full pointer-events-none fixed" /> <RouterView /> </div> </template> ``` ## Reference [Anthony Fu](https://antfu.me/)