-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
393 lines (390 loc) · 16.9 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
<!DOCTYPE html>
<html
ng-app="app"
ng-controller="appController"
style="display: none"
>
<head>
<title>TimeFix</title>
<meta charset="UTF-8">
<base href="./" />
<!-- Prevent app resizing and fit it into viewport -->
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<!-- Core CSS -->
<!-- themes are loaded in app.less and are switched via appController.js -->
<link rel="stylesheet/less" type="text/css" href="css/app.less">
<!-- App CSS -->
<link rel="stylesheet/less" type="text/css" href="js/sliderSelectDirective/sliderSelect.less">
<link rel="stylesheet/less" type="text/css" href="js/calendarDirective/calendar.less">
<link rel="stylesheet/less" type="text/css" href="js/animatedToggle/av-toggle.less">
<!-- web app related parameters-->
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
<meta name="apple-mobile-web-app-title" content="FixTime">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="icon" href="svg/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="svg/favicon.ico" type="image/x-icon"/>
<link rel="icon" type="image/png" href="svg/apple-touch-icon.png">
<link rel="apple-touch-icon" href="svg/apple-touch-icon.png">
<!-- core JS -->
<script src="bower_components/less/dist/less.min.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/jquery.transit/jquery.transit.js "></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="bower_components/angular-touch/angular-touch.min.js"></script>
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="bower_components/momentjs/moment.js"></script>
<!-- app JS -->
<script src="js/app.js"></script>
<script src="js/appController.js"></script>
<script src="js/sliderSelectDirective/sliderSelect.js"></script>
<script src="js/calendarDirective/calendar.js"></script>
<script src="js/animatedToggle/av-toggle.js"></script>
<!-- SVG icons lib -->
<ng-include src="'svg/icons.svg'"></ng-include>
</head>
<body>
<div class="root">
<!--
HOME VIEW
-->
<div class="view home av-enabled av-hidden av-noanimation">
<div class="navbar av-enabled av-hidden av-sequence-2 av-bottom-to-top">
<button class="left" ng-click="switchView('sessions')">
<svg><use xlink:href="#svg-navbar-icon-sessions" /></svg>
</button>
<button class="right" ng-click="switchView('settings')">
<svg><use xlink:href="#svg-navbar-icon-settings" /></svg>
</button>
<div class="caption with-buttons">TimeFix</div>
</div>
<div class="balance av-enabled av-hidden av-sequence-2 av-bottom-to-top">
<div class="caption">Current balance</div>
<div class="time">
{{ ( getTimeBalance() - getTimeBalance() % 60 ) / 60 | formatTimeComponents }}<!--
--><span>h</span><!--
-->{{ getTimeBalance() % 60 | formatTimeComponents}}<!--
--><span>m</span>
<!-- <svg class="circle c1"><use xlink:href="#svg-circle" /></svg> -->
<svg class="circle small"><use xlink:href="#svg-circle-small" /></svg>
<svg class="circle big"><use xlink:href="#svg-circle-big" /></svg>
</div>
<div
class="icon hand"
ng-class="{
'negative' : getTimeBalance() < 0
}"
>
<svg><use xlink:href="#svg-home-icon-hand" /></svg>
</div>
</div>
<div class="buttons av-enabled av-hidden av-sequence-3 av-bottom-to-top">
<button
class="ui-button fix"
ng-click="selectedDate = currentDate.clone(); toggleDialog('edit')">Fix</button>
</div>
</div>
<!--
SESSIONS VIEW
-->
<div class="view sessions av-enabled av-hidden av-noanimation">
<button class="ui-button close-view av-enabled av-hidden av-sequence-1 av-bottom-to-top" ng-click="switchView('home')">
<svg><use xlink:href="#svg-navbar-icon-close" /></svg>
</button>
<div class="month-switcher av-enabled av-hidden av-sequence-2 av-bottom-to-top">
<button
class="decrease"
ng-click="previousMonth()"
>
<svg>
<g>
<use xlink:href="#svg-arrow-left" />
</g>
</svg>
</button>
<button
class="increase"
ng-click="nextMonth()"
>
<svg>
<g>
<use xlink:href="#svg-arrow-right" />
</g>
</svg>
</button>
<div
class="month"
ng-click="currentMonth()"
>{{ displayDate.format('MMMM YYYY') }}</div>
</div>
<div style="clear:both"></div>
<calendar
selected="selectedDate"
sessions="sessions"
display="displayDate"
onchange="toggleDialog('edit')"
class="calendar av-enabled av-hidden av-sequence-3 av-bottom-to-top"></calendar>
</div>
<!--
SETTINGS VIEW
-->
<div class="view settings av-enabled av-hidden av-noanimation">
<div class="navbar av-enabled av-hidden av-sequence-2 av-bottom-to-top">
<button class="nav-button right close" ng-click="switchView('home')">
<svg><use xlink:href="#svg-navbar-icon-close" /></svg>
</button>
<div class="caption with-buttons">Settings</div>
</div>
<label class="av-enabled av-hidden av-sequence-2 av-bottom-to-top">Theme</label>
<slider-select
class="av-enabled av-hidden av-sequence-3 av-bottom-to-top"
ng-model="settings.theme"
list-elements="themes"
ng-class="'slider-themes'"
></slider-select>
<label class="av-enabled av-hidden av-sequence-4 av-bottom-to-top">Normal working day</label>
<slider-select
class="av-enabled av-hidden av-sequence-5 av-bottom-to-top"
ng-model="settings.defaultWork"
list-elements="hoursMinutesElements"
list-template="( ( ( element - element % 60 ) / 60 < 10 )? '0' + ( element - element % 60 ) / 60 : ( element - element % 60 ) / 60 ) + '<span>h</span>' + ((element % 60 < 10)?'0'+element % 60:element % 60) + '<span>m</span>'"
ng-class="'slider-hours-minutes'"
></slider-select>
<div class="buttons av-enabled av-hidden av-sequence-6 av-bottom-to-top">
<button
class="ui-button import"
ng-click="toggleDialog('import')"
>Import</button>
<button
class="ui-button export"
ng-click="toggleDialog('export')"
>Export</button>
<button
class="ui-button reset"
ng-click="toggleDialog('reset')"
>Reset</button>
</div>
</div>
<!--
EDIT DIALOG
-->
<div class="view edit overlay dialog av-enabled av-hidden av-zoom">
<button class="ui-button close-dialog" ng-click="toggleDialog('edit')">
<svg><use xlink:href="#svg-navbar-icon-close" /></svg>
</button>
<div class="content">
<div
class="date"
>{{ selectedDate.format("MMMM, D") }}</div>
<div
class="dow"
>{{ selectedDate.format("dddd") }}</div>
<div
class="buttons"
>
<button
class="decrease"
ng-click="previousDay()"
>
<svg>
<g>
<use xlink:href="#svg-arrow-left" />
</g>
</svg>
</button>
<button
class="increase"
ng-click="nextDay()"
>
<svg>
<g>
<use xlink:href="#svg-arrow-right" />
</g>
</svg>
</button>
</div>
<div class="session">
<div
ng-click="editSessionHours = true; editSessionMinutes = false"
ng-class="{ 'active' : editSessionHours }"
>{{ ( hoursElements [ hoursIndex ] - hoursElements [ hoursIndex ] % 60 ) / 60 | formatTimeComponents }}</div><span>h</span><!--
--><div
ng-click="editSessionHours = false; editSessionMinutes = true"
ng-class="{ 'active' : editSessionMinutes }"
>{{ minutesElements [ minutesIndex ] % 60 | formatTimeComponents }}</div><span>m</span>
</div>
<slider-select
ng-model="hoursIndex"
ng-show="editSessionHours"
list-elements="hoursElements"
list-template="( element / 60 < 10 ) ? '0' + element / 60 : element / 60"
ng-class="'slider-hours'"
></slider-select>
<slider-select
ng-model="minutesIndex"
ng-show="editSessionMinutes"
list-elements="minutesElements"
list-template="( element < 10 ) ? '0' + element : element"
ng-class="'slider-minutes'"
></slider-select>
<div
class="compensation"
ng-class="{
'active' : editSession.c,
}"
ng-click="editSession.c = !editSession.c"
>
COMPENSATION
</div>
<div
class="message"
ng-show="hoursElements[ hoursIndex ] > 480"
>
<p>Please be careful with long work sessions.</p>
</div>
</div>
<button class="ui-button confirm-dialog" ng-click="saveCurrentSession(); toggleDialog('edit')">
<svg><use xlink:href="#svg-navbar-icon-ok" /></svg>
</button>
</div>
<!--
IMPORT DIALOG
-->
<div class="view dialog import overlay av-enabled av-hidden av-zoom">
<button
class="ui-button close-dialog"
ng-click="getDataComplete = false; toggleDialog('import')">
<svg><use xlink:href="#svg-navbar-icon-close" /></svg>
</button>
<div class="content">
<div class="icon import">
<svg><use xlink:href="#svg-dialog-icon-import" /></svg>
</div>
<div class="caption">Import</div>
<div class="message">
<p>Paste code to import TimeFixes from another device or browser.</p>
<p>Note, that it will replace all your existing TimeFixes.</p>
</div>
<div>
<input type="text" class="import-link" ng-model="importLink">
</div>
<div
class="message error"
ng-show="importError">
<p>Error while import. Check your code.</p>
</div>
</div>
<button
class="ui-button confirm-dialog"
ng-click="importDataFromLink( importLink )"
ng-hide="getDataInProgress || getDataComplete"
>
<svg><use xlink:href="#svg-navbar-icon-ok" /></svg>
</button>
<button
class="ui-button confirm-dialog spinner"
ng-show="getDataInProgress"
>
<svg><use xlink:href="#svg-spinner" /></svg>
</button>
</div>
<!--
EXPORT DIALOG
-->
<div class="view dialog export overlay av-enabled av-hidden av-zoom">
<button
class="ui-button close-dialog"
ng-click="getLinkComplete = false; toggleDialog('export')"
>
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-navbar-icon-close" />
</g>
</svg>
</button>
<div class="content">
<div class="icon export">
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-dialog-icon-export" />
</g>
</svg>
</div>
<div class="caption">Export</div>
<div class="message">
<p>You can transfer your TimeFixes to another device or browser.</p>
<p ng-hide="getLinkComplete">Press confirm to generate code.</p>
<p ng-show="getLinkComplete">Copy the code to export TimeFixes to another device or browser.</p>
</div>
<div
class="export-link"
ng-show="getLinkComplete"
>
{{ exportLink | formatLink }}
</div>
<div
class="message error"
ng-show="exportError">
<p>Error while export. Try again.</p>
</div>
</div>
<button
class="ui-button confirm-dialog"
ng-click="makeExportLink()"
ng-hide="getLinkInProgress || getLinkComplete"
>
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-navbar-icon-ok" />
</g>
</svg>
</button>
<button
class="ui-button confirm-dialog spinner"
ng-show="getLinkInProgress"
>
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-spinner" />
</g>
</svg>
</button>
</div>
<!--
RESET DIALOG
-->
<div class="view dialog reset overlay av-enabled av-hidden av-zoom">
<button class="ui-button close-dialog" ng-click="toggleDialog('reset')">
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-navbar-icon-close" />
</g>
</svg>
</button>
<div class="content">
<div class="icon reset">
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-dialog-icon-reset" />
</g>
</svg>
</div>
<div class="caption">Reset</div>
<div class="message">
<p>You will lose any saved TimeFixes and settings</p>
<p>Are you sure?</p>
</div>
</div>
<button class="ui-button confirm-dialog" ng-click="resetLocalStorage(); toggleDialog('reset'); switchView('home')">
<svg class="icon-holder">
<g class="icon">
<use xlink:href="#svg-navbar-icon-ok" />
</g>
</svg>
</button>
</div>
</div>
</body>
</html>