Skip to content

Commit 404d847

Browse files
committed
feat: updated to v3, needs new initialization function to replace particlesInit
1 parent c4f8473 commit 404d847

22 files changed

+989
-14623
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
22

3-
# svelte-particles
3+
# @tsparticles/svelte
44

5-
[![npm](https://img.shields.io/npm/v/svelte-particles)](https://www.npmjs.com/package/svelte-particles) [![npm downloads](https://img.shields.io/npm/dm/svelte-particles)](https://www.npmjs.com/package/svelte-particles) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
5+
[![npm](https://img.shields.io/npm/v/@tsparticles/svelte)](https://www.npmjs.com/package/@tsparticles/svelte) [![npm downloads](https://img.shields.io/npm/dm/@tsparticles/svelte)](https://www.npmjs.com/package/@tsparticles/svelte) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
66

77
Official [tsParticles](https://github.com/matteobruni/tsparticles) SvelteJS component
88

@@ -13,22 +13,22 @@ Official [tsParticles](https://github.com/matteobruni/tsparticles) SvelteJS comp
1313
## Installation
1414

1515
```shell
16-
npm install svelte-particles
16+
npm install @tsparticles/svelte
1717
```
1818

1919
or
2020

2121
```shell
22-
yarn add svelte-particles
22+
yarn add @tsparticles/svelte
2323
```
2424

2525
## Usage
2626

2727
```html
2828
<script>
29-
import Particles from "svelte-particles";
29+
import Particles from "@tsparticles/svelte";
3030
//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
31-
import { loadSlim } from "tsparticles-slim"; // if you are going to use `loadSlim`, install the "tsparticles-slim" package too.
31+
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
3232
3333
let particlesUrl = "http://foo.bar/particles.json"; // placeholder, replace it with a real url
3434
@@ -98,12 +98,12 @@ You can see a sample below:
9898
<script>
9999
import { onMount } from "svelte";
100100
//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
101-
import { loadSlim } from "tsparticles-slim"; // if you are going to use `loadSlim`, install the "tsparticles-slim" package too.
101+
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
102102
103103
let ParticlesComponent;
104104
105105
onMount(async () => {
106-
const module = await import("svelte-particles");
106+
const module = await import("@tsparticles/svelte");
107107
108108
ParticlesComponent = module.default;
109109
});
@@ -191,7 +191,7 @@ import { defineConfig } from "vite";
191191
export default defineConfig({
192192
plugins: [sveltekit()],
193193
ssr: {
194-
noExternal: ["tsparticles", "tsparticles-slim", "tsparticles-engine", "svelte-particles"], // add all tsparticles libraries here, they're not made for SSR, they're client only
194+
noExternal: ["tsparticles", "@tsparticles/slim", "@tsparticles/engine", "@tsparticles/svelte"], // add all tsparticles libraries here, they're not made for SSR, they're client only
195195
},
196196
});
197197
```

apps/svelte-kit/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
"format": "prettier --plugin=\"prettier-plugin-svelte\" --write ."
1313
},
1414
"devDependencies": {
15-
"@fontsource/fira-mono": "^5.0.7",
16-
"@neoconfetti/svelte": "^1.0.0",
17-
"@sveltejs/adapter-auto": "^2.1.0",
18-
"@sveltejs/kit": "^1.22.4",
19-
"@types/cookie": "^0.5.1",
20-
"@typescript-eslint/eslint-plugin": "^6.2.1",
21-
"@typescript-eslint/parser": "^6.2.1",
22-
"eslint": "^8.46.0",
23-
"eslint-config-prettier": "^9.0.0",
24-
"eslint-plugin-svelte": "^2.32.4",
25-
"prettier": "^3.0.1",
26-
"prettier-plugin-svelte": "^3.0.3",
27-
"svelte": "^4.1.2",
28-
"svelte-check": "^3.4.6",
29-
"svelte-particles": "^2.12.0",
30-
"svelte-preprocess": "^5.0.4",
31-
"tslib": "^2.6.1",
32-
"tsparticles": "^2.12.0",
33-
"tsparticles-engine": "^2.12.0",
34-
"typescript": "^5.1.6",
35-
"vite": "^4.4.8"
15+
"@fontsource/fira-mono": "^5.0.8",
16+
"@sveltejs/adapter-auto": "^3.0.1",
17+
"@sveltejs/kit": "^2.0.6",
18+
"@sveltejs/vite-plugin-svelte": "^3.0.1",
19+
"@types/cookie": "^0.6.0",
20+
"@typescript-eslint/eslint-plugin": "^6.15.0",
21+
"@typescript-eslint/parser": "^6.15.0",
22+
"eslint": "^8.56.0",
23+
"eslint-config-prettier": "^9.1.0",
24+
"eslint-plugin-svelte": "^2.35.1",
25+
"prettier": "^3.1.1",
26+
"prettier-plugin-svelte": "^3.1.2",
27+
"svelte": "^4.2.8",
28+
"svelte-check": "^3.6.2",
29+
"@tsparticles/svelte": "workspace:^",
30+
"svelte-preprocess": "^5.1.3",
31+
"tslib": "^2.6.2",
32+
"tsparticles": "^3.0.2",
33+
"@tsparticles/engine": "^3.0.2",
34+
"typescript": "^5.3.3",
35+
"vite": "^5.0.10"
3636
},
3737
"type": "module"
3838
}

apps/svelte-kit/src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Counter from './Counter.svelte';
33
import welcome from '$lib/images/svelte-welcome.webp';
44
import welcome_fallback from '$lib/images/svelte-welcome.png';
5-
import Particles from "svelte-particles";
5+
import Particles from "@tsparticles/svelte";
66
import { loadFull } from "tsparticles";
77
88
let particlesConfig = {

apps/svelte-kit/src/routes/Header.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
<li aria-current={$page.url.pathname === '/about' ? 'page' : undefined}>
2323
<a href="/about">About</a>
2424
</li>
25-
<li aria-current={$page.url.pathname.startsWith('/sverdle') ? 'page' : undefined}>
26-
<a href="/sverdle">Sverdle</a>
27-
</li>
2825
</ul>
2926
<svg viewBox="0 0 2 3" aria-hidden="true">
3027
<path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" />

apps/svelte-kit/src/routes/about/+page.svelte

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,4 @@
1818
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening
1919
the devtools network panel and reloading.
2020
</p>
21-
22-
<p>
23-
The <a href="/sverdle">Sverdle</a> page illustrates SvelteKit's data loading and form handling. Try
24-
using it with JavaScript disabled!
25-
</p>
2621
</div>

apps/svelte-kit/src/routes/sverdle/+page.server.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)