@tsparticles/template-particles 4.1.3 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +3 -0
  3. package/package.json +4 -3
  4. package/template/angular/package.json +34 -0
  5. package/template/angular/src/app/app.component.css +16 -0
  6. package/template/angular/src/app/app.component.html +4 -0
  7. package/template/angular/src/app/app.component.ts +38 -0
  8. package/template/angular-confetti/package.json +36 -0
  9. package/template/angular-confetti/src/app/app.component.css +16 -0
  10. package/template/angular-confetti/src/app/app.component.html +4 -0
  11. package/template/angular-confetti/src/app/app.component.ts +38 -0
  12. package/template/angular-fireworks/package.json +36 -0
  13. package/template/angular-fireworks/src/app/app.component.css +16 -0
  14. package/template/angular-fireworks/src/app/app.component.html +4 -0
  15. package/template/angular-fireworks/src/app/app.component.ts +38 -0
  16. package/template/astro/package.json +18 -0
  17. package/template/astro/src/pages/index.astro +53 -0
  18. package/template/ember/app/templates/application.hbs +4 -0
  19. package/template/ember/package.json +20 -0
  20. package/template/inferno/package.json +21 -0
  21. package/template/inferno/src/App.css +21 -0
  22. package/template/inferno/src/App.tsx +42 -0
  23. package/template/jquery/package.json +21 -0
  24. package/template/jquery/src/main.ts +49 -0
  25. package/template/jquery/src/style.css +21 -0
  26. package/template/lit/package.json +21 -0
  27. package/template/lit/src/my-app.ts +64 -0
  28. package/template/nextjs/package.json +24 -0
  29. package/template/nextjs/src/app/page.tsx +39 -0
  30. package/template/nuxt2/package.json +20 -0
  31. package/template/nuxt2/pages/index.vue +83 -0
  32. package/template/nuxt3/app.vue +62 -0
  33. package/template/nuxt3/package.json +18 -0
  34. package/template/nuxt4/app.vue +62 -0
  35. package/template/nuxt4/package.json +18 -0
  36. package/template/preact/package.json +22 -0
  37. package/template/preact/src/App.css +21 -0
  38. package/template/preact/src/App.tsx +40 -0
  39. package/template/qwik/package.json +21 -0
  40. package/template/qwik/src/App.tsx +50 -0
  41. package/template/react/package.json +19 -0
  42. package/template/react/src/App.css +21 -0
  43. package/template/react/src/App.tsx +38 -0
  44. package/template/riot/package.json +21 -0
  45. package/template/riot/src/app.riot +31 -0
  46. package/template/solid/package.json +18 -0
  47. package/template/solid/src/App.tsx +59 -0
  48. package/template/solid/src/index.css +21 -0
  49. package/template/solid/src/main.tsx +9 -0
  50. package/template/stencil/package.json +21 -0
  51. package/template/stencil/src/components/app-home/app-home.tsx +64 -0
  52. package/template/svelte/package.json +20 -0
  53. package/template/svelte/src/App.svelte +70 -0
  54. package/template/svelte/src/main.ts +12 -0
  55. package/template/vanilla/LICENSE +21 -0
  56. package/template/vanilla/package.json +1 -1
  57. package/template/vue2/package.json +23 -0
  58. package/template/vue2/src/App.vue +83 -0
  59. package/template/vue3/package.json +19 -0
  60. package/template/vue3/src/App.vue +53 -0
  61. package/template/vue3/src/main.ts +14 -0
  62. package/template/webcomponents/package.json +20 -0
  63. package/template/webcomponents/src/main.ts +16 -0
  64. package/template/webcomponents/src/style.css +21 -0
