var elem = document.getElementById("draw-shapes");
var two = new Two({ fitted: true }).appendTo(elem);
var elemWidth = document.querySelector("#draw-shapes").offsetWidth;
for (i = 0; i < 100; i++) {
rects[i] = two.makeRectangle(
Math.floor(Math.random() * elemWidth * 2),
Math.floor(Math.random() * 420 * 2),
10 + Math.floor(Math.random() * 100),
10 + Math.floor(Math.random() * 100)
var group = two.makeGroup(...rects);
document.querySelector("#draw-shapes").addEventListener("click", function (event) {
group.position.set(-event.pageX, -event.pageY);