Network Background Animation
Wordpress plugin that adds a floating network animation to the background of a wordpress theme
by Radu Dincă · github.com/dincaradu/network-background · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dincaradu/network-background/archive/refs/heads/master.zipNetwork Background Animation — WordPress Plugin
A lightweight, zero-dependency animated SVG network background for WordPress. Points drift gently; connections fade in/out and periodically rewire. Respects prefers-reduced-motion.
Features
- 70+ configurable nodes with Poisson-disc distribution (no clustering)
- Dynamic connections — lines appear, hold, fade, then rewire to new pairs
- Admin settings — control density, speed, colors, mobile behavior, z-index
- Performance conscious — ~15 KB JS, pauses when tab hidden, no external deps
- Accessible — honors
prefers-reduced-motion,aria-hidden, no layout shift - Works on any theme — fixed-position container at
z-index: -1(configurable)
Installation
Option 1: Upload via WP Admin
- Zip the
network-backgroundfolder:cd /workspace/dincaradu.ro/wp-plugin zip -r network-background.zip network-background - In WordPress: Plugins → Add New → Upload Plugin → select the zip → Install Now → Activate
Option 2: Copy via FTP/SFTP
# Copy to your WordPress plugins directory
cp -r /workspace/dincaradu.ro/wp-plugin/network-background /path/to/wp-content/plugins/
Then activate in Plugins → Installed Plugins.
Option 3: Composer (if you manage WP with Composer)
{
"repositories": [
{ "type": "path", "url": "/workspace/dincaradu.ro/wp-plugin/network-background" }
],
"require": {
"dincaradu/network-background": "@dev"
}
}
Configuration
After activation, go to Settings → Network Background:
| Setting | Default | Description |
|---|---|---|
| Node Count | 70 | Number of points (10–150) |
| Min Distance | 70px | Minimum spacing between nodes |
| Max Connection Distance | 220px | Max distance for a line to form |
| Connection Probability | 0.12 | Fraction of possible connections active at once (0.01–1) |
| Min/Max Duration | 8s / 20s | Fade cycle range for each connection |
| Rewire Interval | 15s | How often the connection graph reshuffles |
| Node/Line Color | #1a1a2e |
Hex color for points and lines |
| Background Color | #ffffff |
Page background hex (applied to <body> if default) |
| Z-Index | -1 | Container stacking order |
| Enable on Mobile | ✓ | Toggle for mobile performance |
How It Works
wp_footer (priority 999)
└─ Injects <div id="network-bg-container"><svg>...</svg></div>
├─ #networkGrid — subtle 100px grid
├─ #networkAmbientOrbs — 3 large pulsing rings
├─ #networkConnections — <line> elements with CSS fade animation
└─ #networkNodes — <circle> elements with CSS pulse animation
The JS (assets/network-background.js) reads config via wp_localize_script → window.NetworkBGConfig, then:
- Generates ~70 nodes with Poisson-disc spacing
- Computes all valid pairs within
max_distance - Activates a random subset (
connection_probability) - Animates: nodes drift, connections fade in/out via CSS keyframes
- Every
rewire_intervalms: discards all connections, picks new random subset
Customization
CSS Overrides (in your theme's style.css)
/* Change container stacking */
#network-bg-container { z-index: -2 !important; }
/* Disable on specific pages */
.page-id-42 #network-bg-container { display: none; }
/* Dark mode adjustment */
@media (prefers-color-scheme: dark) {
#network-bg-container .node,
#network-bg-container .connection {
/* override via CSS custom properties if needed */
}
}
JavaScript Hooks (for developers)
// Pause/resume from console or your code
document.dispatchEvent(new CustomEvent('network-bg:pause'));
document.dispatchEvent(new CustomEvent('network-bg:resume'));
// Access internal state (read-only)
window.NetworkBG = { nodes, connections, config: CONFIG };
Performance
- ~15 KB minified JS (gzipped ~5 KB)
- No external requests — all inline
- Pauses on tab blur —
visibilitychangelistener cancelsrequestAnimationFrame - GPU-friendly — only
transform/opacityanimations (via CSS) - Reduced motion — native media query disables all animation
Requirements
- WordPress 5.8+
- PHP 7.4+
- Modern browser (ES2018+)
License
MIT — free to use, modify, distribute.
Changelog
1.0.0
- Initial release
- Admin settings page with 11 configurable options
- Dynamic rewire animation
- Mobile toggle
- Reduced-motion support