Skip to content

Commit

Permalink
feat: splitting engine from slim and full bundles (v2)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Sep 20, 2021
1 parent 8d465bd commit 268b78c
Show file tree
Hide file tree
Showing 319 changed files with 10,004 additions and 467 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const tsParticles = require("tsparticles");

// or

import {tsParticles} from "tsparticles";
import {tsParticles} from "tsparticles-engine";
```

The imported `tsParticles` is the same instance you have when including the script.
Expand Down
2 changes: 2 additions & 0 deletions bundles/full/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
21 changes: 21 additions & 0 deletions bundles/full/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint"
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-member-accessibility": ["error", {
"accessibility": "no-public"
}]
}
};
12 changes: 12 additions & 0 deletions bundles/full/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 120,
"endOfLine": "lf",
"overrides": [
{
"files": "*.ts",
"options": {
"tabWidth": 4
}
}
]
}
68 changes: 68 additions & 0 deletions bundles/full/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.20.0](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.19.1...tsparticles-preset-bubbles@1.20.0) (2021-09-18)

**Note:** Version bump only for package tsparticles-preset-bubbles





## [1.19.1](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.19.0...tsparticles-preset-bubbles@1.19.1) (2021-09-15)

**Note:** Version bump only for package tsparticles-preset-bubbles





# [1.19.0](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.18.3...tsparticles-preset-bubbles@1.19.0) (2021-08-23)


### Bug Fixes

* **deps:** pin dependencies ([23be870](https://github.com/matteobruni/tsparticles/commit/23be8708d698e1e37a18f2ed292cbccffb0f1e47))
* **deps:** update all ([d9f0ff2](https://github.com/matteobruni/tsparticles/commit/d9f0ff2f8c4ac269aaad5077492746e3da8fb422))


### Features

* improved move path generators ([9b67377](https://github.com/matteobruni/tsparticles/commit/9b67377f9208a005b122e312ad4ad3c95a50deb7))





## [1.18.3](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.18.2...tsparticles-preset-bubbles@1.18.3) (2021-08-10)


### Features

* added new methods to particle class ([5743453](https://github.com/matteobruni/tsparticles/commit/5743453906001569f262888aa54539ad4e1463ac))





## [1.18.2](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.18.1...tsparticles-preset-bubbles@1.18.2) (2021-07-31)

**Note:** Version bump only for package tsparticles-preset-bubbles





## [1.18.1](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.18.0...tsparticles-preset-bubbles@1.18.1) (2021-07-29)

**Note:** Version bump only for package tsparticles-preset-bubbles





# [1.18.0](https://github.com/matteobruni/tsparticles/compare/tsparticles-preset-bubbles@1.17.0...tsparticles-preset-bubbles@1.18.0) (2021-07-29)

**Note:** Version bump only for package tsparticles-preset-bubbles
21 changes: 21 additions & 0 deletions bundles/full/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Matteo Bruni

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
143 changes: 143 additions & 0 deletions bundles/full/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
[![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org)

# tsParticles Bubbles Preset

[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-bubbles/badge)](https://www.jsdelivr.com/package/npm/tsparticles) [![npmjs](https://badge.fury.io/js/tsparticles-preset-bubbles.svg)](https://www.npmjs.com/package/tsparticles-preset-bubbles) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-bubbles)](https://www.npmjs.com/package/tsparticles-preset-bubbles)

[tsParticles](https://github.com/matteobruni/tsparticles) preset for colored bubbles coming from the bottom of the
screen on a white background.

## Sample

![demo](https://raw.githubusercontent.com/matteobruni/tsparticles/v1/presets/bubbles/images/sample.png)

## How to use it

### CDN / Vanilla JS / jQuery

The first step is installing [tsParticles](https://github.com/matteobruni/tsparticles) following the instructions for
vanilla javascript in the main project [here](https://github.com/matteobruni/tsparticles)

Once installed you need one more script to be included in your page (or you can download that
from [jsDelivr](https://www.jsdelivr.com/package/npm/tsparticles-preset-bubbles):

```html
<script src="https://cdn.jsdelivr.net/npm/tsparticles"></script>
<script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-bubbles"></script>
```

This script **MUST** be placed after the `tsParticles` one.

#### Bundle

A bundled script can also be used, this will include every needed plugin needed by the preset.

```html
<script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-bubbles/dist/tsparticles.preset.bubbles.bundle.min.js"></script>
```

### Usage

Once the scripts are loaded you can set up `tsParticles` like this:

```javascript
loadBubblesPreset(tsParticles);

