forked from morristech/Phonegap_skeleton_android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
289 lines (213 loc) · 13 KB
/
index.html
File metadata and controls
289 lines (213 loc) · 13 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>App Title</title>
<!-- CSS references -->
<link href="css/main.css" rel="stylesheet" /> <!-- Main CSS -->
<link href="css/jquery.mobile.structure-1.3.1.min.css" rel="stylesheet" /> <!-- JQuery Mobile CSS -->
<link href="css/font-awesome.min.css" rel="stylesheet" /> <!-- Font Awesome -->
<!-- Javascript references -->
<script src="js/jquery-1.10.1.min.js"></script> <!-- Jquery -->
<script src="js/jquery.mobile-1.3.1.min.js"></script> <!-- Jquery Mobile -->
<script src="js/jquery.transit.min.js"></script> <!-- Transmit JS (CSS3 Animations) -->
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script> <!-- Phonegap Ref (For API - no actual file) -->
<!-- Javascript -->
<script>
document.addEventListener("deviceready", onDeviceReady, false); //Phonegap check if device ready
function onDeviceReady() {
document.addEventListener("backbutton", onBackKeyDown, false); //Hijack Back button on Android
}
function onBackKeyDown() { //Function for Back button
if($("#side_menu_darken").is(":visible")){ //If the side menu is VISIBLE, close it
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [0.0, 1]}, 500);
$('#side_menu_darken').fadeOut(500);
$('.actionbtn').animate({ marginLeft: '-5px'}, 500);
}else if($("#home").is(":hidden")){ // OR If home is HIDDEN, hide all the other pages and show home
$('#home').show(0);
$('#page1').hide(0);
$('#page2').hide(0);
$('#page3').hide(0);
}else{
navigator.app.exitApp(); //If home is visible, and the menu is closed, exit app
}
}
$(document).ready(function() { //Jquery Check device ready
$('#page1').hide(0); // Hide everything that's visible (that shouldn't be) when app starts
$('#page2').hide(0);
$('#page3').hide(0);
$('#side_menu').transition({ scale: [0.0, 1]}, 5); //Scale the side menu to [0.0, 1] which means width is at a 0 scale and height is still full scale
//TAPS ON TOP AND ICON
$('.action_header').on( 'tap', checkside ); //Action bar tap - open side menu
$('#menubtn').on( 'tap', checkside ); //Action icon tap - open side menu
function checkside(){
if($("#side_menu_darken").is(":visible")){
hidesideMenu();
}else{
showsideMenu();
}
}
// SHOW SIDE MENU
$('#actionbar').on( 'swiperight', showsideMenu ); //Swipe finger on any of these and the
$('.contentwrapper').on( 'swiperight', showsideMenu ); //Side menu will come out
$('.action_header').on( 'swiperight', showsideMenu ); //
function showsideMenu(event){
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [1, 1]}, 500); //Side menu comes out using Transmit.js (Doesn't actually slide out, but the width goes from 0 to full)
$('#side_menu_darken').fadeIn(500); //Dark background appears behind menu to hide actual content
$('.actionbtn').animate({ marginLeft: '-11px'}, 500); //Three lines at the top move over a little
}
//HIDE SIDE MENU
$('#side_menu_darken').on( 'swipeleft', hidesideMenu ); //Swipe (or tap) any of these items and menu goes back in
$('#side_menu_darken').on( 'tap', hidesideMenu );
$('.action_header').on( 'swipeleft', hidesideMenu );
$('#side_menu').on( 'swipeleft', hidesideMenu );
$('#actionbar').on( 'swipeleft', hidesideMenu );
function hidesideMenu(event){
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [0.0, 1]}, 500); //Menu width scales back to 0.
$('#side_menu_darken').fadeOut(500); //Dark background disappears
$('.actionbtn').animate({ marginLeft: '-5px'}, 500); //Three lines move back over
}
//SCHEDULE BUTTONS
$('#page1btn').on( 'tap', showPage1 ); //Hide all the 'pages' except the first
$('#page1btn_side').on( 'tap', showPage1 );
function showPage1( event ) {
$('#home').hide(0);
$('#page3').hide(0);
$('#page2').hide(0);
$('#page1').show(0);
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [0.0, 1]}, 500);
$('#side_menu_darken').fadeOut(400);
$('.actionbtn').animate({ marginLeft: '-5px'}, 500);
}
//ROSTER BUTTONS
$('#page2btn').on( 'tap', showPage2 ); //Hide all the 'pages' except the second
$('#page2btn_side').on( 'tap', showPage2 );
function showPage2( event ) {
$('#home').hide(0);
$('#page2').show(0);
$('#page1').hide(0);
$('#page3').hide(0);
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [0.0, 1]}, 500);
$('#side_menu_darken').fadeOut(500);
$('.actionbtn').animate({ marginLeft: '-5px'}, 500);
}
//INFO BUTTONS
$('#page3btn').on( 'tap', showPage3 ); //Hide all 'pages' except the third
$('#page3btn_side').on( 'tap', showPage3 );
function showPage3( event ) {
$('#home').hide(0);
$('#page3').show(0);
$('#page2').hide(0);
$('#page1').hide(0);
$('#side_menu').css({ transformOrigin: '0px 0px' }).transition({ scale: [0.0, 1]}, 500);
$('#side_menu_darken').fadeOut(500);
$('.actionbtn').animate({ marginLeft: '-5px'}, 500);
}
});
</script>
</head>
<body>
<!-- Action bar -->
<div id="actionbar">
<img src="images/icons/threelines.png" class="actionbtn" id="menubtn"> <!-- Action Button (Three Lines)-->
<div class="action_header">App Title</div><!-- Text on action bar -->
</div>
<!-- Side Menu -->
<div id="side_menu">
<div class="side_menu_header" style="margin-top:54px">Header</div>
<div class="side_menu_item" id="page1btn_side">Page 1</div>
<div class="side_menu_item" id="page2btn_side">Page 2</div>
<div class="side_menu_item" id="page3btn_side">Page 3</div>
</div>
<!-- Dark background when side menu comes out -->
<div id="side_menu_darken"></div>
<!-- Home page -->
<div class="contentwrapper" id="home" style="z-index:100;">
<div id="btnwrapper">
<div class="innerwrapper" style="margin-top:0px;" id="page1btn">
<div class="leftimgbox"><i class="icon-smile"></i></div>
<div class="boxbtntext"> Page One</div>
</div>
<div class="innerwrapper" id="page2btn">
<div class="leftimgbox"><i class="icon-meh"></i></div>
<div class="boxbtntext"> Page Two</div>
</div>
<div class="innerwrapper" id="page3btn">
<div class="leftimgbox"><i class="icon-frown"></i></div>
<div class="boxbtntext"> Page Three</div>
</div>
</div>
</div>
<!-- First Page -->
<div class="contentwrapper" id="page1" style="z-index:0;">
<!-- These are card-like boxes that the content goes in. The firest needs to have a top margin of 64px to clear the action bar-->
<div class="card_box" style="margin-top:64px;">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<!-- Every card after the first doesn't have to have a margin top - it's built in the css-->
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<!-- This box is clickable/tappable (or at least hoverable) by adding class 'clickable' - it doesn't matter that it's a div since we detect tap instead of a link or onclick -->
<div class="card_box clickable">
<div class="card_header">Clickable Card Header</div>
<div class="card_content">If you hover ofer this (desktop testing) or tap on it on a phone, it will change color.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<!-- This little div at the bottom is just to make sure there is a little space between the last card and the bottom (ppstt. it's invisible)-->
<div style="height:26px; width:100%;"></div>
</div>
<!-- Second Page -->
<div class="contentwrapper" id="page2" style="z-index:0;">
<div class="card_box" style="margin-top:64px;">
<div class="card_header">Card Header on Pg 2</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box clickable">
<div class="card_header">Clickable Card Header</div>
<div class="card_content">If you hover ofer this (desktop testing) or tap on it on a phone, it will change color.</div>
</div>
</div>
<!-- Third Page -->
<div class="contentwrapper" id="page3" style="z-index:0;">
<div class="card_box" style="margin-top:64px;">
<div class="card_header">Card Header on Pg 3</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box">
<div class="card_header">Card Header</div>
<div class="card_content">This is the card content. This is where you put stuff that you want in the card.</div>
</div>
<div class="card_box clickable">
<div class="card_header">Clickable Card Header</div>
<div class="card_content">If you hover ofer this (desktop testing) or tap on it on a phone, it will change color.</div>
</div>
<div class="card_box clickable">
<div class="card_header">Clickable Card Header</div>
<div class="card_content">If you hover ofer this (desktop testing) or tap on it on a phone, it will change color.</div>
</div>
</div>
</body>
</html>