-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·130 lines (106 loc) · 4.18 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv-"X-UA-Compatible" content="IE=9"/>
<title>Alarm</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/timepicker.css">
<link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
<script type="text/javascript" src="js/timepicker.min.js"></script>
<script type="text/javascript" src="src/js/locale.js"></script>
<script type="text/javascript" src="src/js/scripts.js"></script>
<script type="text/javascript" src="src/js/clock.js"></script>
<script type="text/javascript" src="src/js/model.js"></script>
<script type="text/javascript" src="src/js/view.js"></script>
<script type="text/javascript" src="src/js/modelview.js"></script>
<script type="text/javascript" src="src/js/alarmer.js"></script>
<script>
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
function setCookie(name, value, options) {
options = options || {};
var expires = options.expires;
if (typeof expires == "number" && expires) {
var d = new Date();
d.setTime(d.getTime() + expires * 1000);
expires = options.expires = d;
}
if (expires && expires.toUTCString) {
options.expires = expires.toUTCString();
}
value = encodeURIComponent(value);
var updatedCookie = name + "=" + value;
for (var propName in options) {
updatedCookie += "; " + propName;
var propValue = options[propName];
if (propValue !== true) {
updatedCookie += "=" + propValue;
}
}
document.cookie = updatedCookie;
}
function deleteCookie(name) {
setCookie(name, "", {
expires: -1
})
}
</script>
<script>
// ONLOAD
$(function(){
localeAlarm();
showClock(getCookie('clockType'));
$('div#tumbler span').on("click",function(){
var $this = $(this);
if ($this.val() === 'digital') {
showClock();
} else if ($this.val() === 'analog') {
showClock('digital');
}
});
model = new Alarm.model();
alarmer = new Alarm.alarmer();
view = new Alarm.view('div#alarm_container');
viewmodel = new Alarm.viewmodel(model,view);
});
</script>
</head>
<body>
<div id="container">
<div id="main">
<div id="tumbler">
<p><span id='analog'></span> <span id="check"></span> <span id='digital'></span></p>
</div>
<div id="analog-border">
<div id="clock-face">
<span id="arrow-hour"></span>
<span id="arrow-minute"></span>
<span id="arrow-second"></span>
</div>
</div>
<div id="digital-border">
<div id="clock-face">
<span id="digital-hour"></span>
<span id="digital-minute"></span>
<span id="digital-second"></span>
</div>
</div>
<div id="notify">
<span id='text'></span>
</div>
</div>
<div id="side">
<div id="alarm_container"></div>
<div id="alarm_add"></div>
</div>
</div>
</body>
</html>