UNPKG

cvs

Version:

A basic canvas framework for 2d drawing.

1 lines 1.28 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{221:function(t,a,n){"use strict";n.r(a);n(13),n(22);var r=n(166),e=null,o={components:{Container:n(167).a},data:function(){return{}},mounted:function(){var t=new r.g({containerId:"container"}).layer();this.layer=t;for(var a=0;a<60;a++){var n=30*Math.random()+10;t.append(new r.e({d:{type:"circle",r:n},x:Math.random()*(t.width-2*n),y:Math.random()*(t.height-2*n),xa:1.5*(2*Math.random()-1),ya:1.5*(2*Math.random()-1),zIndex:60*Math.random(),fill:"rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(Math.random(),")")}))}requestAnimationFrame(function a(){e=requestAnimationFrame(a),t.clear(),t.children.forEach(function(a){var n=a.attr("x")+a.attr("xa"),r=a.attr("y")+a.attr("ya"),e=a.attr("d").r;(n>t.width-2*e-1||n<0)&&a.attr({xa:function(t){return-t}}),(r>t.height-2*e-1||r<0)&&a.attr({ya:function(t){return-t}}),a.attr({x:n,y:r})}),t.draw()})},destroyed:function(){cancelAnimationFrame(e)}},i=n(0),c=Object(i.a)(o,function(){var t=this.$createElement,a=this._self._c||t;return a("div",[a("Container",[a("div",{staticStyle:{width:"100%",height:"500px"},attrs:{id:"container"}})])],1)},[],!1,null,null,null);c.options.__file="c-start.vue";a.default=c.exports}}]);