@@ -0,0 +1,64 @@
1
+ import { LitElement, html } from "lit";
2
+ import { customElement, state } from "lit/decorators.js";
3
+ import { initParticlesEngine } from "@tsparticles/lit";
4
+ import { loadParticles } from "@tsparticles/particles";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
+
7
+ const options: ISourceOptions = {
8
+ background: { color: { value: "#0d0d2b" } },
9
+ fpsLimit: 120,
10
+ particles: {
11
+ number: { value: 80, density: { enable: true } },
12
+ color: { value: "#ffffff" },
13
+ shape: { type: "circle" },
14
+ opacity: { value: 0.5 },
15
+ size: { value: { min: 1, max: 5 } },
16
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
17
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
18
+ },
19
+ interactivity: {
20
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
21
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
22
+ },
23
+ detectRetina: true,
24
+ };
25
+
26
+ @customElement("my-app")
27
+ export class MyApp extends LitElement {
28
+ @state()
29
+ private initialized = false;
30
+
31
+ connectedCallback(): void {
32
+ super.connectedCallback();
33
+ void initParticlesEngine(async (engine) => {
34
+ await loadParticles(engine);
35
+ this.initialized = true;
36
+ });
37
+ }
38
+
39
+ render() {
40
+ return html`
41
+ <style>
42
+ #app {
43
+ position: absolute;
44
+ top: 50%;
45
+ left: 50%;
46
+ transform: translate(-50%, -50%);
47
+ z-index: 10;
48
+ text-align: center;
49
+ color: #fff;
50
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
51
+ pointer-events: none;
52
+ }
53
+ h1 {
54
+ font-size: 3.2em;
55
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
56
+ }
57
+ </style>
58
+ <div id="app">
59
+ <h1>tsParticles</h1>
60
+ </div>
61
+ ${this.initialized ? html`<lit-particles id="tsparticles" .options=${options}></lit-particles>` : ""}
62
+ `;
63
+ }
64
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "next dev",
8
+ "build": "next build",
9
+ "start": "next start",
10
+ "preview": "next start"
11
+ },
12
+ "dependencies": {
13
+ "next": "^15.3.1",
14
+ "react": "^19.2.5",
15
+ "react-dom": "^19.2.5",
16
+ "@tsparticles/engine": "^4.0.0",
17
+ "@tsparticles/particles": "^4.0.0",
18
+ "@tsparticles/configs": "^4.0.0",
19
+ "@tsparticles/nextjs": "^4.1.3"
20
+ },
21
+ "devDependencies": {
22
+ "typescript": "~5.8.3"
23
+ }
24
+ }
@@ -0,0 +1,39 @@
1
+ "use client";
2
+
3
+ import Particles from "@tsparticles/nextjs";
4
+ import { loadParticles } from "@tsparticles/particles";
5
+ import type { Engine, ISourceOptions } from "@tsparticles/engine";
6
+
7
+ async function init(engine: Engine): Promise<void> {
8
+ await loadParticles(engine);
9
+ }
10
+
11
+ const options: ISourceOptions = {
12
+ background: { color: { value: "#0d0d2b" } },
13
+ fpsLimit: 120,
14
+ particles: {
15
+ number: { value: 80, density: { enable: true } },
16
+ color: { value: "#ffffff" },
17
+ shape: { type: "circle" },
18
+ opacity: { value: 0.5 },
19
+ size: { value: { min: 1, max: 5 } },
20
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
21
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
22
+ },
23
+ interactivity: {
24
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
25
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
26
+ },
27
+ detectRetina: true,
28
+ };
29
+
30
+ export default function Home() {
31
+ return (
32
+ <>
33
+ <div id="app">
34
+ <h1>tsParticles</h1>
35
+ </div>
36
+ <Particles id="tsparticles" init={init} options={options} />
37
+ </>
38
+ );
39
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "nuxt",
7
+ "build": "nuxt build",
8
+ "start": "nuxt start",
9
+ "preview": "nuxt start"
10
+ },
11
+ "dependencies": {
12
+ "nuxt": "^2.18.1",
13
+ "vue": "^2.7.16",
14
+ "vue-template-compiler": "^2.7.16",
15
+ "@tsparticles/engine": "^4.0.0",
16
+ "@tsparticles/particles": "^4.0.0",
17
+ "@tsparticles/configs": "^4.0.0",
18
+ "@tsparticles/vue2": "^4.1.3"
19
+ }
20
+ }
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div id="app">
3
+ <h1>tsParticles</h1>
4
+ </div>
5
+ <vue-particles id="tsparticles" :options="options" />
6
+ </template>
7
+
8
+ <script>
9
+ import { loadParticles } from "@tsparticles/particles";
10
+ import { tsParticles } from "@tsparticles/engine";
11
+
12
+ export default {
13
+ name: "HomePage",
14
+ data() {
15
+ return {
16
+ options: {
17
+ background: { color: { value: "#0d0d2b" } },
18
+ fpsLimit: 120,
19
+ particles: {
20
+ number: { value: 80, density: { enable: true } },
21
+ color: { value: "#ffffff" },
22
+ shape: { type: "circle" },
23
+ opacity: { value: 0.5 },
24
+ size: { value: { min: 1, max: 5 } },
25
+ links: {
26
+ enable: true,
27
+ distance: 150,
28
+ color: "#ffffff",
29
+ opacity: 0.3,
30
+ width: 1,
31
+ },
32
+ move: {
33
+ enable: true,
34
+ speed: 2,
35
+ direction: "none",
36
+ random: false,
37
+ straight: false,
38
+ outModes: { default: "bounce" },
39
+ },
40
+ },
41
+ interactivity: {
42
+ events: {
43
+ onHover: { enable: true, mode: "repulse" },
44
+ onClick: { enable: true, mode: "push" },
45
+ },
46
+ modes: {
47
+ repulse: { distance: 100, duration: 0.4 },
48
+ push: { quantity: 4 },
49
+ },
50
+ },
51
+ detectRetina: true,
52
+ },
53
+ };
54
+ },
55
+ mounted() {
56
+ void loadParticles(tsParticles);
57
+ },
58
+ };
59
+ </script>
60
+
61
+ <style>
62
+ body {
63
+ margin: 0;
64
+ overflow: hidden;
65
+ }
66
+
67
+ #app {
68
+ position: absolute;
69
+ top: 50%;
70
+ left: 50%;
71
+ transform: translate(-50%, -50%);
72
+ z-index: 10;
73
+ text-align: center;
74
+ color: #fff;
75
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
76
+ pointer-events: none;
77
+ }
78
+
79
+ h1 {
80
+ font-size: 3.2em;
81
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
82
+ }
83
+ </style>
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ import { onMounted } from "vue";
3
+ import { loadParticles } from "@tsparticles/particles";
4
+ import { tsParticles } from "@tsparticles/engine";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
+
7
+ const options: ISourceOptions = {
8
+ background: { color: { value: "#0d0d2b" } },
9
+ fpsLimit: 120,
10
+ particles: {
11
+ number: { value: 80, density: { enable: true } },
12
+ color: { value: "#ffffff" },
13
+ shape: { type: "circle" },
14
+ opacity: { value: 0.5 },
15
+ size: { value: { min: 1, max: 5 } },
16
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
17
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
18
+ },
19
+ interactivity: {
20
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
21
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
22
+ },
23
+ detectRetina: true,
24
+ };
25
+
26
+ onMounted(() => {
27
+ void loadParticles(tsParticles);
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <div>
33
+ <div id="app">
34
+ <h1>tsParticles</h1>
35
+ </div>
36
+ <vue-particles id="tsparticles" :options="options" />
37
+ </div>
38
+ </template>
39
+
40
+ <style>
41
+ body {
42
+ margin: 0;
43
+ overflow: hidden;
44
+ }
45
+
46
+ #app {
47
+ position: absolute;
48
+ top: 50%;
49
+ left: 50%;
50
+ transform: translate(-50%, -50%);
51
+ z-index: 10;
52
+ text-align: center;
53
+ color: #fff;
54
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
55
+ pointer-events: none;
56
+ }
57
+
58
+ h1 {
59
+ font-size: 3.2em;
60
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
61
+ }
62
+ </style>
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "nuxt dev",
7
+ "build": "nuxt build",
8
+ "preview": "nuxt preview"
9
+ },
10
+ "dependencies": {
11
+ "nuxt": "^3.17.1",
12
+ "vue": "^3.5.32",
13
+ "@tsparticles/engine": "^4.0.0",
14
+ "@tsparticles/particles": "^4.0.0",
15
+ "@tsparticles/configs": "^4.0.0",
16
+ "@tsparticles/vue3": "^4.1.3"
17
+ }
18
+ }
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ import { onMounted } from "vue";
3
+ import { loadParticles } from "@tsparticles/particles";
4
+ import { tsParticles } from "@tsparticles/engine";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
+
7
+ const options: ISourceOptions = {
8
+ background: { color: { value: "#0d0d2b" } },
9
+ fpsLimit: 120,
10
+ particles: {
11
+ number: { value: 80, density: { enable: true } },
12
+ color: { value: "#ffffff" },
13
+ shape: { type: "circle" },
14
+ opacity: { value: 0.5 },
15
+ size: { value: { min: 1, max: 5 } },
16
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
17
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
18
+ },
19
+ interactivity: {
20
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
21
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
22
+ },
23
+ detectRetina: true,
24
+ };
25
+
26
+ onMounted(() => {
27
+ void loadParticles(tsParticles);
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <div>
33
+ <div id="app">
34
+ <h1>tsParticles</h1>
35
+ </div>
36
+ <vue-particles id="tsparticles" :options="options" />
37
+ </div>
38
+ </template>
39
+
40
+ <style>
41
+ body {
42
+ margin: 0;
43
+ overflow: hidden;
44
+ }
45
+
46
+ #app {
47
+ position: absolute;
48
+ top: 50%;
49
+ left: 50%;
50
+ transform: translate(-50%, -50%);
51
+ z-index: 10;
52
+ text-align: center;
53
+ color: #fff;
54
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
55
+ pointer-events: none;
56
+ }
57
+
58
+ h1 {
59
+ font-size: 3.2em;
60
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
61
+ }
62
+ </style>
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "nuxt dev",
7
+ "build": "nuxt build",
8
+ "preview": "nuxt preview"
9
+ },
10
+ "dependencies": {
11
+ "nuxt": "^4.0.0",
12
+ "vue": "^4.0.0",
13
+ "@tsparticles/engine": "^4.0.0",
14
+ "@tsparticles/particles": "^4.0.0",
15
+ "@tsparticles/configs": "^4.0.0",
16
+ "@tsparticles/vue3": "^4.1.3"
17
+ }
18
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "preact": "^10.26.5",
13
+ "@tsparticles/engine": "^4.0.0",
14
+ "@tsparticles/particles": "^4.0.0",
15
+ "@tsparticles/configs": "^4.0.0",
16
+ "@tsparticles/preact": "^4.1.3"
17
+ },
18
+ "devDependencies": {
19
+ "@preact/preset-vite": "^2.10.1",
20
+ "typescript": "~5.8.3"
21
+ }
22
+ }
@@ -0,0 +1,21 @@
1
+ body {
2
+ margin: 0;
3
+ overflow: hidden;
4
+ }
5
+
6
+ #app {
7
+ position: absolute;
8
+ top: 50%;
9
+ left: 50%;
10
+ transform: translate(-50%, -50%);
11
+ z-index: 10;
12
+ text-align: center;
13
+ color: #fff;
14
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
15
+ pointer-events: none;
16
+ }
17
+
18
+ h1 {
19
+ font-size: 3.2em;
20
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
21
+ }
@@ -0,0 +1,40 @@
1
+ import { useEffect } from "preact/hooks";
2
+ import Particles from "@tsparticles/preact";
3
+ import { loadParticles } from "@tsparticles/particles";
4
+ import { tsParticles } from "@tsparticles/engine";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
+ import "./App.css";
7
+
8
+ const options: ISourceOptions = {
9
+ background: { color: { value: "#0d0d2b" } },
10
+ fpsLimit: 120,
11
+ particles: {
12
+ number: { value: 80, density: { enable: true } },
13
+ color: { value: "#ffffff" },
14
+ shape: { type: "circle" },
15
+ opacity: { value: 0.5 },
16
+ size: { value: { min: 1, max: 5 } },
17
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
18
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
19
+ },
20
+ interactivity: {
21
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
22
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
23
+ },
24
+ detectRetina: true,
25
+ };
26
+
27
+ export default function App() {
28
+ useEffect(() => {
29
+ void loadParticles(tsParticles);
30
+ }, []);
31
+
32
+ return (
33
+ <>
34
+ <div id="app">
35
+ <h1>tsParticles</h1>
36
+ </div>
37
+ <Particles id="tsparticles" options={options} />
38
+ </>
39
+ );
40
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "@builder.io/qwik": "^1.12.1",
13
+ "@tsparticles/engine": "^4.0.0",
14
+ "@tsparticles/particles": "^4.0.0",
15
+ "@tsparticles/configs": "^4.0.0",
16
+ "@tsparticles/qwik": "^4.1.3"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "~5.8.3"
20
+ }
21
+ }
@@ -0,0 +1,50 @@
1
+ import { component$, useVisibleTask$ } from "@builder.io/qwik";
2
+ import { Particles } from "@tsparticles/qwik";
3
+ import { loadParticles } from "@tsparticles/particles";
4
+ import { tsParticles } from "@tsparticles/engine";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
+
7
+ const options: ISourceOptions = {
8
+ background: { color: { value: "#0d0d2b" } },
9
+ fpsLimit: 120,
10
+ particles: {
11
+ number: { value: 80, density: { enable: true } },
12
+ color: { value: "#ffffff" },
13
+ shape: { type: "circle" },
14
+ opacity: { value: 0.5 },
15
+ size: { value: { min: 1, max: 5 } },
16
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
17
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
18
+ },
19
+ interactivity: {
20
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
21
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
22
+ },
23
+ detectRetina: true,
24
+ };
25
+
26
+ export default component$(() => {
27
+ useVisibleTask$(() => {
28
+ void loadParticles(tsParticles);
29
+ });
30
+
31
+ return (
32
+ <>
33
+ <style>{`
34
+ body { margin: 0; overflow: hidden; }
35
+ #app {
36
+ position: absolute; top: 50%; left: 50%;
37
+ transform: translate(-50%, -50%); z-index: 10;
38
+ text-align: center; color: #fff;
39
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
40
+ pointer-events: none;
41
+ }
42
+ h1 { font-size: 3.2em; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
43
+ `}</style>
44
+ <div id="app">
45
+ <h1>tsParticles</h1>
46
+ </div>
47
+ <Particles id="tsparticles" options={options} />
48
+ </>
49
+ );
50
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "react": "^19.2.5",
13
+ "react-dom": "^19.2.5",
14
+ "@tsparticles/react": "^4.1.3"
15
+ },
16
+ "devDependencies": {
17
+ "@vitejs/plugin-react": "^6.0.1"
18
+ }
19
+ }
@@ -0,0 +1,21 @@
1
+ body {
2
+ margin: 0;
3
+ overflow: hidden;
4
+ }
5
+
6
+ #app {
7
+ position: absolute;
8
+ top: 50%;
9
+ left: 50%;
10
+ transform: translate(-50%, -50%);
11
+ z-index: 10;
12
+ text-align: center;
13
+ color: #fff;
14
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
15
+ pointer-events: none;
16
+ }
17
+
18
+ h1 {
19
+ font-size: 3.2em;
20
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
21
+ }
@@ -0,0 +1,38 @@
1
+ import Particles, { ParticlesProvider } from "@tsparticles/react";
2
+ import { loadParticles } from "@tsparticles/particles";
3
+ import type { Engine, ISourceOptions } from "@tsparticles/engine";
4
+ import "./App.css";
5
+
6
+ async function init(engine: Engine): Promise<void> {
7
+ await loadParticles(engine);
8
+ }
9
+
10
+ const options: ISourceOptions = {
11
+ background: { color: { value: "#0d0d2b" } },
12
+ fpsLimit: 120,
13
+ particles: {
14
+ number: { value: 80, density: { enable: true } },
15
+ color: { value: "#ffffff" },
16
+ shape: { type: "circle" },
17
+ opacity: { value: 0.5 },
18
+ size: { value: { min: 1, max: 5 } },
19
+ links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
20
+ move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
21
+ },
22
+ interactivity: {
23
+ events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
24
+ modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
25
+ },
26
+ detectRetina: true,
27
+ };
28
+
29
+ export default function App() {
30
+ return (
31
+ <ParticlesProvider init={init}>
32
+ <div id="app">
33
+ <h1>tsParticles</h1>
34
+ </div>
35
+ <Particles id="tsparticles" options={options} />
36
+ </ParticlesProvider>
37
+ );
38
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "riot": "^9.5.2",
13
+ "@tsparticles/engine": "^4.0.0",
14
+ "@tsparticles/particles": "^4.0.0",
15
+ "@tsparticles/configs": "^4.0.0",
16
+ "@tsparticles/riot": "^4.1.3"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "~5.8.3"
20
+ }
21
+ }