@luxdamore/nuxt-canvas-sketch
Version:
🌈🎨 Generative Art is the idea realized as genetic code of artificial events, as construction of dynamic complex systems able to generate endless variations. This is also a nuxt-module (@luxdamore/nuxt-canvas-sketch) - [three.js, tensorflow.js and gsap a
38 lines (30 loc) • 677 B
JavaScript
// Library
import canvasSketch from 'canvas-sketch';
// Export the plugin
export default (
{ app },
inject
) => {
inject(
'canvasSketch',
canvasSketch,
);
inject(
'sketch',
(
settings,
callback,
) => {
if( ! settings || ! callback || ! typeof callback === 'function' || ! app.$canvasSketch )
return null;
return app.$canvasSketch(
callback,
{
hotkeys: false,
maxPixelRatio: 3,
... ( settings || {} ),
}
);
}
);
};