-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathClock.html
More file actions
51 lines (43 loc) · 1.4 KB
/
Clock.html
File metadata and controls
51 lines (43 loc) · 1.4 KB
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
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
$(document).on("ready",start);
function start(){
var screenX = document.body.offsetWidth;
var screenY = document.body.offsetHeight;
var sec = 0;
/*
$("svg").attr("viewBox","0 0 "+screenX+" "+screenY);
$("circle").attr("cx",screenX/2)
.attr("cy",screenY/2)
$("#position g").attr("transform","translate("+screenX/2+","+screenY/2+")");
*/
setInterval(function(){
$("#hour").attr("transform","rotate("+sec*6+")")
sec = sec+1;
},1000)
}
</script>
</head>
<body>
<div id="container" style="width:100%; height:100%">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 460 460" >
<g id="clock" transform="scale(1.5)">
<circle cx="155" cy="155" r="150" stroke="black"
stroke-width="2" fill="red" />
<image xlink:href="./foreca_img/symb-70x70/d000.png" x="120" y="0" width="70" height="70" />
<g id="position" transform="translate(155,155)">
<g id="hour" transform="rotate(0)">
<path id="hours" d="M0,0l-5,-130l5,-10l5,10l-5,130" />
</g>
</g>
</g>
</svg>
</div>
</body>
</html>