Sketchy/js/main.js
Mahdi Dibaiee e7d1c2399f major
2014-02-04 18:32:41 +03:30

29 lines
582 B
JavaScript

"use strict";
yepnope({
test: window.mobile,
yep : 'js/mobile-events.js',
nope: 'js/events.js'
})
$(document).ready(function() {
window.c = $('canvas')[0].getContext('2d');
window.o = $('canvas')[1].getContext('2d');
window.settings = {
lineWidth : 0.2,
strokeStyle : 'black',
type: 'sketch',
lineCap: 'round',
lineJoin: 'round',
furLength: 5
};
window.points = [];
window.$c = $('canvas');
window.points.history = [{ data: c.createImageData($c.width(), $c.height()), points: []}];
sizeAndPos();
$(window).resize(sizeAndPos);
})