(<3kb) Create a transition animation when reload a new qrcode.
$ npm install qrrecode
var qrcode = QRCodeCanvas();
var options;
options = {
type : 'smooth-fade',
duration : 600,
callback : function ( percentage ) {
console.log(percentage);
},
};
options = {
type : 'smooth-blur',
duration : 400,
blur : 3,
callback : function ( percentage ) {
console.log(percentage);
},
};
// QRRecode(
// backgroundCanvas : HTMLCanvasElement,
// foregroundCanvas : HTMLCanvasElement,
// options : Object,
// )
QRRecode(canvas, qrcode, options);
MIT