Some changes;

GitHub uses tabs with indent size 8 for indentation (I always use 4 spaces for indentation, but you had tabs and I kept indentation that way) so code looks a bit ugly, hope it will not scare you : ]


Replaced IIFE and "return function";
Replaced "var silhouetteColor" with "context.fillStyle";
Replaced function drawLine with context.fillRect;
Changed basic sanity check to be "if (s)";
Removed allLineLengths array;
Changed canvas.width to be equal to window.innerWidth/2 (That should be
enough, but you can always change it to be equal to window.innerWidth);

// TODO minify