Skip to content

Instantly share code, notes, and snippets.

@ChangJoo-Park
Forked from acidsound/fabricjs.html
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChangJoo-Park/fb266f1d24c97352046c to your computer and use it in GitHub Desktop.
Save ChangJoo-Park/fb266f1d24c97352046c to your computer and use it in GitHub Desktop.
<head>
<title>fabricjs</title>
<script src="fabric.js"></script>
</head>
<body>
<h1>Fabric</h1>
{{> main}}
</body>
<template name="main">
<canvas id="c" width="800" height="350"></canvas>
</template>
Meteor.startup(function() {
window.canvas = new fabric.Canvas('c');
});
Template.main.rendered = function() {
var circle = new fabric.Circle({
left: 100,
top: 100,
radius: 50
});
circle.setGradient('fill', {
x1: 0,
y1: 0,
x2: 0,
y2: circle.height,
colorStops: {
0: '#000',
1: '#fff'
}
});
canvas.add(circle);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment