Skip to content

Hearts

Download (cdnjs)
// Import jQuery and core jCanvas library first
import $ from 'jquery';
import 'jcanvas';
// UMD import
import 'jcanvas/dist/umd/jcanvas-hearts.min.js';
// ESM import
import 'jcanvas/dist/esm/jcanvas-hearts.min.js';

This plugin is a more complete version of the custom drawHeart() method in the documentation, which supports layer events and transformations.

$('canvas').drawHeart({
layer: true,
draggable: true,
name: 'heart',
fillStyle: '#f6c',
x: 160,
y: 100,
size: 140,
rotate: 30
});