Add the iOS7-only PhotoExamplePlus Cydget example.
[cydget.git] / PhotoExamplePlus.cydget / background.html
1 <html><head>
2 <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
3 <style>
4 * {
5 border: 0;
6 -moz-border-radius: 0;
7 -webkit-border-radius: 0;
8 box-sizing: border-box;
9 -moz-box-sizing: border-box;
10 -ms-box-sizing: border-box;
11 -webkit-box-sizing: border-box;
12 /*font-family: inherit;*/
13 font-size: 100%;
14 font-style: inherit;
15 font-weight: inherit;
16 margin: 0;
17 outline: 0;
18 padding: 0;
19 text-decoration: none;
20 vertical-align: baseline;
21 }
22
23 * {
24 -webkit-touch-callout: none;
25 -webkit-text-size-adjust: none;
26 -webkit-user-select: none;
27 }
28
29 body {
30 height: 100%;
31 width: 100%;
32 background: none;
33 }
34
35 #content {
36 height: 100%;
37 width: 100%;
38 display: table-cell;
39 text-align: center;
40 vertical-align: middle;
41 }
42
43 #content img {
44 max-width: 100%;
45 max-height: 100%;
46 vertical-align: middle;
47 }
48 </style></head><body>
49 <div id="content"><script type="text/javascript">
50 var album = PLPhotoLibrary.sharedPhotoLibrary.albums[0].userEditableAssets.array;
51 var length = album.length;
52 if (length != 0) {
53 var index = Math.floor(Math.random() * length);
54 var path = album[index].pathForLargeDisplayableImageFile;
55 document.write('<img src="' + path + '"/>');
56 }
57 </script></div>
58 </body></html>