Skip to content

Commit 2905a25

Browse files
committed
Added "force WebApp mode" and style fixed
1 parent b20010e commit 2905a25

File tree

7 files changed

+330
-47
lines changed

7 files changed

+330
-47
lines changed

images/toggle.png

7.46 KB
Loading

images/upload.jpg

-22.1 KB
Loading

images/upload.png

-880 KB
Loading

images/video.png

4.12 KB
Loading

index.html

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="UTF-8" />
55
<title>CSS PhotoEditor for iOS6 - kudakurage</title>
66
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" />
7-
<meta name="Description" content="It's time again for a new version of iOS for iPhone and iPad and a bunch of news about mobile web development." />
8-
<meta name="Keywords" content="iOS6,safari,iphone,ipad" />
7+
<meta name="Description" content="CSS PhotoEditor is a test site for new features that will be installed in iOS 6." />
8+
<meta name="Keywords" content="iOS6,safari,iphone,ipad,css,filter" />
99
<meta name="format-detection" content="telephone=no" />
1010
<meta name="apple-mobile-web-app-capable" content="yes" />
1111
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@@ -50,7 +50,7 @@
5050
<div id="opacity-slider"><input type="range" name="opacity" min="0" max="100" value="100"><output class="value"><span>100</span>%</output></div>
5151
</div>
5252
</div>
53-
<div id="disabled"><img src="images/loading.gif"></div>
53+
<div id="disabled"><div><img src="images/loading.gif"></div></div>
5454
<div id="info-body">
5555
<header>
5656
<h1>CSS PhotoEditor</h1>
@@ -65,6 +65,13 @@ <h2>About This</h2>
6565
</p>
6666
<p>IF you want to learn more, you may read <a href="http://d.hatena.ne.jp/kudakurage/">my blog entry</a>.</p>
6767
</div>
68+
<div id="force-webapp-content">
69+
<h2>WebApp Mode by Force</h2>
70+
<p>
71+
When you turn on this mode, you can switch to forcibly WebApp mode. This switch is not only appear at the time of the Overview mode.
72+
</p>
73+
<p class="function">Force WebApp Mode<a href="#" id="force-webapp">OFF</a></p>
74+
</div>
6875
<div>
6976
<h2>Features and Help</h2>
7077
<h3>Image Filters</h3>
@@ -99,5 +106,18 @@ <h2>Creator Profile</h2>
99106
</div><!-- #info-body -->
100107
</div><!-- #display -->
101108
</div><!-- #wrapper -->
109+
<script type="text/javascript">
110+
111+
var _gaq = _gaq || [];
112+
_gaq.push(['_setAccount', 'UA-33534717-1']);
113+
_gaq.push(['_trackPageview']);
114+
115+
(function() {
116+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
117+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
118+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
119+
})();
120+
121+
</script>
102122
</body>
103123
</html>

photoeditor.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,29 @@ $(function(){
144144
}
145145
}, 'json');
146146
});
147+
148+
$('#force-webapp').toggle(function(){
149+
$(this).addClass('on').text('ON');
150+
setTimeout(function(){
151+
$('body').addClass('fullscreen');
152+
}, 350);
153+
}, function(){
154+
$(this).removeClass('on').text('OFF');
155+
setTimeout(function(){
156+
$('body').removeClass('fullscreen');
157+
}, 350);
158+
});
147159
});
148160

