Implementation of dynamic particle background plugin for Vue login page

Implementation of dynamic particle background plugin for Vue login page

The dynamic particle effects are as follows:

insert image description here

Install the plugin

npm install vue-particles --save-dev

Import globally in main.js file

import VueParticles from 'vue-particles'  
Vue.use(VueParticles)

Use in vue file

 <vue-particles
          color="#409EFF"
          :particleOpacity="0.7"
          :particlesNumber="60"
          shapeType="circle"
          :particleSize="6"
          linesColor="#409EFF"
          :linesWidth="1"
          :lineLinked="true"
          :lineOpacity="0.4"
          :linesDistance="150"
          :moveSpeed="3"
          :hoverEffect="true"
          hoverMode="grab"
          :clickEffect="true"
          clickMode="push">
</vue-particles>

Use dynamic particles as the background image. When a new div needs to be presented, you will find that the div cannot cover the vue-particles content and will be displayed later in turn. Therefore, position:absolute is added, and when there is a new div box, it is set to position:relative

<style>
#particles-js {
  width: 100%;
  height: calc(100% - 100px);
  position: absolute;
}
</style>

insert image description here

About the above attributes:

Properties of vue-particles:
color: String type. Default is '#dedede'. The color of the particles.
particleOpacity: Number type. Default is 0.7. Particle transparency.
particlesNumber: Number type. The default value is 80. Number of particles.
shapeType: String type. Default is 'circle'. Available particle appearance types are: "circle", "edge", "triangle", "polygon", "star".
particleSize: Number type. The default value is 80. Individual particle size.
linesColor: String type. Default is '#dedede'. Line color.
linesWidth: Number type. Default is 1. Line width.
lineLinked: Boolean type. Default is true. Is the connection cable available?
lineOpacity: Number type. Default is 0.4. Line transparency.
linesDistance: Number type. The default is 150. Line distance.
moveSpeed: Number type. Default is 3. The speed of particle movement.
hoverEffect: Boolean type. Default is true. Whether there are hover effects.
hoverMode: String type. Default is true. Available hover modes are: "grab", "repulse", "bubble".
clickEffect: Boolean type. Default is true. Whether there is a click effect.
clickMode: String type. Default is true. Available click modes are: "push", "remove", "repulse", "bubble"

This is the end of this article about the implementation of the dynamic particle background plug-in for the Vue login page. For more related Vue dynamic particle background content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Vue implements the background particle effects of the login page
  • Detailed explanation of how to use the particles plug-in to implement particle background in Vue3
  • Using particles in the vue project to achieve particle background effects and the pitfalls encountered (buttons do not respond to clicks)
  • Vue particle effects sample code
  • Vue realizes starry sky effect

<<:  mysql-8.0.16 winx64 latest installation tutorial with pictures and text

>>:  How to install a virtual machine with Windows services on Mac

Recommend

Specific use of CSS front-end page rendering optimization attribute will-change

Preface When scroll events such as scroll and res...

Summary of some common methods of JavaScript array

Table of contents 1. How to create an array in Ja...

Linux sftp command usage

Concept of SFTP sftp is the abbreviation of Secur...

Solutions to Mysql index performance optimization problems

The optimization created by MySQL is to add index...

Implementation of multi-site configuration of Nginx on Mac M1

Note: nginx installed via brew Website root direc...

Solution to slow response of Tomcat server

1. Analytical thinking 1. Eliminate the machine&#...

Responsive layout summary (recommended)

Basic knowledge of responsive layout development ...

Share MySql8.0.19 installation pit record

The previous article introduced the installation ...

Mini Program to Implement Simple List Function

This article example shares the specific code of ...

Trash-Cli: Command-line Recycle Bin Tool on Linux

I believe everyone is familiar with the trashcan,...

CSS style writing order and naming conventions and precautions

The significance of writing order Reduce browser ...