This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: https://bl.ocks.org/davelandry/a39f0c3fc52804ee859a | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<script src="//d3plus.org/js/d3.js"></script> | |
<script src="//d3plus.org/js/d3plus.js"></script> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/20032214/recreate-fabric-js-canvas-and-export-as-an-image | |
function download(url,name){ | |
// make the link. set the href and download. emulate dom click | |
$('<a>').attr({href:url,download:name})[0].click(); | |
} | |
function downloadFabric(canvas,name){ | |
// convert the canvas to a data url and download it. | |
download(canvas.toDataURL(),name+'.png'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="c" width="400" height="200"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#c{ | |
border:1px solid red; | |
top:22px; | |
left:0px; | |
height: 100%; | |
width: 99%; | |
} | |
.box { | |
float: left; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: http://jsfiddle.net/beewayne/z0qn35Lo/ | |
HTMl | |
____ | |
<canvas id="paper" width="400" height="400" style="border:1px solid #ccc"></canvas> | |
<button id="select">Selection mode</button> | |
<button id="draw">Drawing mode</button> | |
<button id="delete">Delete selected object(s)</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: http://stackoverflow.com/questions/33831088/fabric-canvas-make-my-1st-object-always-unselectable?rq=1 | |
//lowest object unselectable | |
var objectx = canvas.getObjects(); | |
objectx[0].selectable = false; | |
//highest object unselectable | |
var objectx = canvas.getObjects(); | |
objectx[objectx.length - 1].selectable = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: | |
HTML | |
_____ | |
<canvas id="c" width="300" height="300"></canvas> | |
CSS | |
_____ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: http://stackoverflow.com/questions/32395416/fabric-canvas-font-style-change-after-added | |
HTML | |
_____ | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.5.0/fabric.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<label>Select Font:</label> | |
<select name="FontStyleNumber" id="FontStyleNumber"> | |
<option value="Times New Roman">Times New Roman</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: http://stackoverflow.com/questions/30904999/grouping-and-ungrouping-fabric-js-objects | |
var canvas = new fabric.Canvas('paper',{ | |
isDrawingMode: true | |
}); | |
$("#select").click(function(){ | |
canvas.isDrawingMode = false; | |
}); | |
$("#draw").click(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/browser-invoke-lambda-function-full.html | |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Emoji Slots</title> | |
<link href="emojislots.css" rel="stylesheet" type="text/css"> | |
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.20.min.js"></script> |