Based entirely on the Python implementation.
npm install legofy --save
transform function from the Legofy module, and then invoke it by passing in your
;// ...const imgElement = document;;
You can adjust the size of the bricks by using the second argument of the
transform function — by default the
// ...// Make the bricks twice the size of the default.;// ...Or make them twice as small!;
As the brick isn't currently SVG — see ticket — larger bricks will look blurry.
You can also change the
mix-blend-mode value using the second argument — the default is
soft-light all look good as blend modes.
// ...// Change bricks to a more pastel colour.;
By default when the window is resized no re-rendering will occur — it's entirely up to the developer to invoke
transform again – and thankfully the
transform function is idempotent.
;;// ...const imgElement = document;;// ...;
Tested with Chrome 46.0, Firefox 42.0, Safari 9.0.1, Opera 33.0.