Background Animation HTML CSS and Particles JS

animated background using particles js

The importance of animations is essential for creating an intuitive, attractive and dynamic website. They help improve the user experience and provide visual feedback. Animations prevent frustration among users and user feel satisfied after visiting an animated website. Background animations, especially on the homepage of a website, play an important role in setting the mood and grabbing the attention of users. In this blog post, you will learn how to create an animated background using HTML, CSS and JS. We have shared many projects on CSS animation examples, HTML CSS and JavaScript in this website. If you want, check out those snippets. We have added a video tutorial below for your convenience. Check it out before collecting the source code.

Video Tutorial:




We hope you watched the above video tutorial on background animation. A polished video background, especially on a website homepage, helps set the atmosphere and mood of a visitor. For example, a nature background video helps set a calm and organic tone for a spa-type website, while a kinetic shape-type video sets an innovative feel for a technology or software company. We all know that the homepage of any website is the digital storefront of that website. If we want to make an impression in a few seconds, an attractive, high-quality background animation instantly attracts the visitors. It encourages them to explore further. In this project, we created a background animation using HTML CSS and the particles js jquery plugin. First, we took a div called 'home-area'. For the banner text, we took another div called 'banner-text'. After that, we placed an h2 tag. Search for the particles js jquery plugin and add the particles js and app js files to your project. Also, add the latest jquery file.

In the CSS part, we have removed the default margins and padding. Next, we have set a background image and placed the text in the middle of the viewport. To get the animation, we need to add an ID 'particle-js' to the 'home-area' div. In the app js file, we need to make some adjustments to get the effect shown in the video tutorial above. We need to change the shape element to 'star'. Also, we need to change other values ​​like opacity, size, line_linked, move, and interactivity. All of this is shown in the video tutorial above.

You May Also Like:


Background Animation with Particles js [ Source Code ]:


For this project, we need to create an HTML file with .html extension and a CSS file with .css extension. Add the plugin file and the latest jquery file to your project. Please copy the code from the code box below and paste it into your project. If you face any issue, download the code from the download button given at the bottom of this blog post.

ADD HTML:




ADD CSS:




Animations are important for any website to grab the attention of the users. However, we have to remember that they should complement the main content, never overshadow the text or important CTAs. It should be optimized to load quickly and not slow down the overall page speed. We hope you have successfully implemented the code. For more snippets, please click the load more button on our homepage and stay connected with the blog. Thank you for visiting the blog.

Please do not enter any spam link in the comment box.

Post a Comment

Please do not enter any spam link in the comment box.

Post a Comment (0)

Previous Post Next Post