42 |
Lines.js Demo
43 |
44 | This page demonstrates default usage of lines.js For more information visit home of lines.js.
45 |
46 |
47 |
48 |
49 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/lines.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Lines.js
3 | * http://dbtek.github.io/lines
4 | *
5 | * Copyright (c) 2014, Ismail Demirbilek
6 | * Published under MIT License
7 | * http://opensource.org/licenses/MIT
8 | */
9 |
10 | function lines(options){
11 | // Set default options
12 | this.setDefaults();
13 |
14 | // Check options param and override properties if they are not null
15 | if(typeof(options) != 'undefined'){
16 | if('canvas' in options)
17 | this.setCanvas(options.canvas);
18 | if('pieces' in options)
19 | this.setPieces(options.pieces);
20 | if('color' in options)
21 | this.setColor(options.color);
22 | }
23 |
24 | return this;
25 | }
26 |
27 | /**
28 | * Default properties
29 | */
30 | lines.prototype.defaults = {
31 | canvas: 'lines-canvas',
32 | pieces: 5,
33 | color: '#EEE'
34 | };
35 |
36 | /**
37 | * setCanvas() sets canvas id which will contain lines
38 | *
39 | * @param