-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
281 lines (236 loc) · 9.68 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
<!DOCTYPE html>
<html>
<head>
<title>Time Graph</title>
<link rel='stylesheet' type='text/css' href='css/slate.min.css'>
<script src='js/slate.min.js'></script>
<style>
.title {
padding: 15px 10px;
text-transform: uppercase;
font-family: 'PT Sans', sans-serif;
font-size: 1.2em;
font-weight: 500;
color: #888888;
text-align: center;
}
</style>
</head>
<body>
<h1 class='title'>Weather graph</h1>
<div class='item-container'>
<div class='item-container-header'>Units</div>
<div class='item-container-content'>
<label class='item'>
GPS
<input id='gps' type='checkbox' class='item-toggle' true>
</label>
Your city if no GPS:
<label class='item'>
<div class='item-input-wrapper'>
<input type='text' class='item-input' input id='input_city' placeholder='Input field')>
</div>
</label>
<label class='item'>
UTC time offset
<select input id='select_utc' dir='rtl' class='item-select'>
<option class='item-select-option'>-9</option>
<option class='item-select-option'>-8</option>
<option class='item-select-option'>-7</option>
<option class='item-select-option'>-6</option>
<option class='item-select-option'>-5</option>
<option class='item-select-option'>-4</option>
<option class='item-select-option'>-3</option>
<option class='item-select-option'>-2</option>
<option class='item-select-option'>-1</option>
<option class='item-select-option'>-0</option>
<option class='item-select-option' selected>1</option>
<option class='item-select-option'>2</option>
<option class='item-select-option'>3</option>
<option class='item-select-option'>4</option>
<option class='item-select-option'>5</option>
<option class='item-select-option'>6</option>
<option class='item-select-option'>7</option>
<option class='item-select-option'>8</option>
<option class='item-select-option'>9</option>
<option class='item-select-option'>10</option>
<option class='item-select-option'>11</option>
<option class='item-select-option'>12</option>
</select>
</label>
<div class='item-container-footer'>
You can find this number by visiting <a href='http://www.timeanddate.com/time/map/'>this site</a>
</div>
</div>
</div>
<div class='item-container'>
<div class='item-container-header'>Units</div>
<div class='item-container-content'>
<label class='item'>
Imperial
<input type='radio' class='item-radio' name = 'radio1' input id='radio_units' value='a'>
</label>
<label class='item'>
Metric
<input type='radio' class='item-radio' name= 'radio1' input id='radio_units' value='b' checked>
</label>
</div>
</div>
<div class='item-container'>
<div class='item-container-header'>Others</div>
<div class='item-container-content'>
<label class='item'>
Hourly vibrations
<input type='checkbox' class='item-toggle' input id='toggle_vibration'>
</label>
<div class='item-container-footer'>
Starts at 10am - Ends at 10pm
</div>
<label class='item'>
White icons
<input type='checkbox' class='item-toggle' input id='toggle_bw_icons'>
</label>
<div class='item-container-footer'>
Only applies to Pebble Time.
</div>
</div>
</div>
</div>
<div class='item-container'>
<div class='item-container-header'>Weather update</div>
<div class='item-container-content'>
<label class='item'>
30 mn
<input type='radio' class='item-radio' name = 'radio2' input id='radio_refresh' value='a' >
</label>
<label class='item'>
60 mn
<input type='radio' class='item-radio' name= 'radio2' input id='radio_refresh' value='b' checked>
</label>
</div>
</div>
<div class='colors'>
<div class='item-container-header'>Colors</div>
<div class='item-container-content'>
<div style="display:none;">
<label class='item'>
Hours backgroud color
<input type='text' class='item-color item-color-normal' input id='color_right_back' value='0x000000' display='none'>
</label>
</div>
<label class='item'>
Background color
<input type='text' class='item-color item-color-sunny' input id='color_left_back' value='0x000000'>
</label>
<label class='item'>
Hours color
<input type='text' class='item-color item-color-sunny' input id='color_hours' value='0xFFFFFF'>
</label>
<div style="display:none;">
<label class='item'>
Ruler color
<input type='text' class='item-color item-color-sunny' input id='color_ruler' value='0xFFFFFF'>
</label>
</div>
<label class='item'>
Temperatures color
<input type='text' class='item-color item-color-sunny' input id='color_temperatures' value='0xFFFFFF'>
</label>
</div>
</div>
<div class='item-container'>
<div class='button-container'>
<input id='submit_button' type='button' class='item-button' value='SUBMIT'>
</div>
</div>
</body>
<script>
function getConfigData() {
var gps = document.getElementById('gps');
var input_city = document.getElementById('input_city');
var select_utc = document.getElementById('select_utc');
var radio_units = document.getElementById('radio_units');
var radio_refresh = document.getElementById('radio_refresh');
var toggle_vibration = document.getElementById('toggle_vibration');
var toggle_bw_icons = document.getElementById('toggle_bw_icons');
var color_right_back = document.getElementById('color_right_back');
var color_left_back = document.getElementById('color_left_back');
var color_hours = document.getElementById('color_hours');
var color_ruler = document.getElementById('color_ruler');
var color_temperatures = document.getElementById('color_temperatures');
var options = {
'gps': gps.checked,
'input_city': input_city.value,
'select_utc': select_utc.value,
'radio_units': radio_units.checked,
'radio_refresh': radio_refresh.checked,
'toggle_vibration': toggle_vibration.checked,
'toggle_bw_icons': toggle_bw_icons.checked,
'color_right_back': color_right_back.value,
'color_left_back': color_left_back.value,
'color_hours': color_hours.value,
'color_ruler': color_ruler.value,
'color_temperatures': color_temperatures.value,
};
// Save for next launch
localStorage['gps'] = options['gps'];
localStorage['input_city'] = options['input_city'];
localStorage['select_utc'] = options['select_utc'];
localStorage['radio_units'] = options['radio_units'];
localStorage['radio_refresh'] = options['radio_refresh'];
localStorage['toggle_vibration'] = options['toggle_vibration'];
localStorage['toggle_bw_icons'] = options['toggle_bw_icons'];
localStorage['color_right_back'] = options['color_right_back'];
localStorage['color_left_back'] = options['color_left_back'];
localStorage['color_hours'] = options['color_hours'];
localStorage['color_ruler'] = options['color_ruler'];
localStorage['color_temperatures'] = options['color_temperatures'];
console.log('Got options: ' + JSON.stringify(options));
return options;
}
function getQueryParam(variable, defaultValue) {
var query = location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (pair[0] === variable) {
return decodeURIComponent(pair[1]);
}
}
return defaultValue || false;
}
var submitButton = document.getElementById('submit_button');
submitButton.addEventListener('click', function() {
console.log('Submit');
// Set the return URL depending on the runtime environment
var return_to = getQueryParam('return_to', 'pebblejs://close#');
document.location = return_to + encodeURIComponent(JSON.stringify(getConfigData()));
});
(function() {
var gps = document.getElementById('gps');
var input_city = document.getElementById('input_city');
var select_utc = document.getElementById('select_utc');
var radio_units = document.getElementById('radio_units');
var radio_refresh = document.getElementById('radio_refresh');
var toggle_vibration = document.getElementById('toggle_vibration');
var toggle_bw_icons = document.getElementById('toggle_bw_icons');
var color_right_back = document.getElementById('color_right_back');
var color_left_back = document.getElementById('color_left_back');
var color_hours = document.getElementById('color_hours');
var color_ruler = document.getElementById('color_ruler');
var color_temperatures = document.getElementById('color_temperatures');
gps.checked = JSON.parse(localStorage['gps']);
input_city.value = localStorage['input_city'];
select_utc.value = JSON.parse(localStorage['select_utc']);
radio_units.checked = JSON.parse(localStorage['radio_units']);
radio_refresh.checked = JSON.parse(localStorage['radio_refresh']);
toggle_vibration.checked = JSON.parse(localStorage['toggle_vibration']);
toggle_bw_icons.checked = JSON.parse(localStorage['toggle_bw_icons']);
color_right_back.value = localStorage['color_right_back'];
color_left_back.value = localStorage['color_left_back'];
color_hours.value = localStorage['color_hours'];
color_ruler.value = localStorage['color_ruler'];
color_temperatures.value = localStorage['color_temperatures'];
})();
</script>
</html>