Categories: CSSScriptWeb Design

Create A Background Particles System With JavaScript And Canvas – nodes.js

The nodes.js JavaScript library lets you create a particles system with animated nodes and connecting lines for the background.

Built using pure JavaScript and HTML5 canvas API.

Table of Contents

Toggle

How to use it:

Link to the nodes.js JavaScript library.

<script src="js/nodes.js"></script>

Create an HTML canvas element to place the particles system.

Sponsored
class="brush:xml"><canvas id="nodes"></canvas>

Create a new NodesJs object to generate a default particles system on the canvas.

Sponsored
var nodesjs = new NodesJs({
    // options here
});

Customize the particles system using the following parameters.

var nodesjs = new NodesJs({

    // container ID
    id: 'nodes',

    // width
    width: window.innerWidth,

    // height
    height: window.innerHeight,

    // background transition options
    backgroundFrom: [10, 25, 100],
    backgroundTo: [25, 50, 150],
    backgroundDuration: 4000,

    // the number of particles
    number: window.hasOwnProperty('orientation') ? 30: 100,

    // animation speed
    speed: 20
    
});

Changelog:

12/24/2025

  • Fixed demo page

The post Create A Background Particles System With JavaScript And Canvas – nodes.js appeared first on CSS Script.

rssfeeds-admin

Share
Published by
rssfeeds-admin

Recent Posts

Vanilla JS Country Dropdown with Flag Icons & Phone Codes – CountrySelect Pro

CountrySelect Pro is a lightweight vanilla JavaScript country selector that adds a searchable dropdown with…

2 hours ago

Rich Text WYSIWYG Editor for React & Vanilla JS – Editium

Editium is a lightweight WYSIWYG editor that supports both React and Vanilla JavaScript with a…

2 hours ago

WiFi Signals Reveal Human Activities Through Walls by Mapping Body Keypoints

A new open-source edge AI system called π RuView is turning ordinary WiFi infrastructure into…

2 hours ago

On 61st Anniversary of Bloody Sunday, Worries About the Future of Voting Rights and Calls to Action

SELMA, Ala. (AP) — Sixty-one years after state troopers attacked Civil Rights marchers on the…

6 hours ago

Family creating scholarship foundation to honor late son

A Janesville family is creating a scholarship foundation in memory of their son, 14-year-old Kase…

6 hours ago

Star Trek: Starfleet Academy Episode 9 Review – “300th Night”

Spoilers follow for Star Trek: Starfleet Academy Episode 9, “300th Night,” which is available on…

8 hours ago

This website uses cookies.