@tsparticles/template-scaffold 4.1.3

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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +14 -0
  3. package/scripts/prebuild.js +65 -0
  4. package/template/angular/.browserslistrc +5 -0
  5. package/template/angular/.editorconfig +9 -0
  6. package/template/angular/README.md +10 -0
  7. package/template/angular/angular.json +53 -0
  8. package/template/angular/gitignore +17 -0
  9. package/template/angular/package.json +33 -0
  10. package/template/angular/src/app/app.component.css +15 -0
  11. package/template/angular/src/app/app.component.html +4 -0
  12. package/template/angular/src/app/app.component.ts +41 -0
  13. package/template/angular/src/app/app.module.ts +12 -0
  14. package/template/angular/src/index.html +12 -0
  15. package/template/angular/src/main.ts +6 -0
  16. package/template/angular/src/polyfills.ts +1 -0
  17. package/template/angular/src/styles.css +5 -0
  18. package/template/angular/tsconfig.app.json +9 -0
  19. package/template/angular/tsconfig.json +29 -0
  20. package/template/angular/tsconfig.spec.json +8 -0
  21. package/template/react/README.md +10 -0
  22. package/template/react/gitignore +14 -0
  23. package/template/react/index.html +12 -0
  24. package/template/react/package.json +19 -0
  25. package/template/react/src/App.css +21 -0
  26. package/template/react/src/App.tsx +41 -0
  27. package/template/react/src/main.tsx +10 -0
  28. package/template/react/src/vite-env.d.ts +1 -0
  29. package/template/react/tsconfig.json +20 -0
  30. package/template/react/vite.config.ts +7 -0
  31. package/template/solid/README.md +10 -0
  32. package/template/solid/gitignore +14 -0
  33. package/template/solid/index.html +12 -0
  34. package/template/solid/package.json +18 -0
  35. package/template/solid/src/App.tsx +43 -0
  36. package/template/solid/src/index.css +21 -0
  37. package/template/solid/src/main.tsx +9 -0
  38. package/template/solid/tsconfig.json +20 -0
  39. package/template/solid/vite.config.ts +7 -0
  40. package/template/svelte/README.md +10 -0
  41. package/template/svelte/gitignore +14 -0
  42. package/template/svelte/index.html +12 -0
  43. package/template/svelte/package.json +20 -0
  44. package/template/svelte/src/App.svelte +55 -0
  45. package/template/svelte/src/main.ts +12 -0
  46. package/template/svelte/tsconfig.json +18 -0
  47. package/template/svelte/vite.config.ts +7 -0
  48. package/template/vanilla/README.md +10 -0
  49. package/template/vanilla/gitignore +14 -0
  50. package/template/vanilla/index.html +14 -0
  51. package/template/vanilla/package.json +11 -0
  52. package/template/vanilla/src/main.ts +14 -0
  53. package/template/vanilla/src/style.css +22 -0
  54. package/template/vanilla/tsconfig.json +19 -0
  55. package/template/vanilla/vite.config.ts +5 -0
  56. package/template/vue3/README.md +10 -0
  57. package/template/vue3/gitignore +14 -0
  58. package/template/vue3/index.html +12 -0
  59. package/template/vue3/package.json +19 -0
  60. package/template/vue3/src/App.vue +56 -0
  61. package/template/vue3/src/env.d.ts +7 -0
  62. package/template/vue3/src/main.ts +14 -0
  63. package/template/vue3/tsconfig.json +19 -0
  64. package/template/vue3/vite.config.ts +7 -0
  65. package/template.json +13 -0
