-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
134 lines (127 loc) · 7.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Grid.js by enterprisebug</title>
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<link rel="stylesheet" type="text/css" href="assets/fd-slider/fd-slider.css?v=2">
<link rel="stylesheet" type="text/css" href="assets/fd-slider/fd-slider-tooltip.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script type="text/javascript" src="js/angularjs/1.4.5/angular.min.js"></script>
<script type="text/javascript" src="js/controller.js"></script>
<script type="text/javascript" src="assets/fd-slider/fd-slider.js"></script>
<script type="text/javascript" src="assets/jscolor/jscolor.js"></script>
<script type="text/javascript" src="dist/grid.js"></script>
</head>
<body ng-app="gridjsSampleApp">
<div ng-controller="gridjsSampleController">
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/enterprisebug/grid.js">View on GitHub</a>
<h1 id="project_title">Grid.js</h1>
<h2 id="project_tagline">Will draw a nice grid on a HTML5 canvas element</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/enterprisebug/grid.js/blob/gh-pages/dist/grid.min.js">grid.min.js</a>
<a class="tar_download_link" href="https://github.com/enterprisebug/grid.js/blob/gh-pages/dist/grid.js">grid.js</a>
</section>
</header>
</div>
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h2>Demo / Configuration</h2>
<div id="demo_left">
<canvas id="myCanvas" width="340" height="200"></canvas>
</div>
<div id="demo_right">
<form id="opts">
<div>
<label>Distance:</label>
<input type="text" ng-model="config.distance" ng-change="updateSample(config)" min="5" max="100" step="1" />
</div>
<div>
<label>LineWidth:</label>
<input type="text" ng-model="config.lineWidth" ng-change="updateSample(config)" min="0" max="5" step="0.1" />
</div>
<div>
<label>Caption:</label>
<input type="checkbox" ng-model="config.caption" ng-change="updateSample(config)" />
</div>
<div>
<label>GridColor:</label>
<input type="text" ng-model="config.gridColor" ng-change="updateSample(config)" class="color" />
</div>
<div>
<label>Horizontal Line:</label>
<input type="checkbox" ng-model="config.horizontalLines" ng-change="updateSample(config)" />
</div>
<div>
<label>Vertical Line:</label>
<input type="checkbox" ng-model="config.verticalLines" ng-change="updateSample(config)" />
</div>
</form>
</div>
<div style="clear:both;"></div>
<h2>Usage</h2>
<p>Assume that we have a HTML5 canvas element:</p>
<div class="highlight"><pre><span class="nt"><canvas</span> <span class="na">id=</span><span class="s">"myCanvas"</span> <span class="na">width=</span><span class="s">"350"</span> <span class="na">height=</span><span class="s">"200"</span><span class="nt">></canvas></span></pre></div>
<p>Use grid like this:</p>
<div class="highlight">
<pre>
<span class="kd">var</span> <span class="nx">canvas</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">"myCanvas"</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">context</span> <span class="o">=</span> <span class="nx">canvas</span><span class="p">.</span><span class="nx">getContext</span><span class="p">(</span><span class="s2">"2d"</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">opts</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">distance</span> <span class="o">:</span> <span class="mi"><span>{{config.distance}}</span></span><span class="p">,</span>
<span class="nx">lineWidth</span> <span class="o">:</span> <span class="mf"><span>{{config.lineWidth}}</span></span><span class="p">,</span>
<span class="nx">gridColor</span> <span class="o">:</span> <span class="s2">"<span>{{config.gridColor}}</span>"</span><span class="p">,</span>
<span class="nx">caption</span> <span class="o">:</span> <span class="kc"><span>{{config.caption}}</span></span><span class="p">,</span>
<span class="nx">horizontalLines</span> <span class="o">:</span> <span class="kc"><span>{{config.horizontalLines}}</span></span><span class="p">,</span>
<span class="nx">verticalLines</span> <span class="o">:</span> <span class="kc"><span>{{config.verticalLines}}</span></span>
<span class="p">};</span>
<span class="k">new</span> <span class="nx">Grid</span><span class="p">(</span><span class="nx">opts</span><span class="p">).</span><span class="nx">draw</span><span class="p">(</span><span class="nx">context</span><span class="p">);</span>
</pre>
</div>
<h2>Support or Contact</h2>
<p>
<img src="https://pbs.twimg.com/profile_images/745199995/daniel_profile_bigger.jpg" alt="Daniel Sirz" valign="top" align="left" id="twitter_image" />
If you encounter any problems, please use the <a href="https://github.com/enterprisebug/grid.js/issues">GitHub issue tracker</a>.<br />
For updates <a href="http://twitter.com/danielsirz">follow me on Twitter</a>.<br />
If you like <a href="https://github.com/enterprisebug/grid.js">grid.js</a>, let me know.<br /><br />
</p>
<h2>Changes</h2>
<h3>Version 1.2 (2015-09-08)</h3>
<ul>
<li>show horizonzal line switch</li>
<li>show vertical line switch</li>
</ul>
<h3>Version 1.1 (2012-08-20)</h3>
<ul>
<li>Added Caption</li>
<li>Added gridColor</li>
</ul>
<h3>Version 1.0 (2012-08-14)</h3>
<ul>
<li>Initial Realease</li>
</ul>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">Grid.js maintained by <a href="https://github.com/enterprisebug">enterprisebug</a></p>
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-34207705-1");
pageTracker._trackPageview();
} catch (err) { }
</script>
</body>
</html>