Skip to content

Instantly share code, notes, and snippets.

@acidsound
Created December 7, 2014 22:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save acidsound/1a91d559cf580d6689b4 to your computer and use it in GitHub Desktop.
Save acidsound/1a91d559cf580d6689b4 to your computer and use it in GitHub Desktop.
fabricjs on meteor
<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);
};
@acidsound
Copy link
Author

fabric.js 파일은 public 아래에

@ChangJoo-Park
Copy link

감사합니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment