Giter Club home page Giter Club logo

vue's Introduction

banner

@tsparticles/vue

npm npm GitHub Sponsors

Official tsParticles VueJS 3.x component

Slack Discord Telegram

tsParticles Product Hunt

Installation

yarn add @tsparticles/vue

Usage

import Particles from "@tsparticles/vue";

createApp(App).use(Particles);

Demo config

<template>
    <div id="app">
        <vue-particles
            id="tsparticles"
            :particlesInit="particlesInit"
            :particlesLoaded="particlesLoaded"
            url="http://foo.bar/particles.json"
        />

        <vue-particles
            id="tsparticles"
            :particlesInit="particlesInit"
            :particlesLoaded="particlesLoaded"
            :options="{
                    background: {
                        color: {
                            value: '#0d47a1'
                        }
                    },
                    fpsLimit: 120,
                    interactivity: {
                        events: {
                            onClick: {
                                enable: true,
                                mode: 'push'
                            },
                            onHover: {
                                enable: true,
                                mode: 'repulse'
                            },
                            resize: true
                        },
                        modes: {
                            bubble: {
                                distance: 400,
                                duration: 2,
                                opacity: 0.8,
                                size: 40
                            },
                            push: {
                                quantity: 4
                            },
                            repulse: {
                                distance: 200,
                                duration: 0.4
                            }
                        }
                    },
                    particles: {
                        color: {
                            value: '#ffffff'
                        },
                        links: {
                            color: '#ffffff',
                            distance: 150,
                            enable: true,
                            opacity: 0.5,
                            width: 1
                        },
                        move: {
                            direction: 'none',
                            enable: true,
                            outMode: 'bounce',
                            random: false,
                            speed: 6,
                            straight: false
                        },
                        number: {
                            density: {
                                enable: true,
                                area: 800
                            },
                            value: 80
                        },
                        opacity: {
                            value: 0.5
                        },
                        shape: {
                            type: 'circle'
                        },
                        size: {
                            random: true,
                            value: 5
                        }
                    },
                    detectRetina: true
                }"
        />
    </div>
</template>
//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.

const particlesInit = async engine => {
    //await loadFull(engine);
    await loadSlim(engine);
};

const particlesLoaded = async container => {
    console.log("Particles container loaded", container);
};

TypeScript errors

If TypeScript returns error while importing/using Particles plugin try adding the following import before the previous code:

declare module "@tsparticles/vue";

Demos

The demo website is here

https://particles.js.org

There's also a CodePen collection actively maintained and updated here

https://codepen.io/collection/DPOage

Migrating from Vue 2.x to Vue 3.x

If you are migrating your project from Vue 2.x to 3.x you need to these steps:

  • Change the dependency from vue2-particles to @tsparticles/vue
  • Update the node_modules folder executing npm install or yarn
  • Change the use function from Vue.use(Particles) to createApp(App).use(Particles).

The <Particles /> tag syntax remains the same, so you don't need to do any additional action.

vue's People

Contributors

matteobruni avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue's Issues

Translation into portuguese

Hi,

Is there any way to participate in the translation of this great application ?
I can translate the README.md into portuguese if you want, let me know if you need help.

