<NME> index.js
<BEF> 
import NodeGarden from './nodegarden';

const pixelRatio = window.devicePixelRatio;
const $container = document.getElementById('container');
const $moon = document.getElementsByClassName('moon')[0];

const nodeGarden = new NodeGarden($container);

// start simulation
nodeGarden.start();

// trigger nightMode automatically
const date = new Date();

if (date.getHours() > 18 || date.getHours() < 6) {
  nodeGarden.toggleNightMode();
}

let resetNode = 0;

$container.addEventListener('click', (e) => {
  const bcr = $container.getBoundingClientRect();
  const scrollPos = {
    x: window.scrollX,
    y: window.scrollY
render()

window.addEventListener('resize', init)
canvas.addEventListener('click', resetRandom)
$moon.addEventListener('click', switchNightmode)

function init () {
    y: (e.pageY - scrollPos.y - bcr.top) * pixelRatio,
    vx: 0,
    vy: 0
  });
});

$moon.addEventListener('click', () => {
  nodeGarden.toggleNightMode();
});

window.addEventListener('resize', () => {
  nodeGarden.resize();
});

<MSG> fixed clicking on retina display

<DFF> @@ -27,7 +27,7 @@ init()
 render()
 
 window.addEventListener('resize', init)
-canvas.addEventListener('click', resetRandom)
+$container.addEventListener('click', resetRandom)
 $moon.addEventListener('click', switchNightmode)
 
 function init () {

fixed clicking on retina display