This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
index.html
500 lines (478 loc) · 27.1 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Angular-Clock</title>
<link href='//fonts.googleapis.com/css?family=Syncopate:400,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Rationale' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./dist/angular-clock.css">
<link rel="stylesheet" href="./demo/lib/css/font-awesome.min.css">
<link rel="stylesheet" href="./demo/lib/css/github.css">
<link rel="stylesheet" href="./demo/lib/css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="./demo/app.css" rel="stylesheet">
</head>
<body ng-app="examples" id="top">
<div class="navbar navbar-default navbar-fixed-top">
<div class="container" ng-controller="MenuCtrl">
<div class="navbar-header">
<button type="button" class="navbar-toggle" ng-click="isCollapsed = !isCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs" href="#">Angular Clock</a>
</div>
<nav class="hidden-xs">
<ul class="nav navbar-nav">
<li>
<a href="#top" role="button" class="navbar-brand">
Angular Clock
</a>
</li>
<li><a href="#getting_started">Getting started</a>
</li>
<li><a href="#directives">Directives</a>
</li>
<li><a href="#style">Styling</a>
</li>
</ul>
</nav>
<nav class="collapse" collapse="isCollapsed" style="height: 0px;">
<ul class="nav navbar-nav">
<li><a href="#getting_started" ng-click="isCollapsed = !isCollapsed">Getting started</a>
</li>
<li><a href="#directives" ng-click="isCollapsed = !isCollapsed">Directives</a>
</li>
<li><a href="#style" ng-click="isCollapsed = !isCollapsed">Styling</a>
</li>
</ul>
</nav>
</div>
</div>
<div class="container-fluid">
<div class="text-center aspect-ratio" id="container" ng-controller="HeadCtrl">
<div style="width:200px;margin:0 auto;">
<ds-widget-clock theme="theme" show-digital="digital" show-analog digital-format="'hh:mm:ss a EEEE'"></ds-widget-clock>
<select class="form-control" ng-model="theme" placeholder="Select a theme here">
<option value="blue-light">Blue-Light</option>
<option value="dark">Dark</option>
<option value="light">Light</option>
</select>
<input type="checkbox" ng-model="digital"/> show digital
</div>
<div class="header">
<h1>Angular Clock Widget</h1>
<p>Responsive, beautiful clocks for <a href="http://angularjs.org">AngularJS</a> built using <a href="https://developer.mozilla.org/en/docs/Web/SVG">SVG</a>
</p>
<p>
<a class="btn btn-default btn-lg" href="https://github.com/deepu105/angular-clock"><i class="icon-github"></i>Code on Github</a>
<a class="btn btn-success btn-lg" href="../dist/angular-clock.js.tar.gz" download="angular-clock.js.tar.gz">
<i class="fa fa-download"></i> Download <small id="version">(latest)</small>
</a>
</p>
</div>
</div>
</div>
<div class="container">
<section id="getting_started">
<div class="page-header">
<h1>Getting started</h1>
</div>
<h3>Dependencies</h3>
<p>
This repository contains <strong>native AngularJS directives</strong> to render a clock face. The <strong>only required dependencies</strong> are:
</p>
<ul>
<li><a href="http://angularjs.org" target="_blank">AngularJS</a> (tested with 1.3.14 although it probably works with older versions)</li>
</ul>
<h3>Files to download</h3>
<p>The easiest is to download with <strong>bower</strong>:</p>
<pre>bower install angular-ui-clock --save </pre>
<p>Alternatively files can be downloaded <a href="https://github.com/deepu105/angular-clock">downloaded from Github</a>.
</p>
<p>Whichever method you choose the good news is that the overall size is very small: <4kb for all directives (~1kb with gzip compression!)</p>
<h3>Installation</h3>
<pre><code><script src="bower_components/dist/angular-clock.js"></script></code></pre>
<p>As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the <code>ds.clock</code> <a href="http://docs.angularjs.org/guide/module">module</a>:
<br>
</p><pre><code>angular.module('myModule', ['ds.clock']);</code></pre>
<p></p>
<h3>CSS</h3>
<p>You need to include a link to the css file in your page.</p>
<pre><code><link rel="stylesheet" href="bower_components/dist/angular-clock.css"></code></pre>
<p>If you need the default digital clock font <code>Syncopate</code>, include this. Else check styling section to use your own font</p>
<pre><code><link href="//fonts.googleapis.com/css?family=Syncopate:400,700" rel="stylesheet" type="text/css"></code></pre>
<h3>Options</h3>
<p>There are several options that you can set as attributes on the directive element(can use other angular flavors like data-*, ng-attr-*, x-* also)</p>
<ol class="chart-legend">
<li><code>start-time</code> : init clock with specific time in milliseconds, (default: <code>undefined</code>)</li>
<li><code>digital-format</code> : digital clock format in <a href="https://docs.angularjs.org/api/ng/filter/date">angular date filter format</a> (default: <code>'HH-mm-ss'</code>). Pass as string enclosed in single quote or bound to a scope variable</li>
<li><code>gmt-offset</code> : shows time for the given <a href="http://en.wikipedia.org/wiki/List_of_UTC_time_offsets">GMT offset</a> in clock, (default: <code>false</code>, shows local time) example: India -> 5.30, Singapore -> 8 , venezula -> -4.30, Nepal -> 5.45</li>
<li><code>show-digital</code>: shows digital clock, (default: <code>true</code> if both show-analog &show-digital are not set)</li>
<li><code>show-analog</code> : shows analog clock, (default: <code>true</code> if both show-analog &show-digital are not set)</li>
<li><code>show-gmt-info</code> : shows GMT offset value, (default: <code>false</code>) shows only if gmt-offset attribute is set</li>
<li><code>theme</code> : analog clockface theme, (default: <code>light</code>)</li>
</ol>
<p>All clocks are responsive and reactive and will update automatically when data changes. <code>start-time</code>, <code>digital-format</code>,
and <code>gmt-offset</code> are bound attributes and hence need to be set in the scope or using <code>gmt-offset="'5.3'"</code> format with extra single quotes.</p>
<p><code>show-digital</code>, <code>show-analog</code> and <code>theme</code> can be used as bound attributes or as normal attributes</p>
</section>
<section id="directives">
<div class="page-header">
<h1>Directives</h1>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Default Clock</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml"><ds-widget-clock></ds-widget-clock></code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Clock with Start Time</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock start-time="startTimeValue"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code ng-non-bindable
data-language="xml"><ds-widget-clock start-time="startTimeValue"></ds-widget-clock></code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
$scope.startTimeValue = 1430990693334;
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Clock with Timezone Offset</div>
<div class="panel-body text-center">
<div>
<label>GMT Offset <small>In HH.MM format</small>
</label>
<select class="form-control" ng-model="gmtValue" placeholder="Select GMT offset value here">
<option value="-12.00">−12.00</option>
<option value="-11.00">−11.00</option>
<option value="-10.00">−10.00</option>
<option value="-9.30">−09.30</option>
<option value="-9">−09.00</option>
<option value="-8">−08.00</option>
<option value="-7">−07.00</option>
<option value="-6">−06.00</option>
<option value="-5">−05.00</option>
<option value="-4.3">−04.30</option>
<option value="-4">−04.00</option>
<option value="-3.3">−03.30</option>
<option value="-3">−03.00</option>
<option value="-2">−02.00</option>
<option value='-1'>−01.00</option>
<option value="0">GMT (00.00)</option>
<option value="1">+01.00</option>
<option value="2">+02.00</option>
<option value="3">+03.00</option>
<option value="3.30">+03.30</option>
<option value="4">+04.00</option>
<option value="4.30">+04.30</option>
<option value="5">+05.00</option>
<option value="5.30">+05.30</option>
<option value="5.45">+05.45</option>
<option value="6.00">+06.00</option>
<option value="6.30">+06.30</option>
<option value="7">+07.00</option>
<option value="8">+08.00</option>
<option value="8.45">+08.45</option>
<option value="9">+09.00</option>
<option value="9.30">+09.30</option>
<option value="10">+10.00</option>
<option value="10.30">+10.30</option>
<option value="11">+11.00</option>
<option value="11.30">+11.30</option>
<option value="12">+12.00</option>
<option value="12.45">+12.45</option>
<option value="13">+13.00</option>
<option value="14">+14.00</option>
</select>
</div>
<div class="">
<ds-widget-clock gmt-offset="gmtValue" show-gmt-info></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml"><ds-widget-clock gmt-offset="gmtValue" show-gmt-info></ds-widget-clock></code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
$scope.gmtValue = 5.3;
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Clock with AM/PM in Dark theme</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock theme="dark" digital-format="'hh:mm:ss a'"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml"><ds-widget-clock theme="dark" digital-format="'hh:mm:ss a'"></ds-widget-clock></code></pre>
or
<pre><code data-language="xml"><ds-widget-clock theme="theme" digital-format="'hh:mm:ss a'"></ds-widget-clock></code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
$scope.theme = 'dark';
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Digital clocks</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock ng-attr-show-digital digital-format="'HH:mm'"></ds-widget-clock>
<hr>
<ds-widget-clock data-show-digital></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'hh:mm:ss a'"></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'hh:mm:ss a'" gmt-offset="5.3" show-gmt-info></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="format"></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'EEEE MMMM d,yyyy hh:mm:ss a Z'"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml">
<ds-widget-clock data-show-digital digital-format="'HH:mm'"></ds-widget-clock>
<hr>
<ds-widget-clock data-show-digital></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'hh:mm:ss a'">></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'hh:mm:ss a'"> gmt-offset="5.3" show-gmt-info></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="format">></ds-widget-clock>
<hr>
<ds-widget-clock show-digital digital-format="'EEEE MMMM d,yyyy hh:mm:ss a Z'">></ds-widget-clock>
</code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
$scope.format = 'dd-MMM-yyyy hh:mm:ss a';
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12" id="line-chart" ng-controller="BaseCtrl">
<div class="panel panel-default">
<div class="panel-heading">Analog clock</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock show-analog theme="dark"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml"><ds-widget-clock show-analog></ds-widget-clock></code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
});
</code></pre>
</tab>
</tabset>
</div>
</div>
</section>
<section id="style">
<div class="page-header">
<h1>Styling</h1>
<p>All clock styles can be overridden using CSS, additional themes can be easily defined and applied using the theme attribute. Inspect the generated html for more advance css styling</p>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Custom Analog Clock Theme</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock show-analog theme="blue-light"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml">
<!-- Theme blue-light is defined is css -->
<ds-widget-clock show-analog theme="blue-light"></ds-widget-clock></code></pre>
</tab>
<tab heading="CSS">
<pre><code data-language="css">
.widget-clock.blue-light .clock-face {
stroke: #153b6f;
fill: #0e2434;
}
.widget-clock.blue-light .minor {
stroke: #0089ff;
stroke-width: 0.5;
}
.widget-clock.blue-light .major {
stroke: rgba(119, 176, 242, 0.97);
stroke-width: 0.5;
}
.widget-clock.blue-light .hour {
stroke: rgba(119, 176, 242, 0.97);
stroke-width: 1;
}
.widget-clock.blue-light .minute {
stroke: #0089ff;
stroke-width: 0.75;
}
.widget-clock.blue-light .second,
.widget-clock.blue-light .second-counterweight {
stroke: rgb(234, 31, 54);
stroke-width: 0.5;
}
.widget-clock.blue-light .second-counterweight {
stroke-width: 1.5;
}
</code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
});
</code></pre>
</tab>
</tabset>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Custom Digital Clock Theme</div>
<div class="panel-body text-center">
<div class="">
<ds-widget-clock show-digital theme="blue-light" digital-format="'hh:mm:ss a'"></ds-widget-clock>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 code">
<tabset>
<tab heading="Markup">
<pre><code data-language="xml">
<!-- Theme blue-light is defined is css -->
<ds-widget-clock show-digital theme="blue-light" digital-format="'hh:mm:ss a'"></ds-widget-clock></code></pre>
</tab>
<tab heading="CSS">
<pre><code data-language="css">
@import url('http://fonts.googleapis.com/css?family=Rationale');
/* this import should be first line in css file else add as <link> in html*/
.widget-clock.blue-light .digital {
text-align: center;
}
.widget-clock.blue-light .time {
font-family: 'Rationale', sans-serif;
font-size: 3.0em;
color: #1da4eb;
}
</code></pre>
</tab>
<tab heading="Javascript">
<pre><code data-language="javascript">angular.module("app", ["ds.clock"]).controller("AppCtrl", function ($scope) {
});
</code></pre>
</tab>
</tabset>
</div>
</div>
</section>
</div>
<footer class="footer">
<div class="container">
<p>Designed and built by <a href="https://github.com/jtblin" target="_blank">Deepu K Sasidharan</a>
</p>
<p>Code licensed under <a href="http://opensource.org/licenses/MIT">MIT License</a>.</p>
<p><a href="https://github.com/deepu105/angular-clock/issues?state=open">Issues</a>
</p>
<a class="btn btn-default btn-lg" href="https://github.com/deepu105/angular-clock"><i class="icon-github"></i>Code on Github</a>
</div>
</footer>
<script src="./demo/lib/js/angular.min.js"></script>
<script src="./demo/lib/js/ui-bootstrap-tpls.min.js"></script>
<script src="./demo/lib/js/rainbow.min.js"></script>
<script src="./demo/lib/js/generic.js"></script>
<script src="./demo/lib/js/html.js"></script>
<script src="./demo/lib/js/javascript.js"></script>
<script src="./angular-clock.js"></script>
<script src="./demo/lib/js/smoothscroll.min.js"></script>
<script src="./demo/app.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-74370272-2', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>