Sketchy/js/main.js

29 lines
582 B
JavaScript
Raw Normal View History

2014-02-01 18:18:29 +00:00
"use strict";
2014-02-04 15:02:41 +00:00
yepnope({
test: window.mobile,
yep : 'js/mobile-events.js',
nope: 'js/events.js'
})
2014-02-01 18:18:29 +00:00
$(document).ready(function() {
2014-02-02 20:16:28 +00:00
window.c = $('canvas')[0].getContext('2d');
window.o = $('canvas')[1].getContext('2d');
2014-02-01 18:18:29 +00:00
window.settings = {
2014-02-02 10:07:46 +00:00
lineWidth : 0.2,
2014-02-01 18:18:29 +00:00
strokeStyle : 'black',
type: 'sketch',
lineCap: 'round',
2014-02-02 20:16:28 +00:00
lineJoin: 'round',
2014-02-04 15:02:41 +00:00
furLength: 5
2014-02-01 18:18:29 +00:00
};
window.points = [];
window.$c = $('canvas');
2014-02-02 20:16:28 +00:00
window.points.history = [{ data: c.createImageData($c.width(), $c.height()), points: []}];
2014-02-01 18:18:29 +00:00
sizeAndPos();
$(window).resize(sizeAndPos);
})