jcanvas
Version:
jCanvas brings jQuery's powerful syntax and capability to the HTML5 canvas. Quickly create canvas-based apps that can utilize layers, animations, events, and much more. jCanvas works on all modern browsers and platforms, including iOS and Android.
3 lines (2 loc) • 641 B
JavaScript
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.$))})(this,function(e){"use strict";const t=Math.PI;e.jCanvas.extend({name:"drawHeart",type:"heart",props:{size:0},fn:function(s,n){const a=this,i=n.size,f=.75,o=i*f,r=t*(f*(1-f));e.jCanvas.transformShape(a,s,n,i,o);const c=n.x,d=n.y+i/8;s.beginPath(),s.moveTo(c,d+o/2),s.arc(c+i/4,d-o/2,i/4,r,t,!0),s.arc(c-i/4,d-o/2,i/4,0,t-r,!0),n.closed=!0,e.jCanvas.detectEvents(a,s,n),e.jCanvas.closePath(a,s,n)}})});
//# sourceMappingURL=jcanvas-hearts.min.js.map