-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.html
72 lines (63 loc) · 2 KB
/
test.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
<html>
<head>
<title>Clock js performance demo</title>
<meta name="description" content="A test with 200 clocks demonstrating the performance of Clock JS">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.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-52254492-1', 'michalpaszkiewicz.co.uk');
ga('send', 'pageview');
</script>
</head>
<body ng-app="app" ng-controller="clockControl">
<h1>200 clocks</h1>
<div class="small-clock" ng-repeat="clock in clocks">
<canvas id="{{clock.name}}"></canvas>
</div>
<style>
h1{
text-align: center;
}
.small-clock{
height: 100%;
width: 100%;
max-height: 100px;
max-width: 100px;
display:inline-block;
}
</style>
<script src="http://www.michalpaszkiewicz.co.uk/clockjs/clock.js"></script>
<script>
var clockModule = angular.module('app', []).
controller("clockControl", function clockControl($scope){
$scope.swatch = new clockMaker();
$scope.clocks = [];
for(var i = 0; i < 200; i++){
$scope.clocks.push({name:"c"+i});
}
var options = {
colour: "black",
rimColour:"black",
rim: 1,
markerType: "number",
addMinutes: 0,
addSeconds: 0,
markerSize: 2,
markerDistance: 43
}
setTimeout(function(){
for(var i = 0; i < $scope.clocks.length; i++){
$scope.swatch.addClock($scope.clocks[i].name, options);
options.addMinutes+=Math.abs(Math.random()*60);
options.addSeconds+=Math.abs(Math.random()*60);
}
$scope.swatch.start();
}, 100);
});
</script>
</body>
</html>