A modified version of canvas-nest.js without mouse hover event. This results in less CPU usage and removes the jitter effect.
- Script tag Insert the code below between and .
<script src="js/canvas-nest.js"></script>
I strongly suggest to insert before the tag </body>
, as the following:
<html>
<head>
...
</head>
<body>
...
...
<script src="dist/canvas-nest.js"></script>
</body>
</html>
color
: color of lines, default:'0,0,0'
; RGB values: (R,G,B).(note: use ',' to separate.)pointColor
: color of points, default:'0,0,0'
; RGB values: (R,G,B).(note: use ',' to separate.)opacity
: the opacity of line (0~1), default:0.5
.count
: the number of lines, default:99
.zIndex
: z-index property of the background, default:-1
.
Example:
- Script tag
<script type="text/javascript" color="0,0,255" opacity='0.7' zIndex="-2" count="99" src="dist/canvas-nest.js"></script>
Put the canvas-nest.js in js folder
Include the script tag in layout.ejs before the </body>
<script type="text/javascript" color="0,0,255" opacity='0.7' zIndex="-2" count="99" src="dist/canvas-nest.js"></script>
Original repo here - https://github.com/hustcc/canvas-nest.js