Leandro.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @babel/plugin-proposal-class-properties Unavailable
npm npm-run-all Available
npm rollup-plugin-terser Available
npm rollup-plugin-typescript Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency rollup-plugin-terser with @rollup/plugin-terser ^0.1.0
  • chore(deps): update dependency @nuxt/typescript-build to v3.0.2
  • chore(deps): update dependency @rollup/plugin-replace to v5.0.7
  • chore(deps): update dependency @tsconfig/node18 to v18.2.4
  • chore(deps): update dependency minimatch to v9.0.5
  • chore(deps): update dependency postcss to v8.4.41
  • chore(deps): update dependency tslib to v2.6.3
  • chore(deps): update dependency vue-tsc to v1.8.27
  • chore(deps): update pnpm/action-setup action to v2.4.1
  • fix(deps): update dependency @nuxt/ui-templates to v1.3.4
  • fix(deps): update dependency vue-demi to v0.14.10
  • chore(deps): update babel monorepo (@babel/core, @babel/eslint-parser, @babel/plugin-proposal-decorators, @babel/plugin-transform-nullish-coalescing-operator, @babel/plugin-transform-optional-chaining, @babel/preset-env)
  • chore(deps): update commitlint monorepo to v17.8.1 (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @rollup/plugin-json to v6.1.0
  • chore(deps): update dependency @rushstack/eslint-patch to v1.10.4
  • chore(deps): update dependency @tsparticles/prettier-config to v2.1.6
  • chore(deps): update dependency @types/node to v20.14.15
  • chore(deps): update dependency @vitejs/plugin-vue to v4.6.2
  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency eslint-plugin-vue to v9.27.0
  • chore(deps): update dependency lerna to v7.4.2
  • chore(deps): update dependency prettier to v3.3.3
  • chore(deps): update dependency rollup to v4.20.0
  • chore(deps): update dependency typescript to v5.5.4
  • chore(deps): update dependency vite to v5.4.0
  • chore(deps): update dependency vue-loader to v15.11.1
  • chore(deps): update nuxtjs monorepo (@nuxt/types, nuxt)
  • chore(deps): update typescript-eslint monorepo to v6.21.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency @tsparticles/configs to v3.5.0
  • fix(deps): update dependency @tsparticles/engine to v3.5.0
  • fix(deps): update dependency core-js to v3.38.0
  • fix(deps): update dependency eslint-config-prettier to v9.1.0
  • fix(deps): update dependency tsparticles to v3.5.0
  • fix(deps): update dependency vue-router to v4.4.3
  • fix(deps): update dependency webpack to v5.93.0
  • fix(deps): update vue monorepo (@vue/reactivity, @vue/runtime-core, @vue/runtime-dom, @vue/shared, vue, vue-server-renderer, vue-template-compiler)
  • chore(deps): update actions/cache action to v4
  • chore(deps): update dependency @vitejs/plugin-vue to v5
  • chore(deps): update dependency @vitejs/plugin-vue-jsx to v4
  • chore(deps): update dependency @vue/eslint-config-prettier to v9
  • chore(deps): update dependency @vue/eslint-config-typescript to v13
  • chore(deps): update dependency css-loader to v7
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lerna to v8
  • chore(deps): update dependency minimatch to v10
  • chore(deps): update dependency postcss-loader to v8
  • chore(deps): update dependency vue-loader to v17
  • chore(deps): update dependency vue-tsc to v2
  • chore(deps): update pnpm/action-setup action to v4
  • chore(deps): update typescript-eslint monorepo to v8 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency lint-staged to v15
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/nodejs.yml
  • actions/checkout v4
  • actions/setup-node v3
  • pnpm/action-setup v2.4.0
  • actions/cache v3
  • actions/checkout v4
  • actions/setup-node v3
  • pnpm/action-setup v2.4.0
  • actions/cache v3
apps/nuxt3/.github/workflows/ci.yml
  • actions/setup-node v3.5.1
  • actions/cache v3.2.2
npm
apps/nuxt2/package.json
  • @tsparticles/engine ^3.0.0-beta.2
  • core-js ^3.32.2
  • nuxt ^2.17.1
  • tsparticles ^3.0.0-beta.2
  • vue ^2.7.14
  • vue-server-renderer ^2.7.14
  • vue-template-compiler ^2.7.14
  • @babel/core ^7.22.19
  • @babel/eslint-parser ^7.22.15
  • @babel/plugin-proposal-class-properties ^7.18.6
  • @babel/plugin-transform-nullish-coalescing-operator ^7.22.11
  • @babel/plugin-transform-optional-chaining ^7.22.15
  • @babel/preset-env ^7.22.15
  • @nuxt/types ^2.17.1
  • @nuxt/typescript-build ^3.0.1
  • @nuxtjs/eslint-config-typescript ^12.1.0
  • @nuxtjs/eslint-module ^4.1.0
  • @types/node ^20.6.0
  • css-loader ^4.3.0
  • eslint ^8.49.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-nuxt ^4.0.0
  • eslint-plugin-vue ^9.17.0
  • postcss-loader ^3.0.0
  • prettier ^3.0.3
  • vue-loader ^15.10.2
  • vue-template-babel-compiler ^2.0.0
  • webpack ^4.46.0
apps/nuxt3/package.json
  • @babel/core ^7.22.9
  • @babel/eslint-parser ^7.22.9
  • @nuxt/ui-templates ^1.3.1
  • @nuxtjs/eslint-config ^12.0.0
  • @nuxtjs/eslint-module ^4.1.0
  • @tsparticles/engine ^3.0.0-beta.2
  • @vue/reactivity ^3.3.4
  • @vue/runtime-core ^3.3.4
  • @vue/runtime-dom ^3.3.4
  • @vue/shared ^3.3.4
  • consola ^3.2.3
  • eslint ^8.46.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-nuxt ^4.0.0
  • eslint-plugin-vue ^9.16.1
  • lint-staged ^14.0.0
  • nuxt ^3.6.5
  • prettier ^3.0.1
  • tsparticles ^3.0.0-beta.2
  • typescript ^5.1.6
  • vue ^3.3.4
  • webpack ^5.88.2
apps/vue2/package.json
  • @tsparticles/configs ^3.0.2
  • @tsparticles/engine ^3.0.2
  • tsparticles ^3.0.2
  • vue ^2.7.15
  • vue-class-component ^7.2.6
  • vue-property-decorator ^9.1.2
  • @babel/core ^7.23.5
  • @babel/plugin-proposal-class-properties ^7.18.6
  • @babel/plugin-proposal-decorators ^7.23.5
  • @rollup/plugin-json ^6.0.1
  • @rollup/plugin-node-resolve ^15.2.3
  • @rollup/plugin-replace ^5.0.5
  • @typescript-eslint/eslint-plugin ^6.13.2
  • @typescript-eslint/parser ^6.13.2
  • @vue/cli-plugin-babel ^5.0.8
  • @vue/cli-plugin-typescript ^5.0.8
  • @vue/cli-service ^5.0.8
  • babel-loader ^9.1.3
  • eslint ^8.55.0
  • eslint-config-prettier ^9.1.0
  • fork-ts-checker-webpack-plugin ^9.0.2
  • postcss ^8.4.32
  • prettier ^3.1.0
  • rollup ^4.7.0
  • rollup-plugin-terser ^7.0.2
  • rollup-plugin-typescript ^1.0.1
  • rollup-plugin-typescript2 ^0.36.0
  • rollup-plugin-vue ^5.1.9
  • tslib ^2.6.2
  • typescript ^5.3.3
  • vue-loader ^15.10.2
  • vue-template-compiler ^2.7.15
  • webpack ^4.46.0
apps/vue3/package.json
  • @tsparticles/configs ^3.0.2
  • @tsparticles/engine ^3.0.2
  • tsparticles ^3.0.2
  • vue ^3.3.11
  • vue-router ^4.2.5
  • @rushstack/eslint-patch ^1.6.0
  • @tsconfig/node18 ^18.2.2
  • @types/node ^20.10.4
  • @vitejs/plugin-vue ^4.5.2
  • @vitejs/plugin-vue-jsx ^3.1.0
  • @vue/eslint-config-prettier ^8.0.0
  • @vue/eslint-config-typescript ^12.0.0
  • @vue/tsconfig ^0.4.0
  • eslint ^8.55.0
  • eslint-plugin-vue ^9.19.2
  • minimatch ^9.0.3
  • npm-run-all ^4.1.5
  • prettier ^3.1.0
  • typescript ^5.3.3
  • vite ^5.0.7
  • vue-tsc ^1.8.25
components/vue/package.json
  • @tsparticles/engine ^3.0.2
  • vue-demi ^0.14.6
  • @rushstack/eslint-patch ^1.6.0
  • @tsconfig/node18 ^18.2.2
  • @tsparticles/prettier-config ^2.0.0
  • @types/node ^20.10.4
  • @vitejs/plugin-vue ^4.5.2
  • @vitejs/plugin-vue-jsx ^3.1.0
  • @vue/eslint-config-prettier ^8.0.0
  • @vue/eslint-config-typescript ^12.0.0
  • @vue/tsconfig ^0.4.0
  • eslint ^8.55.0
  • eslint-plugin-vue ^9.19.2
  • prettier ^3.1.0
  • typescript ^5.3.3
  • unbuild ^2.0.0
  • vue-tsc ^1.8.25
  • @vue/composition-api ^1.7.2
  • vue ^2.0.0 || >=3.0.0
package.json
  • @commitlint/cli ^17.7.1
  • @commitlint/config-conventional ^17.7.0
  • husky ^8.0.3
  • lerna ^7.3.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.