149161
///////////////////////////////////////////////////////// Function
150162
pe.init = function(){
151163
if ((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) {
152164
pe.mobile = true;
153165
document.title='PhotoEditor';
166+
if(navigator.userAgent.indexOf('iPhone OS 6') == -1){
167+
pe.osAlert = $('<div/>').attr('id', 'os-alert').html('<div><p>This app will work correctly only on the iOS6!</p><span>Tap and close</span></div>').click(function(){$(this).hide();});
168+
$('#display').append(pe.osAlert);
169+
}
154170
}
155171
if(pe.mobile){
156172
$('body').addClass('mobile');
@@ -162,7 +178,7 @@ pe.init = function(){
162178
pe.switchOrientation();
163179
if(!pe.mobile){
164180
$('#wrapper').addClass('start').append('<img src="images/iphone.png" id="iphone"><a href="#" onclick="pe.checkStyle();return false;" id="check-style-button">Check the style</a>');
165-
$('#wrapper').append('<div id="pc"><img src="images/logo.png" id="pc-logo"><p id="pc-text">CSS PhotoEditor is a test site for new features that will be installed in iOS6.<span>The browsers supported this site are Chrome19, Safari6 & iOS6.</span></p><a href="#" onclick="pe.showVideo();return false;" id="video"><img src="images/video.png"><span>DEMO on iOS simulator</span></a><ul id="features"><li class="upload">Input type=file</li><li class="filter">CSS Filters</li><li class="slider">Custom Slider UI</li><li class="font">Landscape Mode</li></ul><div class="profile"><a href="http://d.hatena.ne.jp/kudakurage/"><img src="images/profile.png" class="profile-image"></a><p class="profile-name">Kazuyuki Motoyama<span>Kudakurage</span></p><p class="profile-acount"><a href="https://twitter.com/kudakurage" class="twitter">twitter</a><a href="http://dribbble.com/kudakurage" class="dribbble">dribbble</a><a href="https://github.com/kudakurage" class="github">github</a></p><p class="profile-text">I have been working as a Web designer in Kyoto.<br />UI Design / App Design / Illustration / HTML5&CSS3 / Javascript / PHP</p><p class="copyright">Copyright &copy; 2012 kazuyuki motoyama</p></div></div>');
181+
$('#wrapper').append('<div id="pc"><img src="images/logo.png" id="pc-logo"><p id="pc-text">CSS PhotoEditor is a test site for new features that will be installed in iOS6.<span>The browsers supported this site are Chrome20, Safari6 & iOS6. <a href="http://d.hatena.ne.jp/kudakurage/">Learn more about this page</a></span></p><a href="#" onclick="pe.showVideo();return false;" id="video"><img src="images/video.png"><span>DEMO on iOS simulator</span></a><ul id="features"><li class="upload">Input type=file</li><li class="filter">CSS Filters</li><li class="slider">Custom Slider UI</li><li class="font">Landscape Mode</li></ul><div class="profile"><a href="http://d.hatena.ne.jp/kudakurage/"><img src="images/profile.png" class="profile-image"></a><p class="profile-name">Kazuyuki Motoyama<span>Kudakurage</span></p><p class="profile-acount"><a href="https://twitter.com/kudakurage" class="twitter">twitter</a><a href="http://dribbble.com/kudakurage" class="dribbble">dribbble</a><a href="https://github.com/kudakurage" class="github">github</a></p><p class="profile-text">I have been working as a Web designer in Kyoto.<br />UI Design / App Design / Illustration / HTML5&CSS3 / Javascript / PHP</p><p class="copyright">Copyright &copy; 2012 kazuyuki motoyama</p></div></div>');
166182
pe.videoWindow = $('<div/>').attr('id','video-window').click(function(){pe.hideVideo();});
167183
$('body').append(pe.videoWindow);
168184
}
@@ -304,7 +320,7 @@ pe.captureMode = function(){
304320
}
305321

306322
pe.showVideo = function(){
307-
$(pe.videoWindow).html('<div id="video-content"><iframe width="640" height="360" src="http://www.youtube.com/embed/592T7P3macw?rel=0&autoplay=1&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe></div>');
323+
$(pe.videoWindow).html('<div id="video-content"><iframe width="640" height="360" src="http://www.youtube.com/embed/Z5bFwu5WSeg?rel=0&autoplay=1&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe></div>');
308324
$('#video-window').addClass('show');
309325
return false;
310326
}

0 commit comments

Comments
 (0)