-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.html
More file actions
406 lines (378 loc) · 15.2 KB
/
Copy pathindex.html
File metadata and controls
406 lines (378 loc) · 15.2 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
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
394
395
396
397
398
399
400
401
402
403
404
405
406
<!DOCTYPE html>
<html>
<head>
<title>MetroUI 2.1 Technical Preview 2</title>
<link rel="stylesheet" href="build/css/MetroUI-2.1.css"></link>
<link rel="stylesheet" href="build/css/MetroUI.Win10.css"></link>
<link rel="stylesheet" href="build/css/fonts.css"></link>
<link rel="stylesheet" href="build/css/fonts-wp.css"></link>
<link rel="stylesheet" href="build/css/swiper.min.css"></link>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="MetroUI">
<script src="build/js/MetroUI-2.1.js"></script>
<script src="build/js/MetroUI.Win10.js"></script>
<script src="build/js/swiper.min.js"></script>
<style>
body {
-webkit-perspective: 200px;
/* background-image: -webkit-linear-gradient(#021952 0%, #005fb7 100%); */
background-image: url(img/El%20Capitan.jpg);
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}
div.tiles-preview:before {
background-image: url(img/El%20Capitan.jpg) !important;
background-size: cover !important;
}
footer div:before, p.label {
-webkit-transform: translate3d(0, 0, 0)
}
footer div, div.tile {
-webkit-transform: translate3d(0,0,0);
}
div.view.view-active {
z-index: 1000;
}
div.view:not(#view-test) div.view-inner {
background-color: #fff;
}
div.view, div.view-inner {
position: absolute;
width: 100%;
height: 100%;
-webkit-transform: translateZ(0);
}
</style>
</head>
<body data-tint-win="very-dark-purple" data-tint-wp="cyan" data-tint-win10="win10-03" data-bg="light" data-bg-wp="dark" ontouchend="">
<!--
<div class="app-controls">
<div class="navigate-back hidden"></div>
<div class="title">{{title}}</div>
<div class="minimize"></div>
<div class="maximize"></div>
<div class="close" style=""></div>
</div>
-->
<div class="view view-active" id="view-test">
<!--
<img class="view-icon" src="img/AppIcon60x60.png" style="position: absolute;top: 50%;left: 50%;width: 24px;">
<p class="view-title" style="position: absolute; top: 50%; left: 50%; line-height: 24px; font-size: 13px; color:#fff">MetroUI Demo</p>
-->
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}">
<div class="navbar">
<header data-menu="index" data-hide-phone="true">
<div class="navigate-back"></div>
<div class="navbar-media">
<i class="icon icon-world"></i>
</div>
<h1>MetroUI</h1>
</header>
</div>
<div class="menus">
<div class="menu tiles" data-menu="index" data-initial-page="index" data-tiles="index">
<header>
<h1>MetroUI</h1>
</header>
</div>
</div>
<div class="pages">
<div class="page" data-page="index" data-menu="index" data-landing-page="true">
<header data-display-anywhere="true">
<h1>Welcome to MetroUI</h1>
</header>
<div class="content">
<h2>Technical Preview 2</h2>
<p>This release includes the Windows Phone mode and an experimental Windows 10 theme for both Phone and Desktop modes.</p>
<h2>New Features</h2>
<ul>
<li>Windows Phone mode</li>
<li>Windows 10 theme</li>
<li>Plugin API</li>
<li>New DOM management (currently using Dom7 by iDangerous)</li>
<li>Per-page Application Bars</li>
<li>Split Views for Windows 10</li>
<li>Hubs! Create your own Xbox-like interface!</li>
<li>Application controls (minimize, maximize, close)</li>
<li>Views: Making Task View possible! (NOTE: The Task View feature is currently for demo purposes only!)</li>
<li>Everything not runtime related (Modals etc) is now in a separate subclass of MetroUI</li>
</ul>
<h2>Fixed</h2>
<ul>
<li>Various bugs in Navigation and other components</li>
<li>Improved transition between Phone and Desktop modes</li>
<li>Fixed Phone mode using Desktop code and vice-versa</li>
</ul>
<h2>Known Issues</h2>
<ul>
<li>Transition between Phone and Desktop modes is currently not working correctly</li>
<li>Desktop mode is visible when using Phone mode in landscape</li>
<li>Windows and Search buttons only have visual purpose (Search button activates Task View in Phone Mode)</li>
<li>Split View is not working in Windows (Phone) 8 mode</li>
<li>Pivot controls are not working in Windows 10 Desktop mode</li>
<li>Hubs are not working correctly when using Phone mode</li>
</ul>
</div>
</div>
</div>
<div class="appbar minimal">
<div class="more"></div>
</div>
</div>
</div>
<div class="view" id="view-test2">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}">
<div class="navbar">
<header data-menu="index2" data-hide-phone="true">
<div class="navigate-back"></div>
<div class="navbar-media">
<i class="icon icon-world"></i>
</div>
<h1>MetroUI</h1>
</header>
</div>
<div class="menus">
<div class="menu tiles menu-active slide-in done" data-menu="index2" data-tiles="index" style="opacity: 1; -webkit-transform: translateX(0px);">
<header>
<h1>MetroUI</h1>
</header>
<div class="tile-row">
<div class="tile medium" href="pages/playground.html">
<p class="label">Playground</p>
</div>
<div class="tile medium" href="pages/design_new.html">
<p class="label">Colors</p>
</div>
</div>
<div class="tile-row">
<div class="tile wide" href="pages/bars.html">
<p class="label">Application Bars</p>
</div>
</div>
<div class="tile-row">
<div class="tile medium" href="pages/splitview.html">
<p class="label">Split View</p>
</div>
<div class="tile medium" href="pages/pivot.html">
<p class="label">Pivot Controls</p>
</div>
</div>
<div class="tile-row">
<div class="tile wide" href="pages/hub.html">
<p class="label">Hub</p>
</div>
</div>
</div>
</div>
<div class="pages"></div>
</div>
</div>
<!--
<div class="view" id="view-test3">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}">
<div class="pages">
<div class="page page-active slide-in" style="display: block">
<header data-display-anywhere="true" style="opacity: 1">
<h1>View 3</h1>
</header>
</div>
</div>
</div>
</div>
<div class="view" id="view-test4">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}">
<div class="pages">
<div class="page page-active slide-in" style="display: block">
<header data-display-anywhere="true" style="opacity: 1">
<h1>View 4</h1>
</header>
</div>
</div>
</div>
</div>
<div class="view" id="view-test5">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}">
<div class="pages">
<div class="page page-active slide-in" style="display: block">
<header data-display-anywhere="true" style="opacity: 1">
<h1>View 5</h1>
</header>
</div>
</div>
</div>
</div>
<div class="view" id="view-test6">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}"></div>
</div>
<div class="view" id="view-test7">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}"></div>
</div>
<div class="view" id="view-test8">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}"></div>
</div>
<div class="view" id="view-test9">
<div class="view-inner" onclick="if(body.classList.contains('task-view-open')){taskView(this)}"></div>
</div>
-->
<footer class="tablet-">
<div class="navigate-back" onclick="if(!$('body').classList.contains('task-view-open')){app.currentView.back()}else{taskView()}"></div>
<div class="home"></div>
<div class="search" onclick="if(window.isPhone){taskView()}"></div>
<div class="task-view" onclick="taskView()"></div>
</footer>
<script type="text/template" id="context-template">
<div class="context-content">
<p>All items will be permanently removed from your cart.</p>
<button>Empty my cart</button>
</div>
</script>
<script>
var app = new MetroUI({
useLegacyInit: false
});
var view_1 = new MetroUI.View({
app: app,
selector: "div.view#view-test"
});
var view_2 = new MetroUI.View({
app: app,
selector: "div.view#view-test2"
});
app.currentView = view_1;
window.onerror = function(e,url,line) { app.alert("MetroUI has encountered an error.","<br><pre>Script: "+url+"</pre>"+"<pre>Line: "+line+"</pre>"+"<pre>Error: "+e+"</pre>"+"<pre>Source: JavaScript Runtime Error</pre>") };
function taskView(newView) {
var viewCount = $$("div.view").length;
var positionsX = [];
var positionsY = [];
var duration = 400;
switch (viewCount) {
case 1:
positionsX = [0];
positionsY = [0];
break;
case 2:
positionsX = [-((window.innerWidth*0.4)/2 + 6),((window.innerWidth*0.4)/2 + 6)];
positionsY = [0,0];
break;
case 3:
positionsX = [-((window.innerWidth*0.4)/2 + 6),((window.innerWidth*0.4)/2 + 6),0];
positionsY = [-((window.innerHeight*0.4)/2+6),-((window.innerHeight*0.4)/2+6),((window.innerHeight*0.4)/2 + 6)];
break;
case 4:
positionsX = [-((window.innerWidth*0.4)/2 + 6),((window.innerWidth*0.4)/2 + 6),-((window.innerWidth*0.4)/2 + 6),((window.innerWidth*0.4)/2 + 6)];
positionsY = [-((window.innerHeight*0.4)/2 + 6),-((window.innerHeight*0.4)/2 + 6),((window.innerHeight*0.4)/2 + 6),((window.innerHeight*0.4)/2 + 6)];
break;
case 5:
var zoom = 0.3;
positionsX = [ -((window.innerWidth*zoom) + 12),
0,
((window.innerWidth*zoom) + 12),
-((window.innerWidth*zoom)/2 + 6),
((window.innerWidth*zoom)/2 + 6)];
positionsY = [ -((window.innerHeight*zoom)/2 + 3),
-((window.innerHeight*zoom)/2 + 3),
-((window.innerHeight*zoom)/2 + 3),
((window.innerHeight*zoom)/2),
((window.innerHeight*zoom)/2)];
break;
case 6:
var zoom = 0.3;
positionsX = [-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12)];
positionsY = [-((window.innerHeight*zoom)/2 + 3),-((window.innerHeight*zoom)/2 + 3),-((window.innerHeight*zoom)/2 + 3),((window.innerHeight*zoom)/2),((window.innerHeight*zoom)/2),((window.innerHeight*zoom)/2)];
break;
case 7:
var zoom = 0.3;
positionsX = [-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),0];
positionsY = [-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),0,0,0,((window.innerHeight*zoom))];
break;
case 8:
var zoom = 0.3;
positionsX = [-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom)/2 + 6),((window.innerWidth*zoom)/2 + 6)];
positionsY = [-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),0,0,0,((window.innerHeight*zoom)),((window.innerHeight*zoom))];
break;
case 9:
var zoom = 0.3;
positionsX = [-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12),-((window.innerWidth*zoom) + 12),0,((window.innerWidth*zoom) + 12)];
positionsY = [-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),-((window.innerHeight*zoom)),0,0,0,((window.innerHeight*zoom)),((window.innerHeight*zoom)),((window.innerHeight*zoom))];
break;
default: break;
}
if (!$('body').classList.contains('task-view-open')) {
if ($("footer div.task-view")) {
$("footer div.task-view").classList.add('open');
}
$('body').classList.add('task-view-open');
for (var i=0; i<viewCount; i++) {
new Velocity($$('div.view div.view-inner')[i], "stop");
new Velocity($$('div.view div.view-inner')[i], {
translateX: [positionsX[i],0],
translateY: [positionsY[i],0],
scale: [(viewCount<5)?0.4:0.3,1]
}, {
duration:duration,
easing:[0.19, 1, 0.22, 1],
/*complete: function(el) {
var views = $$("div.view");
var viewIndex;
for (var j=0; j<views.length; j++) {
if (el[0].parentNode == views[j]) {
viewIndex = j;
break;
}
}
if ($$("img.view-icon")[viewIndex]) {
$$("img.view-icon")[viewIndex].style.marginTop = (positionsY[viewIndex]<=0) ? positionsY[viewIndex]-(window.innerHeight*((viewCount<5)?0.4:0.3) / 2) - 21 + "px" : 0 + "px";
$$("img.view-icon")[viewIndex].style.marginLeft = (positionsX[viewIndex]<=0) ? positionsX[viewIndex]-(window.innerWidth*((viewCount<5)?0.4:0.3) / 2) + "px" : positionsX[viewIndex]-(window.innerWidth*((viewCount<5)?0.4:0.3) / 2) + "px";
}
if ($$("p.view-title")[viewIndex]) {
$$("p.view-title")[viewIndex].style.marginTop = (positionsY[viewIndex]<=0) ? positionsY[viewIndex]-(window.innerHeight*((viewCount<5)?0.4:0.3) / 2) - 21 + "px" : 0 + "px";
$$("p.view-title")[viewIndex].style.marginLeft = (positionsX[viewIndex]<=0) ? positionsX[viewIndex]-(window.innerWidth*((viewCount<5)?0.4:0.3) / 2) + 30 + "px" : positionsX[viewIndex]-(window.innerWidth*((viewCount<5)?0.4:0.3) / 2) + 30 + "px";
}
}*/
});
}
} else {
if ($("footer div.task-view")) {
$("footer div.task-view").classList.remove('open');
}
$('body').classList.remove('task-view-open');
for (var i=0; i<viewCount; i++) {
new Velocity($$('div.view div.view-inner')[i], "stop");
}
var view = (typeof(newView) === "undefined") ? $('div.view.view-active div.view-inner') : newView;
app.currentView = app.views[app.viewNames.indexOf("div.view#"+view.parentNode.getAttribute("id"))];
$("div.view.view-active").classList.remove("view-active");
view.parentNode.classList.add("view-active");
new Velocity(view, {
translateX: 0,
translateY: 0,
scale: [1,(viewCount<5)?0.4:0.3]
}, {
duration:duration,
easing:[0.19, 1, 0.22, 1]
});
}
}
app.onPageInit("pivot", function() {
if (window.pivot) {
window.pivot.destroy();
window.pivot = undefined;
}
window.pivot = new MetroUI.Pivot("pivot");
});
app.onPageInit("splitview", function() {
var split = new MetroUI.SplitControl("splitview", {
app: app
});
});
app.onPageInit("hub", function() {
window.hub = new MetroUI.Hub("hub");
});
window.addEventListener("touchend", function() {
_$("div.menus p").css('display','run-in'); setTimeout(function () { _$("div.menus p").css('display','block'); }, 0);
})
</script>
</body>
</html>