package/LICENSE ADDED
@@ -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.
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@tsparticles/template-scaffold",
3
+ "version": "4.1.3",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "scripts": {
9
+ "prebuild": "node scripts/prebuild.js",
10
+ "build": "pnpm run prebuild",
11
+ "build:ci": "pnpm run prebuild"
12
+ },
13
+ "gitHead": "0551736c55ae8eec3855a693af8a99b1b4420350"
14
+ }
@@ -0,0 +1,65 @@
1
+ const fs = require("fs-extra");
2
+
3
+ const libPackage = "./template.json";
4
+
5
+ const workspaceVersions = {
6
+ "@tsparticles/engine": require("../../../engine/package.json").version,
7
+ "@tsparticles/slim": require("../../../bundles/slim/package.json").version,
8
+ "@tsparticles/configs": require("../../../utils/configs/package.json").version,
9
+ };
10
+
11
+ function resolveWorkspaceDependency(name) {
12
+ const libObj = JSON.parse(fs.readFileSync(libPackage, "utf-8"));
13
+
14
+ const allDeps = {
15
+ ...libObj.package.dependencies,
16
+ ...libObj.package.devDependencies,
17
+ };
18
+
19
+ const spec = allDeps[name];
20
+
21
+ if (!spec?.startsWith("workspace:")) {
22
+ return spec;
23
+ }
24
+
25
+ const workspaceRange = spec.replace("workspace:", "");
26
+
27
+ if (workspaceRange.length > 0 && workspaceRange !== "*" && workspaceRange !== "^" && workspaceRange !== "~") {
28
+ return workspaceRange;
29
+ }
30
+
31
+ const version = workspaceVersions[name];
32
+
33
+ if (!version) {
34
+ throw new Error(`Cannot resolve workspace dependency version for ${name}`);
35
+ }
36
+
37
+ return workspaceRange === "^" || workspaceRange === "~" ? `${workspaceRange}${version}` : `^${version}`;
38
+ }
39
+
40
+ fs.readFile(libPackage, function (error, data) {
41
+ if (error) {
42
+ throw error;
43
+ }
44
+
45
+ const text = data.toString();
46
+ const libObj = JSON.parse(text);
47
+
48
+ for (const dep of Object.keys(libObj.package.dependencies)) {
49
+ const resolved = resolveWorkspaceDependency(dep);
50
+ if (resolved) {
51
+ libObj.package.dependencies[dep] = resolved;
52
+ }
53
+ }
54
+
55
+ for (const dep of Object.keys(libObj.package.devDependencies)) {
56
+ const resolved = resolveWorkspaceDependency(dep);
57
+ if (resolved) {
58
+ libObj.package.devDependencies[dep] = resolved;
59
+ }
60
+ }
61
+
62
+ fs.writeFile(libPackage, JSON.stringify(libObj, undefined, 2), "utf-8", function () {
63
+ console.log("template.json dependencies updated successfully");
64
+ });
65
+ });
@@ -0,0 +1,5 @@
1
+ last 1 Chrome version
2
+ last 1 Firefox version
3
+ last 2 Edge major versions
4
+ last 2 Safari major versions
5
+ last 2 iOS major versions
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles Angular project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "{{projectName}}": {
7
+ "projectType": "application",
8
+ "root": "",
9
+ "sourceRoot": "src",
10
+ "prefix": "app",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular/build:application",
14
+ "options": {
15
+ "outputPath": "dist",
16
+ "index": "src/index.html",
17
+ "browser": "src/main.ts",
18
+ "polyfills": ["zone.js"],
19
+ "tsConfig": "tsconfig.app.json",
20
+ "assets": ["src/favicon.ico"],
21
+ "styles": ["src/styles.css"],
22
+ "scripts": []
23
+ },
24
+ "configurations": {
25
+ "production": {
26
+ "budgets": [
27
+ { "type": "initial", "maximumWarning": "500kb", "maximumError": "1mb" }
28
+ ],
29
+ "outputHashing": "all"
30
+ },
31
+ "development": {
32
+ "buildOptimizer": false,
33
+ "optimization": false,
34
+ "vendorChunk": true,
35
+ "extractLicenses": false,
36
+ "sourceMap": true,
37
+ "namedChunks": true
38
+ }
39
+ },
40
+ "defaultConfiguration": "production"
41
+ },
42
+ "serve": {
43
+ "builder": "@angular/build:dev-server",
44
+ "configurations": {
45
+ "production": { "buildTarget": "{{projectName}}:build:production" },
46
+ "development": { "buildTarget": "{{projectName}}:build:development" }
47
+ },
48
+ "defaultConfiguration": "development"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,17 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # Angular CLI cache
8
+ .angular/cache
9
+
10
+ # misc
11
+ .DS_Store
12
+ *.local
13
+
14
+ # debug
15
+ npm-debug.log*
16
+ yarn-debug.log*
17
+ yarn-error.log*
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "ng": "ng",
7
+ "start": "ng serve",
8
+ "dev": "ng serve",
9
+ "build": "ng build",
10
+ "preview": "ng serve",
11
+ "watch": "ng build --watch --configuration development"
12
+ },
13
+ "dependencies": {
14
+ "@angular/animations": "~22.0.0",
15
+ "@angular/common": "~22.0.0",
16
+ "@angular/compiler": "~22.0.0",
17
+ "@angular/core": "~22.0.0",
18
+ "@angular/forms": "~22.0.0",
19
+ "@angular/platform-browser": "~22.0.0",
20
+ "@angular/platform-browser-dynamic": "~22.0.0",
21
+ "@angular/router": "~22.0.0",
22
+ "@tsparticles/angular": "^4.1.3",
23
+ "rxjs": "~7.8.2",
24
+ "tslib": "^2.8.1",
25
+ "zone.js": "~0.16.2"
26
+ },
27
+ "devDependencies": {
28
+ "@angular-devkit/build-angular": "~22.0.0",
29
+ "@angular/cli": "~22.0.0",
30
+ "@angular/compiler-cli": "~22.0.0",
31
+ "typescript": "~6.0.3"
32
+ }
33
+ }
@@ -0,0 +1,15 @@
1
+ #app-content {
2
+ position: absolute;
3
+ top: 50%;
4
+ left: 50%;
5
+ transform: translate(-50%, -50%);
6
+ z-index: 10;
7
+ text-align: center;
8
+ color: #fff;
9
+ pointer-events: none;
10
+ }
11
+
12
+ h1 {
13
+ font-size: 3.2em;
14
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
15
+ }
@@ -0,0 +1,4 @@
1
+ <div id="app-content">
2
+ <h1>Hello, tsParticles!</h1>
3
+ </div>
4
+ <ngx-particles id="tsparticles" [options]="options" />
@@ -0,0 +1,41 @@
1
+ import { Component, OnInit } from "@angular/core";
2
+ import { NgParticlesService } from "@tsparticles/angular";
3
+ import { loadSlim } from "@tsparticles/slim";
4
+ import type { ISourceOptions } from "@tsparticles/engine";
5
+
6
+ @Component({
7
+ selector: "app-root",
8
+ templateUrl: "./app.component.html",
9
+ styleUrls: ["./app.component.css"],
10
+ })
11
+ export class AppComponent implements OnInit {
12
+ options: ISourceOptions = {
13
+ fullScreen: { enable: true, zIndex: -1 },
14
+ background: { color: { value: "#1a1a2e" } },
15
+ fpsLimit: 60,
16
+ particles: {
17
+ number: { value: 80, density: { enable: true } },
18
+ color: { value: ["#6c5ce7", "#a29bfe", "#fd79a8"] },
19
+ shape: { type: "circle" },
20
+ opacity: { value: 0.5, random: true },
21
+ size: { value: { min: 1, max: 4 }, random: true },
22
+ move: {
23
+ enable: true,
24
+ speed: 2,
25
+ direction: "none",
26
+ random: false,
27
+ straight: false,
28
+ outModes: { default: "out" },
29
+ },
30
+ },
31
+ detectRetina: true,
32
+ };
33
+
34
+ constructor(private readonly ngParticlesService: NgParticlesService) {}
35
+
36
+ ngOnInit(): void {
37
+ void this.ngParticlesService.init(async (engine) => {
38
+ await loadSlim(engine);
39
+ });
40
+ }
41
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from "@angular/core";
2
+ import { BrowserModule } from "@angular/platform-browser";
3
+ import { NgxParticlesModule } from "@tsparticles/angular";
4
+ import { AppComponent } from "./app.component";
5
+
6
+ @NgModule({
7
+ declarations: [AppComponent],
8
+ imports: [BrowserModule, NgxParticlesModule],
9
+ providers: [],
10
+ bootstrap: [AppComponent],
11
+ })
12
+ export class AppModule {}
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{{projectName}}</title>
6
+ <base href="/" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ </head>
9
+ <body>
10
+ <app-root></app-root>
11
+ </body>
12
+ </html>
@@ -0,0 +1,6 @@
1
+ import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
2
+ import { AppModule } from "./app/app.module";
3
+
4
+ platformBrowserDynamic()
5
+ .bootstrapModule(AppModule)
6
+ .catch((err) => console.error(err));
@@ -0,0 +1 @@
1
+ import "zone.js";
@@ -0,0 +1,5 @@
1
+ body {
2
+ margin: 0;
3
+ overflow: hidden;
4
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/app",
5
+ "types": []
6
+ },
7
+ "files": ["src/main.ts"],
8
+ "include": ["src/**/*.d.ts"]
9
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "outDir": "./dist/out-tsc",
6
+ "ignoreDeprecations": "6.0",
7
+ "forceConsistentCasingInFileNames": true,
8
+ "strict": true,
9
+ "noImplicitOverride": true,
10
+ "noPropertyAccessFromIndexSignature": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "sourceMap": true,
14
+ "declaration": false,
15
+ "downlevelIteration": true,
16
+ "experimentalDecorators": true,
17
+ "moduleResolution": "bundler",
18
+ "importHelpers": true,
19
+ "target": "ES2022",
20
+ "module": "ES2022",
21
+ "lib": ["ES2022", "dom"]
22
+ },
23
+ "angularCompilerOptions": {
24
+ "enableI18nLegacyMessageIdFormat": false,
25
+ "strictInjectionParameters": true,
26
+ "strictInputAccessModifiers": true,
27
+ "strictTemplates": true
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/spec",
5
+ "types": ["jasmine"]
6
+ },
7
+ "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
8
+ }
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles React project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,14 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # misc
8
+ .DS_Store
9
+ *.local
10
+
11
+ # debug
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -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": "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
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
5
+ }
6
+
7
+ #app {
8
+ position: absolute;
9
+ top: 50%;
10
+ left: 50%;
11
+ transform: translate(-50%, -50%);
12
+ z-index: 10;
13
+ text-align: center;
14
+ color: #fff;
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,41 @@
1
+ import Particles, { ParticlesProvider } from "@tsparticles/react";
2
+ import { loadSlim } from "@tsparticles/slim";
3
+ import type { Engine } from "@tsparticles/engine";
4
+
5
+ async function init(engine: Engine): Promise<void> {
6
+ await loadSlim(engine);
7
+ }
8
+
9
+ export default function App() {
10
+ return (
11
+ <ParticlesProvider init={init}>
12
+ <div id="app">
13
+ <h1>Hello, tsParticles!</h1>
14
+ </div>
15
+ <Particles
16
+ id="tsparticles"
17
+ options={{
18
+ fullScreen: { enable: true, zIndex: -1 },
19
+ background: { color: { value: "#1a1a2e" } },
20
+ fpsLimit: 60,
21
+ particles: {
22
+ number: { value: 80, density: { enable: true } },
23
+ color: { value: ["#6c5ce7", "#a29bfe", "#fd79a8"] },
24
+ shape: { type: "circle" },
25
+ opacity: { value: 0.5, random: true },
26
+ size: { value: { min: 1, max: 4 }, random: true },
27
+ move: {
28
+ enable: true,
29
+ speed: 2,
30
+ direction: "none",
31
+ random: false,
32
+ straight: false,
33
+ outModes: { default: "out" },
34
+ },
35
+ },
36
+ detectRetina: true,
37
+ }}
38
+ />
39
+ </ParticlesProvider>
40
+ );
41
+ }
@@ -0,0 +1,10 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import App from "./App";
4
+ import "./App.css";
5
+
6
+ createRoot(document.getElementById("root")!).render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>,
10
+ );
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "resolveJsonModule": true,
11
+ "isolatedModules": true,
12
+ "noEmit": true,
13
+ "jsx": "react-jsx",
14
+ "strict": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "noFallthroughCasesInSwitch": true
18
+ },
19
+ "include": ["src"]
20
+ }
@@ -0,0 +1,7 @@
1
+ import react from "@vitejs/plugin-react";
2
+ import { defineConfig } from "vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ base: "./",
7
+ });
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles Solid project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,14 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # misc
8
+ .DS_Store
9
+ *.local
10
+
11
+ # debug
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -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,43 @@
1
+ import { onMount } from "solid-js";
2
+ import Particles, { initParticlesEngine } from "@tsparticles/solid";
3
+ import { loadSlim } from "@tsparticles/slim";
4
+ import type { ISourceOptions } from "@tsparticles/engine";
5
+
6
+ export default function App() {
7
+ onMount(() => {
8
+ void initParticlesEngine(async (engine) => {
9
+ await loadSlim(engine);
10
+ });
11
+ });
12
+
13
+ const options: ISourceOptions = {
14
+ fullScreen: { enable: true, zIndex: -1 },
15
+ background: { color: { value: "#1a1a2e" } },
16
+ fpsLimit: 60,
17
+ particles: {
18
+ number: { value: 80, density: { enable: true } },
19
+ color: { value: ["#6c5ce7", "#a29bfe", "#fd79a8"] },
20
+ shape: { type: "circle" },
21
+ opacity: { value: 0.5, random: true },
22
+ size: { value: { min: 1, max: 4 }, random: true },
23
+ move: {
24
+ enable: true,
25
+ speed: 2,
26
+ direction: "none",
27
+ random: false,
28
+ straight: false,
29
+ outModes: { default: "out" },
30
+ },
31
+ },
32
+ detectRetina: true,
33
+ };
34
+
35
+ return (
36
+ <>
37
+ <div id="app-content">
38
+ <h1>Hello, tsParticles!</h1>
39
+ </div>
40
+ <Particles id="tsparticles" options={options} />
41
+ </>
42
+ );
43
+ }
@@ -0,0 +1,21 @@
1
+ body {
2
+ margin: 0;
3
+ overflow: hidden;
4
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
5
+ }
6
+
7
+ #app-content {
8
+ position: absolute;
9
+ top: 50%;
10
+ left: 50%;
11
+ transform: translate(-50%, -50%);
12
+ z-index: 10;
13
+ text-align: center;
14
+ color: #fff;
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,9 @@
1
+ import "./index.css";
2
+ import { render } from "solid-js/web";
3
+ import App from "./App";
4
+
5
+ const root = document.getElementById("root");
6
+
7
+ if (root) {
8
+ render(() => <App />, root);
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "skipLibCheck": true,
7
+ "moduleResolution": "bundler",
8
+ "allowImportingTsExtensions": true,
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "noEmit": true,
12
+ "jsx": "preserve",
13
+ "jsxImportSource": "solid-js",
14
+ "strict": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "noFallthroughCasesInSwitch": true
18
+ },
19
+ "include": ["src"]
20
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from "vite";
2
+ import solid from "vite-plugin-solid";
3
+
4
+ export default defineConfig({
5
+ plugins: [solid()],
6
+ base: "./",
7
+ });
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles Svelte project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,14 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # misc
8
+ .DS_Store
9
+ *.local
10
+
11
+ # debug
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -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,55 @@
1
+ <script lang="ts">
2
+ import Particles from "@tsparticles/svelte";
3
+ import type { ISourceOptions } from "@tsparticles/engine";
4
+
5
+ const options: ISourceOptions = {
6
+ fullScreen: { enable: true, zIndex: -1 },
7
+ background: { color: { value: "#1a1a2e" } },
8
+ fpsLimit: 60,
9
+ particles: {
10
+ number: { value: 80, density: { enable: true } },
11
+ color: { value: ["#6c5ce7", "#a29bfe", "#fd79a8"] },
12
+ shape: { type: "circle" },
13
+ opacity: { value: 0.5, random: true },
14
+ size: { value: { min: 1, max: 4 }, random: true },
15
+ move: {
16
+ enable: true,
17
+ speed: 2,
18
+ direction: "none",
19
+ random: false,
20
+ straight: false,
21
+ outModes: { default: "out" },
22
+ },
23
+ },
24
+ detectRetina: true,
25
+ };
26
+ </script>
27
+
28
+ <div id="app-content">
29
+ <h1>Hello, tsParticles!</h1>
30
+ </div>
31
+ <Particles id="tsparticles" options={options} />
32
+
33
+ <style>
34
+ :global(body) {
35
+ margin: 0;
36
+ overflow: hidden;
37
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
38
+ }
39
+
40
+ #app-content {
41
+ position: absolute;
42
+ top: 50%;
43
+ left: 50%;
44
+ transform: translate(-50%, -50%);
45
+ z-index: 10;
46
+ text-align: center;
47
+ color: #fff;
48
+ pointer-events: none;
49
+ }
50
+
51
+ h1 {
52
+ font-size: 3.2em;
53
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
54
+ }
55
+ </style>
@@ -0,0 +1,12 @@
1
+ import { mount } from "svelte";
2
+ import { initParticlesEngine } from "@tsparticles/svelte";
3
+ import { loadSlim } from "@tsparticles/slim";
4
+ import App from "./App.svelte";
5
+
6
+ void initParticlesEngine(async (engine) => {
7
+ await loadSlim(engine);
8
+ });
9
+
10
+ const app = mount(App, { target: document.getElementById("app")! });
11
+
12
+ export default app;
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "skipLibCheck": true,
7
+ "moduleResolution": "bundler",
8
+ "allowImportingTsExtensions": true,
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "noEmit": true,
12
+ "strict": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "noFallthroughCasesInSwitch": true
16
+ },
17
+ "include": ["src/**/*.ts", "src/**/*.svelte"]
18
+ }
@@ -0,0 +1,7 @@
1
+ import { svelte } from "@sveltejs/vite-plugin-svelte";
2
+ import { defineConfig } from "vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [svelte()],
6
+ base: "./",
7
+ });
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,14 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # misc
8
+ .DS_Store
9
+ *.local
10
+
11
+ # debug
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="app">
10
+ <h1>Hello, tsParticles!</h1>
11
+ </div>
12
+ <script type="module" src="/src/main.ts"></script>
13
+ </body>
14
+ </html>
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,14 @@
1
+ import "./style.css";
2
+ import { tsParticles } from "@tsparticles/engine";
3
+ import { loadSlim } from "@tsparticles/slim";
4
+ import configs from "@tsparticles/configs";
5
+
6
+ (async () => {
7
+ await loadSlim(tsParticles);
8
+
9
+ const keys = Object.keys(configs);
10
+ const randomKey = keys[Math.floor(Math.random() * keys.length)] as keyof typeof configs;
11
+ const options = configs[randomKey];
12
+
13
+ await tsParticles.load({ id: "tsparticles", options });
14
+ })();
@@ -0,0 +1,22 @@
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
+ line-height: 1.1;
21
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
22
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "resolveJsonModule": true,
11
+ "isolatedModules": true,
12
+ "noEmit": true,
13
+ "strict": true,
14
+ "noUnusedLocals": true,
15
+ "noUnusedParameters": true,
16
+ "noFallthroughCasesInSwitch": true
17
+ },
18
+ "include": ["src"]
19
+ }
@@ -0,0 +1,5 @@
1
+ import { defineConfig } from "vite";
2
+
3
+ export default defineConfig({
4
+ base: "./",
5
+ });
@@ -0,0 +1,10 @@
1
+ # {{projectName}}
2
+
3
+ A tsParticles Vue 3 project scaffolded with [tsparticles-create](https://github.com/tsparticles/tsparticles).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
@@ -0,0 +1,14 @@
1
+ # dependencies
2
+ /node_modules
3
+
4
+ # production
5
+ /dist
6
+
7
+ # misc
8
+ .DS_Store
9
+ *.local
10
+
11
+ # debug
12
+ npm-debug.log*
13
+ yarn-debug.log*
14
+ yarn-error.log*
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -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,56 @@
1
+ <script setup lang="ts">
2
+ import type { ISourceOptions } from "@tsparticles/engine";
3
+
4
+ const options: ISourceOptions = {
5
+ fullScreen: { enable: true, zIndex: -1 },
6
+ background: { color: { value: "#1a1a2e" } },
7
+ fpsLimit: 60,
8
+ particles: {
9
+ number: { value: 80, density: { enable: true } },
10
+ color: { value: ["#6c5ce7", "#a29bfe", "#fd79a8"] },
11
+ shape: { type: "circle" },
12
+ opacity: { value: 0.5, random: true },
13
+ size: { value: { min: 1, max: 4 }, random: true },
14
+ move: {
15
+ enable: true,
16
+ speed: 2,
17
+ direction: "none",
18
+ random: false,
19
+ straight: false,
20
+ outModes: { default: "out" },
21
+ },
22
+ },
23
+ detectRetina: true,
24
+ };
25
+ </script>
26
+
27
+ <template>
28
+ <div id="app-content">
29
+ <h1>Hello, tsParticles!</h1>
30
+ </div>
31
+ <vue-particles id="tsparticles" :options="options" />
32
+ </template>
33
+
34
+ <style>
35
+ body {
36
+ margin: 0;
37
+ overflow: hidden;
38
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
39
+ }
40
+
41
+ #app-content {
42
+ position: absolute;
43
+ top: 50%;
44
+ left: 50%;
45
+ transform: translate(-50%, -50%);
46
+ z-index: 10;
47
+ text-align: center;
48
+ color: #fff;
49
+ pointer-events: none;
50
+ }
51
+
52
+ h1 {
53
+ font-size: 3.2em;
54
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
55
+ }
56
+ </style>
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module "*.vue" {
4
+ import type { DefineComponent } from "vue";
5
+ const component: DefineComponent<object, object, unknown>;
6
+ export default component;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { createApp } from "vue";
2
+ import Particles from "@tsparticles/vue3";
3
+ import { loadSlim } from "@tsparticles/slim";
4
+ import App from "./App.vue";
5
+
6
+ const app = createApp(App);
7
+
8
+ app.use(Particles, {
9
+ init: async (engine) => {
10
+ await loadSlim(engine);
11
+ },
12
+ });
13
+
14
+ app.mount("#app");
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "skipLibCheck": true,
7
+ "moduleResolution": "bundler",
8
+ "allowImportingTsExtensions": true,
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "noEmit": true,
12
+ "jsx": "preserve",
13
+ "strict": true,
14
+ "noUnusedLocals": true,
15
+ "noUnusedParameters": true,
16
+ "noFallthroughCasesInSwitch": true
17
+ },
18
+ "include": ["src/**/*.ts", "src/**/*.vue"]
19
+ }
@@ -0,0 +1,7 @@
1
+ import vue from "@vitejs/plugin-vue";
2
+ import { defineConfig } from "vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [vue()],
6
+ base: "./",
7
+ });
package/template.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "package": {
3
+ "dependencies": {
4
+ "@tsparticles/engine": "^4.1.3",
5
+ "@tsparticles/slim": "^4.1.3",
6
+ "@tsparticles/configs": "^4.1.3"
7
+ },
8
+ "devDependencies": {
9
+ "typescript": "^6.0.3",
10
+ "vite": "^8.0.14"
11
+ }
12
+ }
13
+ }