Skip to content

Commit

Permalink
rebundle particle.js with bare requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Crimento committed Mar 29, 2024
1 parent d5f4305 commit 4ce4a29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 13 additions & 2 deletions components/ParticlesBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@

<script setup lang="ts">
import type { Container } from "@tsparticles/engine";
import { tsParticles } from "@tsparticles/engine";
import { loadBasic } from "@tsparticles/basic";
import { loadImageShape } from "@tsparticles/shape-image";
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
if (import.meta.client) {
await loadBasic(tsParticles);
await loadImageShape(tsParticles);
await loadRotateUpdater(tsParticles);
await loadEmittersPlugin(tsParticles);
}
const isLoading = ref({});
isLoading.value = true;
Expand Down Expand Up @@ -82,8 +95,6 @@ const options = {
};
const onLoad = (container: Container) => {
container.pause();
isLoading.value = false;
container.play();
};
</script>
3 changes: 1 addition & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export default defineNuxtConfig({
dataValue: "theme",
},
particles: {
mode: "full",
lazy: true,
mode: "custom",
},
postcss: {
plugins: {
Expand Down

0 comments on commit 4ce4a29

Please sign in to comment.