A vue.js particles animation background component

Overview

particles-bg-vue

NPM JavaScript Style Guide

A vue.js particles animation background component. Use it to make your website look cool.

Check it out if you want to use it in React https://github.com/lindelof/particles-bg

Specify

This project refers to the source code of the Proton official website, and proton's online demo. I packaged it into a vue.js component. Thanks to the great author.

Online demo

Install

npm install --save particles-bg-vue

Usage

Method 1: Import and use in the component

<particles-bg type="lines" :bg="true" />
...

import { ParticlesBg } from "particles-bg-vue";
export default {
  name: "App",
  components: {
    ParticlesBg
  }
};

Method 2: Use it globally

import VueParticlesBg from "particles-bg-vue";

Vue.use(VueParticlesBg);

....
<particles-bg type="random" :bg="true" />

Parameter Description

<particles-bg color="#ff0000" num=200 type="circle" :bg={true} />

* type - Is the type of particle animation

Is the type of particle animation, random is a random selection. You are also free to customize use custom.

"color"
"ball"
"lines"
"thick"
"circle"
"cobweb"
"polygon"
"square"
"tadpole"
"fountain"
"random"
"custom"

* num - The number of particles emitted each time, generally not set

* color - The background color or particle color of the particle scene

Notice: which should be an array under type=color

* canvas - canvas dom style

:canvas="canvasObject"
...

* bg - Set to html background

Is set the following properties

position: "absolute",
zIndex: -1,
top: 0,
left: 0

About Custom

You can use type="custom" to achieve a higher degree of freedom for the particle background.

  <particles-bg type="custom" :config="config" :bg="true"/>
  ...

  data: function() {
    return {
      config: {
        num: [4, 7],
        rps: 0.1,
        radius: [5, 40],
        life: [1.5, 3],
        v: [2, 3],
        tha: [-30, 30],
        body: icon,
        alpha: [0.6, 0],
        scale: [0.1, 0.4],
        position: "all",
        cross: "dead",
        random: 15
      }
    };
  }

Similar projects

Maybe you will like these two projects, they will also make your page flourish

License

https://opensource.org/licenses/MIT

You might also like...

Recreation of the background scale hover effect seen on the DDD Hotel website using CSS clip paths.

Recreation of the background scale hover effect seen on the DDD Hotel website using CSS clip paths.

Background Scale Hover Effect Recreation of the background scale hover effect seen on the DDD Hotel menu using CSS clip paths. Article on Codrops Demo

Dec 6, 2022

A motion hover effect for a background grid of images.

A motion hover effect for a background grid of images.

Image Grid Motion Effect A motion hover effect for a background grid of images. Article on Codrops Demo Installation Install dependencies: npm install

Dec 31, 2022

fixed-background-effect

Fixed Background Effect A simple template that takes advantage of the background-attachment CSS property to create a fixed background effect. Article

Oct 28, 2022

A subtle tilt effect for images. The idea is to move and rotate semi-transparent copies with the same background image in order to create a subtle motion or depth effect.

Image Tilt Effect A subtle tilt effect for images. The idea is to move and rotate semi-transparent copies with the same background image in order to c

Nov 21, 2022

image/video/content slideshow engine providing high quality animation effects including Kenburns Effect and GLSL Transitions.

image/video/content slideshow engine providing high quality animation effects including Kenburns Effect and GLSL Transitions.

Diaporama Diaporama is an image/video/content slideshow engine providing high quality animation effects including Kenburns effect and GLSL Transitions

Nov 26, 2022

Demonstration of different animation effects with AngularJS ngView directive.

ngView-animation-effects This is a simple demonstration of how easy you can make your ngView directive transition pages with nice animations. All you

Dec 31, 2022

Pure CSS (no JavaScript) implementation of Android Material design "ripple" animation

Pure CSS (no JavaScript) implementation of Android Material design

