22 lines
521 B
Text
22 lines
521 B
Text
---
|
|
type Props = {
|
|
class?: string;
|
|
};
|
|
|
|
const { class: cls }: Props = Astro.props;
|
|
---
|
|
|
|
<div id="tsparticles" class={cls}></div>
|
|
|
|
<script>
|
|
// pnpm i @tsparticles/engine @tsparticles/slim
|
|
// Make sure to import your options here
|
|
import { options } from "@/scripts/particles";
|
|
import { tsParticles } from "@tsparticles/engine";
|
|
import { loadSlim } from "@tsparticles/slim";
|
|
|
|
(async () => {
|
|
await loadSlim(tsParticles);
|
|
await tsParticles.load({ id: "tsparticles", options: options });
|
|
})();
|
|
</script>
|