-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
245 lines (198 loc) · 10.3 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Magic Framework Demo</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1">
<script type="text/javascript" src="WebKitDetect.js"></script>
<script type="text/javascript" src="magic_framework.js"></script>
<script type="text/javascript" src="magic_prefs.js"></script>
<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<link type="text/css" rel="stylesheet" href="magic.css" />
<style type="text/css">
.active_list_item, .list_item:active{
background-image: url( 'selection.png' );
background-repeat: repeat-x;
background-color: #194fdb !important;
}
</style>
<script type="text/javascript">
var Interface;
var Prefs;
function ButtonizeMainMenu(){
if( Prefs.GetPref( 'toggle_test' ) ){
document.getElementById( 'toggle_test_onoff' ).className = 'on_off_control on';
}else{
document.getElementById( 'toggle_test_onoff' ).className = 'on_off_control off';
}
Interface.MakeMagicButton( 'list_item_quickstart', function(){ Interface.GoForward( 'help_quickstart', 'Quick Start' ); } );
Interface.MakeMagicButton( 'list_item_about', function(){ Interface.GoForward( 'help_about', 'About' ); } );
Interface.MakeMagicButton( 'list_item_howitworks', function(){ Interface.GoForward( 'help_works', 'How It Works' ); } );
Interface.MakeMagicButton( 'list_item_phonegap', function(){ Interface.GoForward( 'help_phonegap', 'PhoneGap' ); } );
Interface.MakeMagicButton( 'list_item_credits', function(){ Interface.GoForward( 'help_credits', 'Credits' ); } );
Interface.MakeMagicButton( 'toggle_test_onoff', function(){ var new_val = Interface.toggleOnOffControl( 'toggle_test_onoff' ); Prefs.SavePref( 'toggle_test', new_val ); } );
document.getElementById( 'version' ).innerHTML = 'Magic Framework ' + Interface.version + '</div>';
}
function init(){
Interface = new MagicFramework( );
Interface.Init();
Interface.GoForward( 'help', 'Main Menu' );
setTimeout( function(){ Interface.HideSplash(); }, 300 );
Prefs = new MagicPrefs( 'demo_2', function(){
var views = Prefs.GetPref( 'views' );
if( !views ){
Prefs.SavePref( 'views', 1 );
}else{
Prefs.SavePref( 'views', ++views );
}
document.getElementById( 'views' ).innerHTML = 'This demo has been viewed by you ' + views + ' times';
ButtonizeMainMenu();
} );
Interface.after_transition = function( newView ){
if( newView.id == 'help' ){
ButtonizeMainMenu();
}
}
//Editing the help_content div after here seems to break the list functions. This is a known issue
//that is being worked on. You can always call the MagicListItem function manually to get any element
//setup the way it needs to be setup.
}
</script>
</head>
<!--
/**
* For use with MagicFramework
* http://www.jeffmcfadden.com/magicframework
* This work by Jeff McFadden is licensed under a Creative Commons Attribution 3.0 United States License.
*
*/
-->
<body style="width: 320px; height: 460px;" onLoad="init();">
<div id="browser">
<div id="splash">
</div>
<div id="header">
<div class="back_button" id="back_button">
Back
</div>
<div class="header_title" id="current_title">
</div>
</div>
<div id="viewport">
<div class="view" id="help">
<div class="view_content" id="help_content">
<ul class="list" id="settings_list">
<li id="list_item_quickstart">
<div class="list_label">
Quick Start
</div>
<div class="list_value">
<img class="list_arrow" src="list_arrow.png" />
</div>
</li>
<li id="list_item_about">
<div class="list_label">
About
</div>
<div class="list_value">
<img class="list_arrow" src="list_arrow.png" />
</div>
</li>
<li id="list_item_howitworks">
<div class="list_label">
How it Works
</div>
<div class="list_value">
<img class="list_arrow" src="list_arrow.png" />
</div>
</li>
<li id="list_item_phonegap">
<div class="list_label">
PhoneGap
</div>
<div class="list_value">
<img class="list_arrow" src="list_arrow.png" />
</div>
</li>
<li id="list_item_credits">
<div class="list_label">
Credits
</div>
<div class="list_value">
<img class="list_arrow" src="list_arrow.png" />
</div>
</li>
</ul>
<ul class="list">
<li id="list_toggle">
<div class="list_label">
Toggle
</div>
<div class="list_value">
<div id="toggle_test_onoff" class="on_off_control off"> </div>
</div>
</li>
</ul>
<div class="list_section_note" id="views" style="margin-top: 20px;margin-bottom:20px"></div>
<div class="list_section_note" id="version"></div>
</div>
</div>
<div class="view" id="help_quickstart">
<div class="view_content help_content" id="help_quickstart_content">
<h2>Quick Start</h2>
<ol>
<li>Take a look at the index.html file</li>
<li>Modify the lists/views to suit your needs</li>
<li>Load up the page in Safari and see how it works for you.</li>
</ol>
</div>
</div>
<div class="view" id="help_about">
<div class="view_content help_content" id="help_about_content">
<h2>About Magic Framework</h2>
<p>Magic Framework is a native iPhone UI imitator built in html/css/javascript. It's useful for online websites or on-device Webkit-based applications looking to imitate the native iPhone UI without having to write native code.
</p>
</div>
</div>
<div class="view" id="help_works">
<div class="view_content help_content" id="help_works_content">
<h2>How It Works</h2>
<p>
Magic Framework is built in javascript, html, and css. <a href="#" onClick="Interface.GoForward( 'help_css3', 'CSS3' );">CSS3 transitions</a> are used to build the transitions between pages, and images and other css styles are used to build the interface to have a native iphone look & feel.
</p>
</div>
</div>
<div class="view" id="help_css3">
<div class="view_content help_content" id="help_css3_content">
<h2>CSS3 Transitions</h2>
<p>
CSS3 Transitions are a new feature to webkit, especially mobile safari. Magic Framework makes use of some of the following:</p>
<ul>
<li>-webkit-border-*-*-radius</li>
<li>-webkit-transition-property</li>
<li>-webkit-transition-duration</li>
<li>-webkit-transition-timing-function</li>
</ul>
</div>
</div>
<div class="view" id="help_phonegap">
<div class="view_content help_content" id="help_phonegap_content">
<h2>PhoneGap</h2>
<p><a href="http://www.phonegap.com">PhoneGap</a> is a development tool that allows web developers to take advantage of the core features in the iPhone, Android, and Blackberry SDK using JavaScript.</p>
<p>Magic Framework is a great fit for developers using PhoneGap or similar projects to build native iPhone apps ontop of web technologies.</p>
</div>
</div>
<div class="view" id="help_credits">
<div class="view_content help_content" id="help_credits_content">
<h2>Credits</h2>
<p>Magic Framework was build by Jeff McFadden and is used in his iPhone game, <a href="http://www.insidetraderapp.com">Inside Trader</a>.</p>
</div>
</div>
</div>
<div id="event_prevention"></div>
</div>
</body>
</html>