Pure CSS ripple effect (no JavaScript) CSS-only implementation of Android Material design "ripple" animation on click event Main advantage of this sol

Dec 11, 2022

circle-svg-animation

circle-svg-animation

Circle SVG Animation Plug css, js and just add short code in your html. Change the custom attribute data-percent and data-time for setting your percen

Aug 18, 2022
Comments
  • IE11 error

    IE11 error

    Hi there,

    I've tried to implement this in my project and it works fine in Chrome but I just get "Syntax error" when I try to load the page in IE. Is this a known issue? Perhaps I need polyfills?

    opened by aonghas 1
  • Bump eslint from 3.19.0 to 4.19.1

    Bump eslint from 3.19.0 to 4.19.1

    Bumps eslint from 3.19.0 to 4.19.1.

    Release notes

    Sourced from eslint's releases.

    v4.19.1

    • 3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) (#10113) (薛定谔的猫)
    • abc765c Fix: object-curly-newline minProperties w/default export (fixes #10101) (#10103) (Kevin Partington)
    • 6f9e155 Docs: Update ambiguous for...in example for guard-for-in (#10114) (CJ R)
    • 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) (Kevin Partington)
    • a717c5d Chore: Adding log at beginning of unit tests in Makefile.js (#10102) (Kevin Partington)

    v4.19.0

    • 55a1593 Update: consecutive option for one-var (fixes #4680) (#9994) (薛定谔的猫)
    • 8d3814e Fix: false positive about ES2018 RegExp enhancements (fixes #9893) (#10062) (Toru Nagashima)
    • 935f4e4 Docs: Clarify default ignoring of node_modules (#10092) (Matijs Brinkhuis)
    • 72ed3db Docs: Wrap Buffer() in backticks in no-buffer-constructor rule description (#10084) (Stephen Edgar)
    • 3aded2f Docs: Fix lodash typos, make spacing consistent (#10073) (Josh Smith)
    • e33bb64 Chore: enable no-param-reassign on ESLint codebase (#10065) (Teddy Katz)
    • 66a1e9a Docs: fix possible typo (#10060) (Vse Mozhet Byt)
    • 2e68be6 Update: give a node at least the indentation of its parent (fixes #9995) (#10054) (Teddy Katz)
    • 72ca5b3 Update: Correctly indent JSXText with trailing linebreaks (fixes #9878) (#10055) (Teddy Katz)
    • 2a4c838 Docs: Update ECMAScript versions in FAQ (#10047) (alberto)

    v4.18.2

    • 6b71fd0 Fix: [email protected], because 4.0.3 needs "ajv": "^6.0.1" (#10022) (Mathieu Seiler)
    • 3c697de Chore: fix incorrect comment about linter.verify return value (#10030) (Teddy Katz)
    • 9df8653 Chore: refactor parser-loading out of linter.verify (#10028) (Teddy Katz)
    • f6901d0 Fix: remove catastrophic backtracking vulnerability (fixes #10002) (#10019) (Jamie Davis)
    • e4f52ce Chore: Simplify dataflow in linter.verify (#10020) (Teddy Katz)
    • 33177cd Chore: make library files non-executable (#10021) (Teddy Katz)
    • 558ccba Chore: refactor directive comment processing (#10007) (Teddy Katz)
    • 18e15d9 Chore: avoid useless catch clauses that just rethrow errors (#10010) (Teddy Katz)
    • a1c3759 Chore: refactor populating configs with defaults in linter (#10006) (Teddy Katz)
    • aea07dc Fix: Make max-len ignoreStrings ignore JSXText (fixes #9954) (#9985) (Rachael Sim)

    v4.18.1

    • f417506 Fix: ensure no-await-in-loop reports the correct node (fixes #9992) (#9993) (Teddy Katz)
    • 3e99363 Docs: Fixed typo in key-spacing rule doc (#9987) (Jaid)
    • 7c2cd70 Docs: deprecate experimentalObjectRestSpread (#9986) (Toru Nagashima)

    v4.18.0

    • 70f22f3 Chore: Apply memoization to config creation within glob utils (#9944) (Kenton Jacobsen)
    • 0e4ae22 Update: fix indent bug with binary operators/ignoredNodes (fixes #9882) (#9951) (Teddy Katz)
    • 47ac478 Update: add named imports and exports for object-curly-newline (#9876) (Nicholas Chua)
    • e8efdd0 Fix: support Rest/Spread Properties (fixes #9885) (#9943) (Toru Nagashima)
    • f012b8c Fix: support Async iteration (fixes #9891) (#9957) (Toru Nagashima)
    • 74fa253 Docs: Clarify no-mixed-operators options (fixes #9962) (#9964) (Ivan Hayes)
    • 426868f Docs: clean up key-spacing docs (fixes #9900) (#9963) (Abid Uzair)
    • 4a6f22e Update: support eslint-disable-* block comments (fixes #8781) (#9745) (Erin)
    • 777283b Docs: Propose fix typo for function (#9965) (John Eismeier)
    • bf3d494 Docs: Fix typo in max-len ignorePattern example. (#9956) (Tim Martin)
    • d64fbb4 Docs: fix typo in prefer-destructuring.md example (#9930) (Vse Mozhet Byt)
    • f8d343f Chore: Fix default issue template (#9946) (Kai Cataldo)
    ... (truncated)
    Changelog

    Sourced from eslint's changelog.

    v4.19.1 - March 21, 2018

    • 3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) (#10113) (薛定谔的猫)
    • abc765c Fix: object-curly-newline minProperties w/default export (fixes #10101) (#10103) (Kevin Partington)
    • 6f9e155 Docs: Update ambiguous for...in example for guard-for-in (#10114) (CJ R)
    • 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) (Kevin Partington)
    • a717c5d Chore: Adding log at beginning of unit tests in Makefile.js (#10102) (Kevin Partington)

    v4.19.0 - March 16, 2018

    • 55a1593 Update: consecutive option for one-var (fixes #4680) (#9994) (薛定谔的猫)
    • 8d3814e Fix: false positive about ES2018 RegExp enhancements (fixes #9893) (#10062) (Toru Nagashima)
    • 935f4e4 Docs: Clarify default ignoring of node_modules (#10092) (Matijs Brinkhuis)
    • 72ed3db Docs: Wrap Buffer() in backticks in no-buffer-constructor rule description (#10084) (Stephen Edgar)
    • 3aded2f Docs: Fix lodash typos, make spacing consistent (#10073) (Josh Smith)
    • e33bb64 Chore: enable no-param-reassign on ESLint codebase (#10065) (Teddy Katz)
    • 66a1e9a Docs: fix possible typo (#10060) (Vse Mozhet Byt)
    • 2e68be6 Update: give a node at least the indentation of its parent (fixes #9995) (#10054) (Teddy Katz)
    • 72ca5b3 Update: Correctly indent JSXText with trailing linebreaks (fixes #9878) (#10055) (Teddy Katz)
    • 2a4c838 Docs: Update ECMAScript versions in FAQ (#10047) (alberto)

    v4.18.2 - March 2, 2018

    • 6b71fd0 Fix: [email protected], because 4.0.3 needs "ajv": "^6.0.1" (#10022) (Mathieu Seiler)
    • 3c697de Chore: fix incorrect comment about linter.verify return value (#10030) (Teddy Katz)
    • 9df8653 Chore: refactor parser-loading out of linter.verify (#10028) (Teddy Katz)
    • f6901d0 Fix: remove catastrophic backtracking vulnerability (fixes #10002) (#10019) (Jamie Davis)
    • e4f52ce Chore: Simplify dataflow in linter.verify (#10020) (Teddy Katz)
    • 33177cd Chore: make library files non-executable (#10021) (Teddy Katz)
    • 558ccba Chore: refactor directive comment processing (#10007) (Teddy Katz)
    • 18e15d9 Chore: avoid useless catch clauses that just rethrow errors (#10010) (Teddy Katz)
    • a1c3759 Chore: refactor populating configs with defaults in linter (#10006) (Teddy Katz)
    • aea07dc Fix: Make max-len ignoreStrings ignore JSXText (fixes #9954) (#9985) (Rachael Sim)

    v4.18.1 - February 20, 2018

    • f417506 Fix: ensure no-await-in-loop reports the correct node (fixes #9992) (#9993) (Teddy Katz)
    • 3e99363 Docs: Fixed typo in key-spacing rule doc (#9987) (Jaid)
    • 7c2cd70 Docs: deprecate experimentalObjectRestSpread (#9986) (Toru Nagashima)

    v4.18.0 - February 16, 2018

    • 70f22f3 Chore: Apply memoization to config creation within glob utils (#9944) (Kenton Jacobsen)
    • 0e4ae22 Update: fix indent bug with binary operators/ignoredNodes (fixes #9882) (#9951) (Teddy Katz)
    • 47ac478 Update: add named imports and exports for object-curly-newline (#9876) (Nicholas Chua)
    • e8efdd0 Fix: support Rest/Spread Properties (fixes #9885) (#9943) (Toru Nagashima)
    • f012b8c Fix: support Async iteration (fixes #9891) (#9957) (Toru Nagashima)
    • 74fa253 Docs: Clarify no-mixed-operators options (fixes #9962) (#9964) (Ivan Hayes)
    • 426868f Docs: clean up key-spacing docs (fixes #9900) (#9963) (Abid Uzair)
    • 4a6f22e Update: support eslint-disable-* block comments (fixes #8781) (#9745) (Erin)
    ... (truncated)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump webpack-bundle-analyzer from 2.13.1 to 3.6.0

    Bump webpack-bundle-analyzer from 2.13.1 to 3.6.0

    Bumps webpack-bundle-analyzer from 2.13.1 to 3.6.0.

    Release notes

    Sourced from webpack-bundle-analyzer's releases.

    First test with Lerna monorepo

    th0r/webpack-bundle-analyzer#98

    Changelog

    Sourced from webpack-bundle-analyzer's changelog.

    3.6.0

    3.5.2

    3.5.1

    • Bug Fix
      • Fix regression in support of webpack dev server and webpack --watch (issue #312, fixed in #313 by @​gaokun)

    3.5.0

    • Improvements

    3.4.1

    • Bug Fix
      • Fix regression of requiring an object to be passed to new BundleAnalyzerPlugin() (issue #300, fixed in #302 by @​jerryOnlyZRJ)

    3.4.0

    3.3.2

    • Bug Fix
      • Fix regression with escaping internal assets (#264, fixes #263)

    3.3.1

    • Improvements

      • Use relative links for serving internal assets (#261, fixes #254)
      • Properly escape embedded JS/JSON (#262)
    • Bug Fix

    ... (truncated)
    Commits
    • 9eb7499 v3.6.0
    • 9c582cf Add changelog entry about readability improvement
    • ea074c1 Merge pull request #323 from lemonmade/fix-self-global-object
    • 2116b66 Allow self for globalObject in async chunks
    • f49796f Merge pull request #320 from lorenzos/font-and-tooltip-opacity
    • 84044cd Improved readability of translucent tooltips
    • df49b19 Fixed serif font when Verdana is not available
    • 7fd44c9 v3.5.2
    • c619d51 Merge pull request #317 from bregenspan/fix-checked-bundles-not-updating
    • 2b685ed Update changelog with checkbox fix
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • help or bug Nuxt

    help or bug Nuxt

    Hi

    i have read you post on nuxt dev.to so i have 2 thinks:

    1 - when i put mode: "universal" i got an error:

    cannot use import statement outside a module vue
    

    but when i change it to spa it's work , i see also that appear in your post , but maybe you have omit to mention this change.

    2 . when i tried to implement with vuetify that don't work:

    <template>
      <v-app class="app">
        <particles-bg type="circle" :bg="true" /> 
        <nuxt/>
      </v-app>
    </template>
    

    here my print screen Screenshot from 2020-05-06 14-35-49

    but with div instead of v-app work


    step to reproduce

    yarn create nuxt-app NuxtParticles
    cd NuxtParticles
    yarn add particles-bg-vue
    

    add file plugins/particles.ts with this content

    import Vue from "vue";
    import VueParticlesBg from "particles-bg-vue";
    
    Vue.use(VueParticlesBg);
    

    edit the file nuxt.config.js

    mode: 'spa'
    plugins: ["@/plugins/particles"],
    

    edit file layouts/default.vue as:

    <template>
      <v-app class="app">
        <particles-bg type="circle" :bg="true" /> 
        <nuxt/>
      </v-app>
    </template>
    
    

    can you advise

    Thank you

    opened by Ben621 4
Owner
lindelof
✈️Web developer 👴Playwright 🌋Python developer 🐝Guitarist 🌎 Traveller & I like react / react-native / typescript❤️ 💛
lindelof
Performant Particles: 3 to 6 times faster than tsParticles or Particles.js

perParticles Performant Particles is a demo that was written to handle a comparatively large amount of particles without slowing down to the same degr

Alaric von Teplitz 28 Oct 2, 2022
A bursting particles effects buttons component ✨💥❄️🌋

vue-particle-effect-buttons (demo) Bursting particle effect buttons for Vue. This library is a Vue portal of an awesome Codrops Article by Luis Manuel

Vincent Guo 252 Nov 11, 2022
Lightweight, High Performance Particles in Canvas

Sparticles https://sparticlesjs.dev Lightweight, High Performance Particles in Canvas. For those occasions when you ?? just ?? gotta ?? have ?? sparkl

Simon Goellner 171 Dec 29, 2022
A little library that can be used for bursting particles effects on buttons and other elements

Particle Effects for Buttons Bursting particles effects for buttons. By Luis Manuel. Article on Codrops Demo Credits anime.js Basic usage The Particle

Codrops 1.2k Jan 1, 2023
A vanishing effect for particles and magic lovers using Threejs, GSAP and custom shaders.

Three.js Experiment - Vanishing Suzanne Demo version Get started First, you need nodejs on your computer to build the assets. Install dependencies: np

Arno Di Nunzio 120 Dec 23, 2022
Javascript library to generate an infinite stream or a burst of image based particles on HTML canvas.

spxparticles Stream or a burst of image particles on HTML canvas Simple Javascript library for generating an infinine stream or a burst of image based

Tuomo Kulomaa 3 Dec 3, 2020
Add a water ripple effect to your background using WebGL.

jQuery Ripples Plugin By the powers of WebGL, add a layer of water to your HTML elements which will ripple by cursor interaction! Important: this plug

Pim Schreurs 976 Dec 30, 2022
A decorative website background effect where SVG shapes morph and transform on scroll.

Morphing Background Shapes A decorative website background effect where SVG shapes morph and transform on scroll. Article on Codrops Demo This demo is

Codrops 351 Dec 26, 2022
Background image segment effect as seen on [Filippo Bello's Portfolio](http://www.filippobello.com/portfolio).

Segment Effect Background image segment effect as seen on Filippo Bello's Portfolio. Article on Codrops Demo License Integrate or build upon it for fr

Codrops 526 Nov 29, 2022
Switch the background-image with using effect.

jQuery.BgSwitcher Switch the background image with using effect. Demo http://rewish.github.io/jquery-bgswitcher/ Usage <div class="box"> <p>Lorem ip

rewish 195 Dec 30, 2022