@tsparticles/template-particles 4.1.3 → 4.2.0
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.
- package/CHANGELOG.md +10 -0
- package/README.md +3 -0
- package/package.json +4 -3
- package/template/angular/package.json +34 -0
- package/template/angular/src/app/app.component.css +16 -0
- package/template/angular/src/app/app.component.html +4 -0
- package/template/angular/src/app/app.component.ts +38 -0
- package/template/angular-confetti/package.json +36 -0
- package/template/angular-confetti/src/app/app.component.css +16 -0
- package/template/angular-confetti/src/app/app.component.html +4 -0
- package/template/angular-confetti/src/app/app.component.ts +38 -0
- package/template/angular-fireworks/package.json +36 -0
- package/template/angular-fireworks/src/app/app.component.css +16 -0
- package/template/angular-fireworks/src/app/app.component.html +4 -0
- package/template/angular-fireworks/src/app/app.component.ts +38 -0
- package/template/astro/package.json +18 -0
- package/template/astro/src/pages/index.astro +53 -0
- package/template/ember/app/templates/application.hbs +4 -0
- package/template/ember/package.json +20 -0
- package/template/inferno/package.json +21 -0
- package/template/inferno/src/App.css +21 -0
- package/template/inferno/src/App.tsx +42 -0
- package/template/jquery/package.json +21 -0
- package/template/jquery/src/main.ts +49 -0
- package/template/jquery/src/style.css +21 -0
- package/template/lit/package.json +21 -0
- package/template/lit/src/my-app.ts +64 -0
- package/template/nextjs/package.json +24 -0
- package/template/nextjs/src/app/page.tsx +39 -0
- package/template/nuxt2/package.json +20 -0
- package/template/nuxt2/pages/index.vue +83 -0
- package/template/nuxt3/app.vue +62 -0
- package/template/nuxt3/package.json +18 -0
- package/template/nuxt4/app.vue +62 -0
- package/template/nuxt4/package.json +18 -0
- package/template/preact/package.json +22 -0
- package/template/preact/src/App.css +21 -0
- package/template/preact/src/App.tsx +40 -0
- package/template/qwik/package.json +21 -0
- package/template/qwik/src/App.tsx +50 -0
- package/template/react/package.json +19 -0
- package/template/react/src/App.css +21 -0
- package/template/react/src/App.tsx +38 -0
- package/template/riot/package.json +21 -0
- package/template/riot/src/app.riot +31 -0
- package/template/solid/package.json +18 -0
- package/template/solid/src/App.tsx +59 -0
- package/template/solid/src/index.css +21 -0
- package/template/solid/src/main.tsx +9 -0
- package/template/stencil/package.json +21 -0
- package/template/stencil/src/components/app-home/app-home.tsx +64 -0
- package/template/svelte/package.json +20 -0
- package/template/svelte/src/App.svelte +70 -0
- package/template/svelte/src/main.ts +12 -0
- package/template/vanilla/LICENSE +21 -0
- package/template/vue2/package.json +23 -0
- package/template/vue2/src/App.vue +83 -0
- package/template/vue3/package.json +19 -0
- package/template/vue3/src/App.vue +53 -0
- package/template/vue3/src/main.ts +14 -0
- package/template/webcomponents/package.json +20 -0
- package/template/webcomponents/src/main.ts +16 -0
- package/template/webcomponents/src/style.css +21 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<app>
|
|
2
|
+
<div id="app">
|
|
3
|
+
<h1>tsParticles</h1>
|
|
4
|
+
</div>
|
|
5
|
+
<riot-particles id="tsparticles"></riot-particles>
|
|
6
|
+
|
|
7
|
+
<style>
|
|
8
|
+
body { margin: 0; overflow: hidden; }
|
|
9
|
+
#app {
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 50%;
|
|
12
|
+
left: 50%;
|
|
13
|
+
transform: translate(-50%, -50%);
|
|
14
|
+
z-index: 10;
|
|
15
|
+
text-align: center;
|
|
16
|
+
color: #fff;
|
|
17
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
h1 { font-size: 3.2em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
|
|
21
|
+
</style>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
25
|
+
import { tsParticles } from "@tsparticles/engine";
|
|
26
|
+
|
|
27
|
+
this.on("mount", () => {
|
|
28
|
+
loadParticles(tsParticles);
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
</app>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
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
|
+
"solid-js": "^1.8.11",
|
|
13
|
+
"@tsparticles/solid": "^4.1.3"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"vite-plugin-solid": "^2.8.2"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { onMount } from "solid-js";
|
|
2
|
+
import Particles, { initParticlesEngine } from "@tsparticles/solid";
|
|
3
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
4
|
+
import type { ISourceOptions } from "@tsparticles/engine";
|
|
5
|
+
|
|
6
|
+
export default function App() {
|
|
7
|
+
onMount(() => {
|
|
8
|
+
void initParticlesEngine(async (engine) => {
|
|
9
|
+
await loadParticles(engine);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const options: ISourceOptions = {
|
|
14
|
+
background: { color: { value: "#0d0d2b" } },
|
|
15
|
+
fpsLimit: 120,
|
|
16
|
+
particles: {
|
|
17
|
+
number: { value: 80, density: { enable: true } },
|
|
18
|
+
color: { value: "#ffffff" },
|
|
19
|
+
shape: { type: "circle" },
|
|
20
|
+
opacity: { value: 0.5 },
|
|
21
|
+
size: { value: { min: 1, max: 5 } },
|
|
22
|
+
links: {
|
|
23
|
+
enable: true,
|
|
24
|
+
distance: 150,
|
|
25
|
+
color: "#ffffff",
|
|
26
|
+
opacity: 0.3,
|
|
27
|
+
width: 1,
|
|
28
|
+
},
|
|
29
|
+
move: {
|
|
30
|
+
enable: true,
|
|
31
|
+
speed: 2,
|
|
32
|
+
direction: "none",
|
|
33
|
+
random: false,
|
|
34
|
+
straight: false,
|
|
35
|
+
outModes: { default: "bounce" },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
interactivity: {
|
|
39
|
+
events: {
|
|
40
|
+
onHover: { enable: true, mode: "repulse" },
|
|
41
|
+
onClick: { enable: true, mode: "push" },
|
|
42
|
+
},
|
|
43
|
+
modes: {
|
|
44
|
+
repulse: { distance: 100, duration: 0.4 },
|
|
45
|
+
push: { quantity: 4 },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
detectRetina: true,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<>
|
|
53
|
+
<div id="app-content">
|
|
54
|
+
<h1>tsParticles</h1>
|
|
55
|
+
</div>
|
|
56
|
+
<Particles id="tsparticles" options={options} />
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
#app-content {
|
|
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,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "stencil build --dev --watch",
|
|
8
|
+
"build": "stencil build",
|
|
9
|
+
"preview": "stencil build --preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@stencil/core": "^4.26.0",
|
|
13
|
+
"@tsparticles/engine": "^4.0.0",
|
|
14
|
+
"@tsparticles/particles": "^4.0.0",
|
|
15
|
+
"@tsparticles/configs": "^4.0.0",
|
|
16
|
+
"@tsparticles/stencil": "^4.1.3"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "~5.8.3"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component, h } from "@stencil/core";
|
|
2
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
3
|
+
import { tsParticles } from "@tsparticles/engine";
|
|
4
|
+
import type { ISourceOptions } from "@tsparticles/engine";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
tag: "app-home",
|
|
8
|
+
styleUrl: "app-home.css",
|
|
9
|
+
shadow: true,
|
|
10
|
+
})
|
|
11
|
+
export class AppHome {
|
|
12
|
+
private options: ISourceOptions = {
|
|
13
|
+
background: { color: { value: "#0d0d2b" } },
|
|
14
|
+
fpsLimit: 120,
|
|
15
|
+
particles: {
|
|
16
|
+
number: { value: 80, density: { enable: true } },
|
|
17
|
+
color: { value: "#ffffff" },
|
|
18
|
+
shape: { type: "circle" },
|
|
19
|
+
opacity: { value: 0.5 },
|
|
20
|
+
size: { value: { min: 1, max: 5 } },
|
|
21
|
+
links: {
|
|
22
|
+
enable: true,
|
|
23
|
+
distance: 150,
|
|
24
|
+
color: "#ffffff",
|
|
25
|
+
opacity: 0.3,
|
|
26
|
+
width: 1,
|
|
27
|
+
},
|
|
28
|
+
move: {
|
|
29
|
+
enable: true,
|
|
30
|
+
speed: 2,
|
|
31
|
+
direction: "none",
|
|
32
|
+
random: false,
|
|
33
|
+
straight: false,
|
|
34
|
+
outModes: { default: "bounce" },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
interactivity: {
|
|
38
|
+
events: {
|
|
39
|
+
onHover: { enable: true, mode: "repulse" },
|
|
40
|
+
onClick: { enable: true, mode: "push" },
|
|
41
|
+
},
|
|
42
|
+
modes: {
|
|
43
|
+
repulse: { distance: 100, duration: 0.4 },
|
|
44
|
+
push: { quantity: 4 },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
detectRetina: true,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
void loadParticles(tsParticles);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
render() {
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
<div id="app">
|
|
58
|
+
<h1>tsParticles</h1>
|
|
59
|
+
</div>
|
|
60
|
+
<stencil-particles id="tsparticles" options={this.options}></stencil-particles>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@tsparticles/svelte": "^4.1.3"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
16
|
+
"svelte": "^5.55.7",
|
|
17
|
+
"svelte-check": "^3.7.1",
|
|
18
|
+
"tslib": "^2.8.1"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Particles from "@tsparticles/svelte";
|
|
3
|
+
import type { ISourceOptions } from "@tsparticles/engine";
|
|
4
|
+
|
|
5
|
+
const options: ISourceOptions = {
|
|
6
|
+
background: { color: { value: "#0d0d2b" } },
|
|
7
|
+
fpsLimit: 120,
|
|
8
|
+
particles: {
|
|
9
|
+
number: { value: 80, density: { enable: true } },
|
|
10
|
+
color: { value: "#ffffff" },
|
|
11
|
+
shape: { type: "circle" },
|
|
12
|
+
opacity: { value: 0.5 },
|
|
13
|
+
size: { value: { min: 1, max: 5 } },
|
|
14
|
+
links: {
|
|
15
|
+
enable: true,
|
|
16
|
+
distance: 150,
|
|
17
|
+
color: "#ffffff",
|
|
18
|
+
opacity: 0.3,
|
|
19
|
+
width: 1,
|
|
20
|
+
},
|
|
21
|
+
move: {
|
|
22
|
+
enable: true,
|
|
23
|
+
speed: 2,
|
|
24
|
+
direction: "none",
|
|
25
|
+
random: false,
|
|
26
|
+
straight: false,
|
|
27
|
+
outModes: { default: "bounce" },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
interactivity: {
|
|
31
|
+
events: {
|
|
32
|
+
onHover: { enable: true, mode: "repulse" },
|
|
33
|
+
onClick: { enable: true, mode: "push" },
|
|
34
|
+
},
|
|
35
|
+
modes: {
|
|
36
|
+
repulse: { distance: 100, duration: 0.4 },
|
|
37
|
+
push: { quantity: 4 },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
detectRetina: true,
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<h1>tsParticles</h1>
|
|
45
|
+
|
|
46
|
+
<Particles id="tsparticles" options={options} />
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
:global(body) {
|
|
50
|
+
margin: 0;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:global(#app) {
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 50%;
|
|
57
|
+
left: 50%;
|
|
58
|
+
transform: translate(-50%, -50%);
|
|
59
|
+
z-index: 10;
|
|
60
|
+
text-align: center;
|
|
61
|
+
color: #fff;
|
|
62
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
h1 {
|
|
67
|
+
font-size: 3.2em;
|
|
68
|
+
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { mount } from "svelte";
|
|
2
|
+
import { initParticlesEngine } from "@tsparticles/svelte";
|
|
3
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
4
|
+
import App from "./App.svelte";
|
|
5
|
+
|
|
6
|
+
void initParticlesEngine(async (engine) => {
|
|
7
|
+
await loadParticles(engine);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const app = mount(App, { target: document.getElementById("app")! });
|
|
11
|
+
|
|
12
|
+
export default app;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Matteo Bruni
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vue-tsc --noEmit && vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"vue": "^2.7.16",
|
|
13
|
+
"@tsparticles/engine": "^4.0.0",
|
|
14
|
+
"@tsparticles/particles": "^4.0.0",
|
|
15
|
+
"@tsparticles/configs": "^4.0.0",
|
|
16
|
+
"@tsparticles/vue2": "^4.1.3"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@vitejs/plugin-vue2": "^2.3.3",
|
|
20
|
+
"vue-tsc": "^2.2.8",
|
|
21
|
+
"typescript": "~5.8.3"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -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: "App",
|
|
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,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vue-tsc --noEmit && vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"vue": "^3.5.32",
|
|
13
|
+
"@tsparticles/vue3": "^4.1.3"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
17
|
+
"vue-tsc": "^3.2.6"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ISourceOptions } from "@tsparticles/engine";
|
|
3
|
+
|
|
4
|
+
const options: ISourceOptions = {
|
|
5
|
+
background: { color: { value: "#0d0d2b" } },
|
|
6
|
+
fpsLimit: 120,
|
|
7
|
+
particles: {
|
|
8
|
+
number: { value: 80, density: { enable: true } },
|
|
9
|
+
color: { value: "#ffffff" },
|
|
10
|
+
shape: { type: "circle" },
|
|
11
|
+
opacity: { value: 0.5 },
|
|
12
|
+
size: { value: { min: 1, max: 5 } },
|
|
13
|
+
links: { enable: true, distance: 150, color: "#ffffff", opacity: 0.3, width: 1 },
|
|
14
|
+
move: { enable: true, speed: 2, direction: "none", random: false, straight: false, outModes: { default: "bounce" } },
|
|
15
|
+
},
|
|
16
|
+
interactivity: {
|
|
17
|
+
events: { onHover: { enable: true, mode: "repulse" }, onClick: { enable: true, mode: "push" } },
|
|
18
|
+
modes: { repulse: { distance: 100, duration: 0.4 }, push: { quantity: 4 } },
|
|
19
|
+
},
|
|
20
|
+
detectRetina: true,
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div id="app">
|
|
26
|
+
<h1>tsParticles</h1>
|
|
27
|
+
</div>
|
|
28
|
+
<vue-particles id="tsparticles" :options="options" />
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
body {
|
|
33
|
+
margin: 0;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#app {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
left: 50%;
|
|
41
|
+
transform: translate(-50%, -50%);
|
|
42
|
+
z-index: 10;
|
|
43
|
+
text-align: center;
|
|
44
|
+
color: #fff;
|
|
45
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
h1 {
|
|
50
|
+
font-size: 3.2em;
|
|
51
|
+
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createApp } from "vue";
|
|
2
|
+
import Particles from "@tsparticles/vue3";
|
|
3
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
4
|
+
import App from "./App.vue";
|
|
5
|
+
|
|
6
|
+
const app = createApp(App);
|
|
7
|
+
|
|
8
|
+
app.use(Particles, {
|
|
9
|
+
init: async (engine) => {
|
|
10
|
+
await loadParticles(engine);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
app.mount("#app");
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
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
|
+
"@tsparticles/engine": "^4.0.0",
|
|
13
|
+
"@tsparticles/particles": "^4.0.0",
|
|
14
|
+
"@tsparticles/configs": "^4.0.0",
|
|
15
|
+
"@tsparticles/webcomponents": "^4.1.3"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "~5.8.3"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { loadParticles } from "@tsparticles/particles";
|
|
3
|
+
import { tsParticles } from "@tsparticles/engine";
|
|
4
|
+
|
|
5
|
+
(async () => {
|
|
6
|
+
await loadParticles(tsParticles);
|
|
7
|
+
|
|
8
|
+
const app = document.createElement("div");
|
|
9
|
+
app.id = "app";
|
|
10
|
+
app.innerHTML = "<h1>tsParticles</h1>";
|
|
11
|
+
document.body.appendChild(app);
|
|
12
|
+
|
|
13
|
+
const particles = document.createElement("web-particles");
|
|
14
|
+
particles.id = "tsparticles";
|
|
15
|
+
document.body.appendChild(particles);
|
|
16
|
+
})();
|
|
@@ -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
|
+
}
|