Update +layout.svelte

This commit is contained in:
Luke Hagar
2024-01-02 22:21:07 -06:00
parent 4fe04c9986
commit 0c43f3cdfe

View File

@@ -2,9 +2,19 @@
import '$lib/theme-luke.css'; import '$lib/theme-luke.css';
import '../app.postcss'; import '../app.postcss';
import Particles, { particlesInit } from '@tsparticles/svelte'; import { onMount } from 'svelte';
import { particlesInit } from '@tsparticles/svelte';
import { loadFull } from 'tsparticles'; import { loadFull } from 'tsparticles';
let ParticlesComponent;
onMount(async () => {
const module = await import('@tsparticles/svelte');
ParticlesComponent = module.default;
});
const particlesConfig = { const particlesConfig = {
particles: { particles: {
color: { color: {
@@ -33,6 +43,6 @@
}); });
</script> </script>
<Particles id="tsparticles" options={particlesConfig} /> <svelte:component this={ParticlesComponent} id="tsparticles" options={particlesConfig} />
<!-- Page Route Content --> <!-- Page Route Content -->
<slot /> <slot />