tsParticles.load("tsparticles", {
preset: "bubbles",
});
```

#### Customization

**Important ⚠️**
You can override all the options defining the properties like in any standard `tsParticles` installation.

```javascript
tsParticles.load("tsparticles", {
particles: {
shape: {
type: "square",
},
},
preset: "bubbles",
});
```

Like in the sample above, the circles will be replaced by squares.

### React.js / Preact / Inferno

_The syntax for `React.js`, `Preact` and `Inferno` is the same_.

This sample uses the class component syntax, but you can use hooks as well (if the library supports it).

```javascript
import Particles from "react-tsparticles";
import { Main } from "tsparticles-engine";
import { loadBubblesPreset } from "tsparticles-preset-bubbles";

export class ParticlesContainer extends React.PureComponent<IProps> {
// this customizes the component tsParticles installation
customInit(main: Main) {
// this adds the preset to tsParticles, you can safely use the
loadBubblesPreset(main);
}

render() {
const options = {
preset: "bubbles",
};

return <Particles options={options} init={this.customInit} />;
}
}
```

### Vue (2.x and 3.x)

_The syntax for `Vue.js 2.x` and `3.x` is the same_

```vue
<Particles id="tsparticles" :particlesInit="particlesInit" url="http://foo.bar/particles.json" />
```

```js
function particlesInit(main: Main) {
loadBubblesPreset(main);
}
```

### Angular

```html
<ng-particles
[id]="id"
[options]="particlesOptions"
(particlesLoaded)="particlesLoaded($event)"
(particlesInit)="particlesInit($event)"
></ng-particles>
```

```ts
function particlesInit(main: Main): void {
loadBubblesPreset(main);
}
```

### Svelte

```sveltehtml
<Particles
id="tsparticles"
url="http://foo.bar/particles.json"
on:particlesInit="{onParticlesInit}"
/>
```

```js
let onParticlesInit = (main) => {
loadBubblesPreset(main);
};
```
77 changes: 77 additions & 0 deletions bundles/full/package.dist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "tsparticles",
"version": "1.35.0",
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
"homepage": "https://particles.js.org/",
"scripts": {
"install": "node ./scripts/install.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/matteobruni/tsparticles.git",
"directory": "core/main"
},
"keywords": [
"tsparticles",
"particles.js",
"particlesjs",
"particles",
"particle",
"canvas",
"jsparticles",
"xparticles",
"particles-js",
"particles-bg",
"particles-bg-vue",
"particles-ts",
"particles.ts",
"react-particles-js",
"react-particles.js",
"react-particles",
"react",
"reactjs",
"vue",
"vuejs",
"preact",
"preactjs",
"jquery",
"angularjs",
"angular",
"typescript",
"javascript",
"animation",
"web",
"html5",
"web-design",
"webdesign",
"css",
"html",
"css3",
"animated",
"background"
],
"author": "Matteo Bruni <matteo.bruni@me.com>",
"contributors": [
"Gabriel Barker (https://github.com/gabrielbarker)",
"Tyler Burnett (https://github.com/TylerBurnett)",
"Jonathan Adams (https://github.com/PieceMaker)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/matteobruni/tsparticles/issues"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/matteobruni"
},
"main": "index.js",
"module": "esm/index.js",
"jsdelivr": "tsparticles.min.js",
"unpkg": "tsparticles.min.js",
"browser": "index.js",
"types": "index.d.ts",
"dependencies": {
"tsparticles-engine": "^1.35.0",
"tsparticles-slim": "^1.35.0"
}
}
Loading

0 comments on commit 268b78c

Please sign in to comment.