<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phonydev.com</title>
	<atom:link href="http://phonydev.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phonydev.com</link>
	<description>iPhone web development blog</description>
	<lastBuildDate>Mon, 24 Oct 2011 19:43:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The new game show: hunt the limit</title>
		<link>http://phonydev.com/the-new-game-show-hunt-the-limit/</link>
		<comments>http://phonydev.com/the-new-game-show-hunt-the-limit/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:34:20 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[images]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=36</guid>
		<description><![CDATA[I was looking today at Apple&#8217;s iOS resource limits. All good and nice, it&#8217;s great that they&#8217;ll state them and we, developers, don&#8217;t have to hunt them down as we&#8217;ve done before and again. But I thought I should check these limits, namely the size of images limits. Because it&#8217;s important, if you create too [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking today at <a href="http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html">Apple&#8217;s iOS resource limits</a>. All good and nice, it&#8217;s great that they&#8217;ll state them and we, developers, don&#8217;t have to hunt them down as we&#8217;ve <a href="http://www.phpied.com/iphone-caching/">done</a> <a href="http://yuiblog.com/blog/2008/02/06/iphone-cacheability/">before</a> and <a href="http://www.yuiblog.com/blog/2010/07/12/mobile-browser-cache-limits-revisited/">again</a>. But I thought I should check these limits, namely the size of images limits. Because it&#8217;s important, if you create too big of a sprite it may not be displayed at all (it&#8217;s the decoded size that matters when decoding in memory, not the file size) or even worse &#8211; crash the browser.</p>
<p>So they say the PNG and GIF limit is 3 megapixels or 3 * 1024 * 1024 (3 * width * height), and JPEG is much bigger &#8211; 32 megapixels.</p>
<p>I wanted to see what happens after the limit &#8211; will the browser crash or what?</p>
<p>I have this &#8220;pagr&#8221; tool that helps me create resources &#8211; <a href="http://tools.w3clubs.com/pagr/">http://tools.w3clubs.com/pagr/</a>. So I thought: 1024&#215;3072 image should be fine:</p>
<p><a href="http://tools.w3clubs.com/pagr/1.width-1024.height-3072.png">http://tools.w3clubs.com/pagr/1.width-1024.height-3072.png</a></p>
<p>But then one pixel more, 1025&#215;3072, should somehow fail:</p>
<p><a href="http://tools.w3clubs.com/pagr/1.width-1025.height-3072.png">http://tools.w3clubs.com/pagr/1.width-1025.height-3072.png</a></p>
<p>Turns out it doesn&#8217;t.</p>
<p>Even <a href="http://tools.w3clubs.com/pagr/1.width-3072.height-3072.png">3072&#215;3072</a> didn&#8217;t fail either. True, takes a while to render (not to load, because it&#8217;s under 50K being mostly the same color) but it does render.</p>
<p>Then I tried GIF and I couldn&#8217;t even render <a href="http://tools.w3clubs.com/pagr/1.width-1024.height-1024.gif">1024&#215;1024</a>. Not even <a href="http://tools.w3clubs.com/pagr/1.width-600.height-600.gif">600&#215;600</a>. <a href="http://tools.w3clubs.com/pagr/1.width-500.height-500.gif">500&#215;500</a> is fine, so is <a href="http://tools.w3clubs.com/pagr/1.width-512.height-512.gif">512&#215;512</a>. Not sure where the line is. Also interestingly enough after <a href="http://tools.w3clubs.com/pagr/1.width-600.height-600.gif">600&#215;600</a> fails and you reload, it does show up the second time. So does <a href="http://tools.w3clubs.com/pagr/1.width-700.height-700.gif">700&#215;700</a>. Interesting, but you cannot ask people to reload to see your images.</p>
<p>So what do we know? Not much. </p>
<p>1. iOS 4.2.1 doesn&#8217;t have the 3 * 1024 * 1024 limit for PNGs. What&#8217;s the limit? Je ne sais pas, but it&#8217;s higher than that.<br />
2. GIF have even lower limit. Even 600&#215;600 doesn&#8217;t load at first load, although it does after refresh<br />
3. <a href="http://givepngachance.com">Give PNG a chance</a>, forget GIFs</p>
<p>More questions:<br />
 &#8211; This was alll loading images directly. Do they behave the same way when in a page?<br />
 &#8211; When in IMG tag vs CSS background-image?<br />
 &#8211; What are the limits?<br />
 &#8211; what about iOS 3? iOS2?</p>
<p>I&#8217;m off to bed, feel free to continue the experiment with the sizes <img src='http://phonydev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s the URL, just play with the width/height and file extension:<br />
<a href="http://tools.w3clubs.com/pagr/1.width-1024.height-3072.png">http://tools.w3clubs.com/pagr/1.width-1024.height-3072.png</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/the-new-game-show-hunt-the-limit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Market share stats</title>
		<link>http://phonydev.com/market-share-stats/</link>
		<comments>http://phonydev.com/market-share-stats/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 18:17:44 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=34</guid>
		<description><![CDATA[Click As of writing this iOS has 55% and Android has 16% The methodology of this measurement looks solid and is based on 160 million users worldwide]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.netmarketshare.com/operating-system-market-share.aspx?qprid=8&#038;qpcustomd=1">Click</a></p>
<p>As of writing this iOS has 55% and Android has 16%</p>
<p>The methodology of this measurement looks solid and is based on 160 million users worldwide</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/market-share-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile performance advice</title>
		<link>http://phonydev.com/mobile-performance-advice/</link>
		<comments>http://phonydev.com/mobile-performance-advice/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 22:59:46 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=32</guid>
		<description><![CDATA[html5 rocks&#8217;s guide Google guidelines Strangeloop&#8217;s WPO hub What strangeloop&#8217;s optimizer does Slides from Max Firtman velocity 2011 and from 2010 Slides from Steve Souders and the vid Slides from Rajiv Vijayakumar Velocity 2011 making a mobile connection Apple&#8217;s advice and some more Slides from Tim Kadlec Slides+Audio from Jason Grigsby From Blaze.io: HTTP pipelining [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.html5rocks.com/en/mobile/optimization-and-performance.html">html5 rocks&#8217;s guide</a></li>
<li><a href="http://code.google.com/speed/page-speed/docs/mobile.html">Google guidelines</a></li>
<li><a href="http://www.strangeloopnetworks.com/web-performance-optimization-hub/topics/mobile/">Strangeloop&#8217;s WPO hub</a></li>
<li><a href="http://www.strangeloopnetworks.com/products/mobile-overview/features/">What strangeloop&#8217;s optimizer does</a></li>
<li><a href="http://www.mobilexweb.com/blog/mobile-web-html5-performance-optimization">Slides from Max Firtman velocity 2011</a> and <a href="http://www.slideshare.net/firt/mobile-web-high-performance">from 2010</a></li>
<li><a href="http://www.slideshare.net/souders/high-performance-mobile-sfsv-web-perf">Slides from Steve Souders</a> and <a href="www.youtube.com/watch?v=5ENYA_RCCjM">the vid</a></li>
<li><a href="http://velocityconf.com/velocity2011/public/schedule/detail/18241">Slides from Rajiv Vijayakumar Velocity 2011</a></li>
<li><a href="http://www.stevesouders.com/blog/2011/09/21/making-a-mobile-connection/">making a mobile connection</a></li>
<li><a href="http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html">Apple&#8217;s advice</a> and <a href="http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/OptimizingYourWebsite/OptimizingYourWebsite.html#//apple_ref/doc/uid/TP40007874-CH9-SW2">some more</a></li>
<li><a href="http://www.slideshare.net/tkadlec/mobile-wpo">Slides from Tim Kadlec</a></li>
<li><a href="http://www.slideshare.net/grigs/going-fast-on-the-mobile-web">Slides+Audio from Jason Grigsby</a></li>
<li>From Blaze.io: <a href="http://www.blaze.io/mobile/http-pipelining-big-in-mobile/">HTTP pipelining</a> and <a href="http://www.blaze.io/mobile/understanding-mobile-cache-sizes/">mobile cache sizes</a></li>
<li><a href="http://www.slideshare.net/sthair/measuring-mobile-web-performance-v2">Slides from Stephen Thair on measuring</a></li>
<li><a href="http://www.w3.org/TR/mwabp/">Mobile best practices from w3c</a> + <a href="http://www.w3.org/2010/09/MWABP/">summary</a></li>
<li><a href="http://joehewitt.com/2011/10/05/fast-animation-with-ios-webkit">fast scrolling in iOS</a></li>
<li><a href="http://stevesouders.com/mobileperf/">Steve&#8217;s collection of links</a></li>
<li><a href="http://www.blaze.io/mobile/ios5-top10-performance-changes/">What&#8217;s new in iOS5, performance-wise</a></li>
<li><a href="http://calendar.perfplanet.com/2010/high-performance-mobile/">perf calendar 2010 article by David Calhoun</a> and <a href="http://davidbcalhoun.com/2011/mobile-performance-manifesto">here too</a></li>
</ul>
<h4>Tools:</h4>
<ul>
<li><a href="http://code.google.com/webtoolkit/speedtracer/">Speed tracer</a></li>
<li><a href="http://developer.yahoo.com/yslow/mobile/#javascript:%28function%28y,p,o%29%7Bp=y.body.appendChild%28y.createElement%28%27iframe%27%29%29;p.id=%27YSLOW-bookmarklet%27;p.style.cssText=%27display:none%27;o=p.contentWindow.document;o.open%28%29.write%28%27%3Chead%3E%3Cbody%20onload=%22YUI_config=%7Bwin:window.parent,doc:window.parent.document%7D;var%20d=document;d.getElementsByTagName%28%5C%27head%5C%27%29[0].appendChild%28d.createElement%28%5C%27script%5C%27%29%29.src=%5C%27http://d.yimg.com/jc/yslow-bookmarklet.js%5C%27%22%3E%27%29;o.close%28%29%7D%28document%29%29">yslow bookmarklet</a> (bookmark this on the phone, then edit the bookmark and delete all up to the # so it starts with javascript:)</li>
</ul>
<h4>How we built it</h4>
<ul>
<li><a href="http://engineering.twitter.com/2011/09/twitters-mobile-web-app-delivers_14.html">Twitter</a></li>
<li><a href="http://www.readwriteweb.com/mobile/2011/09/how-facebook-mobile-was-design.php">facebook</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/mobile-performance-advice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sniffing HTTP traffic</title>
		<link>http://phonydev.com/sniffing-http-traffic/</link>
		<comments>http://phonydev.com/sniffing-http-traffic/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 20:58:02 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=31</guid>
		<description><![CDATA[On a Mac, using Burp Suite Fiddler/Windows With Wireshark Using Paros with pcapperf hosted]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="http://www.tuaw.com/2011/02/21/how-to-inspect-ioss-http-traffic-without-spending-a-dime/">On a Mac, using Burp Suite</a></li>
<li><a href="http://conceptdev.blogspot.com/2009/01/monitoring-iphone-web-traffic-with.html">Fiddler/Windows</a></li>
<li><a href="http://blog.mudynamics.com/2010/10/10/iphone-meet-wireshark-capturing-traffic-from-mobile-devices/">With Wireshark</a></li>
<li><a href="http://blog.jerodsanto.net/2009/06/sniff-your-iphones-network-traffic/">Using Paros</a></li>
<li><a href="http://calendar.perfplanet.com/2010/mobile-performance-analysis-using-pcapperf/">with pcapperf</a></li>
<li><a href="http://www.blaze.io/mobile/">hosted</a>
<li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/sniffing-http-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 cool fonts for your iPhone web app</title>
		<link>http://phonydev.com/4-cool-fonts-for-your-iphone-web-app/</link>
		<comments>http://phonydev.com/4-cool-fonts-for-your-iphone-web-app/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 06:48:45 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[fonts]]></category>
		<category><![CDATA[marker felt]]></category>
		<category><![CDATA[typewriter]]></category>
		<category><![CDATA[zapfino]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=29</guid>
		<description><![CDATA[Here are 4 cool font you can use in your web app or iPhone-friendly site: .marker { font-family: "Marker felt"; } .zapfino { font-family: Zapfino; } .type { font-family: "American Typewriter"; } .arial { font-family: "Arial rounded MT bold"; } Marker Felt Zapfino American Typewriter Arial rounded MT bold the CSS .marker {font-family: &#34;Marker felt&#34;;} [...]]]></description>
			<content:encoded><![CDATA[<p>Here are 4 cool font you can use in your web app or iPhone-friendly site:</p>
<style type="text/css">
    .marker {
        font-family: "Marker felt";
    }
    .zapfino {
        font-family: Zapfino;
    }
    .type {
        font-family: "American Typewriter";
    }
    .arial {
        font-family: "Arial rounded MT bold";
    }
</style>
<p class="marker">Marker Felt</p>
<p class="zapfino">Zapfino</p>
<p class="type">American Typewriter</p>
<p class="arial">Arial rounded MT bold</p>
<h3>the CSS</h3>
<div class="hl-main">
<pre><span class="hl-identifier">.marker</span><span class="hl-code">  </span><span class="hl-brackets">{</span><span class="hl-reserved">font-family:</span><span class="hl-code"> &quot;Marker felt</span><span class="hl-code">&quot;</span><span class="hl-reserved"></span><span class="hl-code">;</span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-identifier">.zapfino</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-reserved">font-family:</span><span class="hl-code"> </span><span class="hl-code">Zapfino</span><span class="hl-reserved"></span><span class="hl-code">;</span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-identifier">.type</span><span class="hl-code">    </span><span class="hl-brackets">{</span><span class="hl-reserved">font-family:</span><span class="hl-code"> &quot;</span><span class="hl-code">American</span><span class="hl-code"> </span><span class="hl-code">Typewriter</span><span class="hl-code">&quot;</span><span class="hl-reserved"></span><span class="hl-code">;</span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-identifier">.arial</span><span class="hl-code">   </span><span class="hl-brackets">{</span><span class="hl-reserved">font-family:</span><span class="hl-code"> &quot;</span><span class="hl-code">Arial</span><span class="hl-code"> </span><span class="hl-code">rounded</span><span class="hl-code"> </span><span class="hl-code">MT bold</span><span class="hl-code">&quot;</span><span class="hl-reserved"></span><span class="hl-code">;</span><span class="hl-brackets">}</span></pre>
</div>
<h3>test, screenshot</h3>
<p><a href="file://localhost/Users/stoyan/misc/ifonts.html">Here&#8217;s a test page</a> and, if you&#8217;re not reading this from your iPhone or Mac, and these fonts are not on your system, <a href="http://phonydev.com/files/2009/04/ifonts.png">here&#8217;s a screenshot</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/4-cool-fonts-for-your-iphone-web-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>3 special attributes for inputs in the iPhone</title>
		<link>http://phonydev.com/3-special-attributes-for-inputs-in-the-iphone/</link>
		<comments>http://phonydev.com/3-special-attributes-for-inputs-in-the-iphone/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 04:46:30 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[capitalize]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[spell-check]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=25</guid>
		<description><![CDATA[Here are 3 quick tips on how to make your inputs (I mean &#60;input type="text" /&#62;) better and more usable when your page is viewed in the iPhone. These are trivial to implement as they only require using some special attributes. name="search" or type="search" When you tap an input box, the keyboard comes up. Right [...]]]></description>
			<content:encoded><![CDATA[<p>Here are 3 quick tips on how to make your inputs (I mean <code>&lt;input type="text" /&gt;</code>) better and more usable when your page is viewed in the iPhone. These are trivial to implement as they only require using some special attributes.</p>
<h3><code>name="search"</code> or <code>type="search"</code></h3>
<p>When you tap an input box, the keyboard comes up. Right next to the [space] key there is a button that submits the form you&#8217;re currently filling out. This button by default says &#8220;Go&#8221;.</p>
<p><img src="http://phonydev.com/files/2009/03/1-button-go.png" alt="Go button" width="179" height="240" class="alignnone size-full wp-image-26" /></p>
<p>But when you set the <code>name</code> attribute of the input to have the value &#8220;search&#8221;, then the button says &#8220;Search&#8221;. Pretty neat.</p>
<p><img src="http://phonydev.com/files/2009/03/2-button-search.png" alt="Search button" width="203" height="240" class="alignnone size-full wp-image-27" /></p>
<p>Sometimes you may not be able to rename your input, because there are already too many dependencies on the backend. In this case you may use &#8220;search&#8221; as value of the <code>type</code> attribute. I don&#8217;t think this is a valid standards-compliant value for the <code>type</code> attribute, but&#8230; oh, well.</p>
<h3><code>placeholder</code> attribute</h3>
<p>This attribute helps you present something like labels for the inputs but without taking page real estate, because they are displayed inside the input.</p>
<p>So if you add this to your input: <code>placeholder="type here"</code>, the input will look like:</p>
<p><img src="http://phonydev.com/files/2009/03/3-label-placeholder.png" alt="placeholder" width="224" height="53" class="alignnone size-full wp-image-28" /></p>
<h3>No corrections, please</h3>
<p>You&#8217;ve noticed already the spell-checker when you fill-out forms (and probably have been at least once pissed off by the corrections). To turn it off simply set the <code>autocorrect="off"</code> attribute.</p>
<p>Same for capitalization. If you think your users don&#8217;t need auto-capitalization in this particular input (username input for example), set the attribute <code>autocapitalize="off"</code></p>
<h3>The End</h3>
<p>At the end, this is what your code will look like if you implement all the tips.</p>
<div class="hl-main">
<pre><span class="hl-brackets">&lt;</span><span class="hl-reserved">form</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">input</span><span class="hl-code"> </span><span class="hl-var">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">text</span><span class="hl-quotes">&quot;</span><span class="hl-code">
       </span><span class="hl-var">name</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">search</span><span class="hl-quotes">&quot;</span><span class="hl-code">
       </span><span class="hl-var">autocorrect</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">off</span><span class="hl-quotes">&quot;</span><span class="hl-code">
       </span><span class="hl-var">autocapitalize</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">off</span><span class="hl-quotes">&quot;</span><span class="hl-code">
       </span><span class="hl-var">placeholder</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">type here</span><span class="hl-quotes">&quot;</span>
<span class="hl-code"> /</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">form</span><span class="hl-brackets">&gt;</span></pre>
</div>
<p>And here&#8217;s <a href="http://phpied.com/files/iphone/input.html">a demo page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/3-special-attributes-for-inputs-in-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy shiny buttons and toolbars</title>
		<link>http://phonydev.com/easy-shiny-buttons-and-toolbars/</link>
		<comments>http://phonydev.com/easy-shiny-buttons-and-toolbars/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 18:09:01 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[pixels]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[shiny]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=22</guid>
		<description><![CDATA[This post suggests an easy way to have shiny buttons or toolbars or anything shiny. You can use any color with a single image. Screenshot/demo Here&#8217;s a screenshot. And here you can see the demo. The code You put a semi-transparent PNG image, 1 pixel wide by any pixel high, as a background-image on the [...]]]></description>
			<content:encoded><![CDATA[<p>This post suggests an easy way to have shiny buttons or toolbars or anything shiny. You can use any color with a single image.</p>
<h3>Screenshot/demo</h3>
<p>Here&#8217;s a screenshot.</p>
<p><img src="http://phonydev.com/files/2009/02/shiny-buttons-toolbar.png" alt="Shiny buttons and tolbars" width="200" height="169" /></p>
<p>And <a href="http://tools.w3clubs.com/mask/testh.html">here you can see the demo</a>.</p>
<h3>The code</h3>
<p>You put a semi-transparent PNG image, 1 pixel wide by any pixel high,  as a <code>background-image</code> on the element you want to make shiny and then use your selected color as <code>background-color</code>. Simple as that.</p>
<div class="hl-main">
<pre><span class="hl-identifier">.mybutton</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  </span><span class="hl-reserved">background-image:</span><span class="hl-code">url</span><span class="hl-code">(</span><span class="hl-code">mask</span><span class="hl-code">.</span><span class="hl-code">png</span><span class="hl-code">)</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">background-position:</span><span class="hl-code"> </span><span class="hl-string">center</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">background-color:</span><span class="hl-code"> </span><span class="hl-var">#4a6C9b</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<h3>Mask image</h3>
<p>Now about the image that you use as background? It&#8217;s a 1&#215;1000 image where the top 1&#215;500 of it is about 80% transparent and the the bottom half is 100% transparent.</p>
<p>Why 1000 pixels? Too many? Well, I chose 1000 just to be on the safe side if the user resizes the font. The thing is that for this type of image 1000 or 100 doesn&#8217;t matter for the file size. In fact 1&#215;10 image is 106 bytes and 1&#215;1000 is 120 bytes.</p>
<p>I updated my script that generates the shiny glossy overlays for icons (<a href="http://phonydev.com/iphone-like-glossy-icons/">see previous post</a>) to generate the new type of image. The script can be called like this:<br />
<code>http://tools.w3clubs.com/mask/mask.php?type=h</code> for a 1&#215;100 image (default)<br />
<code>http://tools.w3clubs.com/mask/mask.php?type=h&#038;x=1000</code>  1&#215;1000 image<br />
<code>http://tools.w3clubs.com/mask/mask.php?type=h&#038;x=10</code> &#8211; 1&#215;10 image</p>
<p>The <a href="http://github.com/stoyan/etc/tree/master">code that generates the images is on github</a> if you want to customize it.</p>
<h3>Browser support</h3>
<p>Since there&#8217;s nothing complicated in this technique it will work fine in Safari, Firefox and IE7,8. IE6 will show the semi-transparent PNG8 as fully transparent so your shiny element will degrade gracefully to a non-shiny one. For the rounded buttons, since I&#8217;m using border-radius, they will not be rounded in IE.</p>
<h3><code>data: url</code></h3>
<p>For performance purposes it&#8217;s best if you have less HTTP requests. So it makes sense to replace that minuscule 120 bytes image with a <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">base64 data: url</a>. That&#8217;s what I used for the demo, so just check the source to see how it looks like.</p>
<h3>Thanks</h3>
<p>And the <a href="http://tools.w3clubs.com/mask/testh.html">demo page</a> once again.</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/easy-shiny-buttons-and-toolbars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling an iPhone-like list</title>
		<link>http://phonydev.com/styling-iphone-like-lists/</link>
		<comments>http://phonydev.com/styling-iphone-like-lists/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 05:22:45 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[styles]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=18</guid>
		<description><![CDATA[iPhone/iPod UI often uses lists. It&#8217;s nice to be able to style a list in your page so it looks like a native iPhone app, or like the Settings menu/app for example. Here&#8217;s one way to do it. Demo Here&#8217;s the end result. Markup Markup includes just the bare minimum. &#60;ul class=&#34;nav&#34;&#62; &#60;li class=&#34;first&#34;&#62; &#60;a [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone/iPod UI often uses lists. It&#8217;s nice to be able to style a list in your page so it looks like a native iPhone app, or like the Settings menu/app for example. Here&#8217;s one way to do it.</p>
<h3>Demo</h3>
<p>Here&#8217;s <a href="http://phpied.com/files/iphone/list.html">the end result</a>.</p>
<h3>Markup</h3>
<p>Markup includes just the bare minimum.</p>
<div class="hl-main">
<pre><span class="hl-brackets">&lt;</span><span class="hl-reserved">ul</span><span class="hl-code"> </span><span class="hl-var">class</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">nav</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">li</span><span class="hl-code"> </span><span class="hl-var">class</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">first</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">a</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">#</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">yabba</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">a</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">li</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">li</span><span class="hl-brackets">&gt;</span><span class="hl-code">
   </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">a</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">#</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">dabba</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">a</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">li</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">li</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">a</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">#</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">doo</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">a</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">li</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">ul</span><span class="hl-brackets">&gt;</span></pre>
</div>
<p>It&#8217;s an unordered list with a class name &#8220;nav&#8221; (you can skip it and style the <code>ul</code> directly if all lists in your application are of the navigational type) and &#8220;first&#8221; for the first list item. You can also skip &#8220;first&#8221; and use the <code>:first-child</code> pseudo selector if you don&#8217;t care about browsers that don&#8217;t support <code>:first-child</code> (IE comes to mind)</p>
<h3>Styles</h3>
<p>First off, some shade of grey for background and sans-serif font:</p>
<div class="hl-main">
<pre><span class="hl-identifier">body</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  </span><span class="hl-reserved">background:</span><span class="hl-code"> </span><span class="hl-var">#ddd</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">font-family:</span><span class="hl-code"> </span><span class="hl-string">sans-serif</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<p>Then, styling the whole list. We want rounded corners, so <code>border-radius</code> makes this a breeze. Also including Firefox&#8217; (<code>-moz-...</code>) and Safari&#8217;s (<code>-webkit-...</code>) versions for better x-browser compatibility. No form of border-radius in IE, so IE users will see a sharp-edge box. Wrapping up this style with white background, border and no padding.</p>
<div class="hl-main">
<pre><span class="hl-identifier">.nav</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  -</span><span class="hl-reserved">webkit-border-radius:</span><span class="hl-code"> </span><span class="hl-number">15</span><span class="hl-string">px</span><span class="hl-reserved"></span><span class="hl-code">;
  -</span><span class="hl-reserved">moz-border-radius:</span><span class="hl-code"> </span><span class="hl-number">15</span><span class="hl-string">px</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">border-radius:</span><span class="hl-code"> </span><span class="hl-number">15</span><span class="hl-string">px</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">background:</span><span class="hl-code"> </span><span class="hl-var">white</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">border:</span><span class="hl-code"> </span><span class="hl-number">1</span><span class="hl-string">px</span><span class="hl-code"> </span><span class="hl-string">solid</span><span class="hl-code"> </span><span class="hl-var">#aaa</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">padding-left:</span><span class="hl-code"> </span><span class="hl-number">0</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<p>Now styling the individual items in the navigation list. Removing the default list bullet with list-style: none and removing the default padding to the left of the list. Bold font and top border to separate each list item. This will result in two border lines for the first item (one from the item and one from the whole list), bit we&#8217;ll remove it in a sec.</p>
<div class="hl-main">
<pre><span class="hl-identifier">.nav</span><span class="hl-code"> </span><span class="hl-identifier">li</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  </span><span class="hl-reserved">list-style:</span><span class="hl-code"> </span><span class="hl-string">none</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">padding-left:</span><span class="hl-code"> </span><span class="hl-number">0</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">border-top:</span><span class="hl-code"> </span><span class="hl-number">1</span><span class="hl-string">px</span><span class="hl-code"> </span><span class="hl-string">solid</span><span class="hl-code"> </span><span class="hl-var">#aaa</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">font-weight:</span><span class="hl-code"> </span><span class="hl-string">bold</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<p>OK, first list item &#8211; no border, you already have one.</p>
<div class="hl-main">
<pre><span class="hl-identifier">li</span><span class="hl-identifier">.first</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  </span><span class="hl-reserved">border-top:</span><span class="hl-code"> </span><span class="hl-number">0</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<p>Now the clickable nav links. Changing the default display of links to block, so that the whole list item (the whole row) is clickable (ok, touchable). Some padding to make bigger rows, dark shade of gray for link color and saying NO to the underline. Final touch &#8211; the arrow. It&#8217;s an image that we&#8217;ll use as a background and position in the middle on the right-hand side.</p>
<div class="hl-main">
<pre><span class="hl-identifier">.nav</span><span class="hl-code"> </span><span class="hl-identifier">a</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
  </span><span class="hl-reserved">display:</span><span class="hl-code"> </span><span class="hl-string">block</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">padding:</span><span class="hl-code"> </span><span class="hl-number">10</span><span class="hl-string">px</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">color:</span><span class="hl-code"> </span><span class="hl-var">#333</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">text-decoration:</span><span class="hl-code"> </span><span class="hl-string">none</span><span class="hl-reserved"></span><span class="hl-code">;
  </span><span class="hl-reserved">background:</span><span class="hl-code"> </span><span class="hl-code">url</span><span class="hl-code">(</span><span class="hl-code">arrow</span><span class="hl-code">.</span><span class="hl-code">png</span><span class="hl-code">) </span>
<span class="hl-string">no-repeat</span><span class="hl-code"> </span><span class="hl-string">right</span><span class="hl-code"> </span><span class="hl-string">center</span><span class="hl-reserved"></span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
<h3>That&#8217;s all folks!</h3>
<p>Beautiful navigation lists with very little effort, simple semantic markup and only one image. <a href="http://phpied.com/files/iphone/arrow.png">Here&#8217;s the image</a> if you need it (182 bytes).</p>
<h3>Quick optimization update</h3>
<p>Just thought that this little arrow.png is another HTTP request which is bad for <a href="http://developer.yahoo.com/performance/">performance</a>, so you can replace this with a base64-encoded version of the icon and inline it in the CSS. Check view/source of the <a href="http://phpied.com/files/iphone/list64.html">updated example</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/styling-iphone-like-lists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone-like glossy icons</title>
		<link>http://phonydev.com/iphone-like-glossy-icons/</link>
		<comments>http://phonydev.com/iphone-like-glossy-icons/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 10:29:42 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[pixels]]></category>
		<category><![CDATA[glossy]]></category>
		<category><![CDATA[icons]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=20</guid>
		<description><![CDATA[If you want to provide close-to-native iPhone experience in your pages, how about using shiny glossy icons, just like those used on the home screen. You can make any image look like a rounded glossy icon by using: border-radius CSS property an alpha-transparent image overlay For example: Benefits: no image manipulation, just use existing images [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to provide close-to-native iPhone experience in your pages, how about using shiny glossy icons, just like those <a href="http://phonydev.com/apple-touch-icon/">used on the home screen</a>.</p>
<p>You can make any image look like a rounded glossy icon by using:</p>
<ul class="list">
<li>border-radius CSS property</li>
<li>an alpha-transparent image overlay</li>
</ul>
<p>For example:<br />
<img src="http://phonydev.com/files/2009/02/icon-demo.png" alt="glossy icon demo" width="249" height="68" /></p>
<p>Benefits:</p>
<ul class="list">
<li>no image manipulation, just use existing images</li>
<li>graceful degradation &#8211; IE7, 8 don&#8217;t support border radius, so they&#8217;ll display a glossy square image. IE6 has issues with PNG transparency, so I&#8217;m using <a href="http://yuiblog.com/blog/2008/11/04/imageopt-2/">a PNG8 file</a> which IE sees as fully transparent. As a result IE6 will show the image unchanged.</li>
</ul>
<h3>But how does this work?</h3>
<p>Using two divs:</p>
<div class="hl-main">
<pre><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">class</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">the-image</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">class</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">the-mask</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
  </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span></pre>
</div>
<p>How are these styled then?</p>
<ul class="list">
<li>both divs get the width/height of the image</li>
<li>both divs get <code>border-radius: 10px</code> (and the same -moz-border-radius and -webkit-border-radius)</li>
<li>the background of the outer div is the image</li>
<li>the background of the inner div is the mask</li>
</ul>
<p>To make it easy, I&#8217;ve created a script that can generate the overlay mask image with any dimension. The script can be used like this:</p>
<ul class="list">
<li><a href="http://tools.w3clubs.com/mask/mask.php">mask.php</a> will give you a 100&#215;100 pixels image</li>
<li><a href="http://tools.w3clubs.com/mask/mask.php?x=57">mask.php?x=57</a> will produce a 57&#215;57 pixels image</li>
</ul>
<h3>Code and examples</h3>
<ul class="list">
<li>A page with <a href="http://tools.w3clubs.com/mask/testmask.html">examples can be found here</a>. Load in any IE to see degraded experience or Safari/Mozilla/iPhone for the full experience</li>
<li>The code for the script that generates the mask as well as the test page are on <a href="http://github.com/stoyan/etc/tree/master">github</a></li>
</ul>
<p>The PHP <a href="http://github.com/stoyan/etc/blob/e6b31552043716dd72ec4a6aa67a30e764538bb3/mask/mask.php">script that generates the mask</a> is fairly well documented if you want to tweak. The gist of it really is using GD library to create a fully transparent square and a semi-transparent piece of an ellipse.</p>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/iphone-like-glossy-icons/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Apple touch icon</title>
		<link>http://phonydev.com/apple-touch-icon/</link>
		<comments>http://phonydev.com/apple-touch-icon/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 09:47:43 +0000</pubDate>
		<dc:creator>stoyan</dc:creator>
				<category><![CDATA[icon]]></category>
		<category><![CDATA[pixels]]></category>
		<category><![CDATA[apple-touch-icon]]></category>
		<category><![CDATA[favicon]]></category>

		<guid isPermaLink="false">http://phonydev.com/?p=19</guid>
		<description><![CDATA[An iPhone user can add your site to their home screen (and why wouldn&#8217;t they, such a nice site! ). This is done by: visiting your page tapping the + icon selecting &#8220;Add to Home Screen&#8221; When this happens, the iPhone needs to figure out an icon to use for the home screen. It proceeds [...]]]></description>
			<content:encoded><![CDATA[<p>An iPhone user can add your site to their home screen (and why wouldn&#8217;t they, such a nice site! <img src='http://phonydev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). This is done by:</p>
<ol class="list">
<li>visiting your page</li>
<li>tapping the + icon</li>
<li>selecting &#8220;Add to Home Screen&#8221;</li>
</ol>
<p>When this happens, the iPhone needs to figure out an icon to use for the home screen. It proceeds like this:</p>
<ol class="list">
<li>Is there a <code>&lt;link rel="apple-touch-icon" href="..."&gt;</code> tag in the head of your page? If so, the image referenced in the <code>href</code> attribute is used. If not?</li>
<li>Is there in the root of your web server a file called <code>/apple-touch-icon.png</code>. If so, it becomes the icon. If not?</li>
<li>A screenshot of your page is used (scrolled at whatever position it is scrolled at the moment).</li>
</ol>
<p>In all of the cases, the icon is beautified for free by the use of a gloss and rounded corners. It&#8217;s also resized to fit the dimensions of an icon.</p>
<p>So what can you do to better represent your site on the user&#8217;s home? Well, just make sure you have a 57&#215;57 pixel icon and then you:</p>
<ul class="list">
<li>either put it in the root of the server, name it <code>apple-touch-icon.png</code> and forget it, or</li>
<li>name it whetever you want and put it anywhere, including another server or a CDN (Content Delivery Network) for performance purposes. But make sure you refer to the image from your <code>&lt;link rel="apple-touch-icon"..</code> tag</li>
</ul>
<p>I see some sites do both &#8211; name the file <code>apple-touch-icon.png</code>, put it in the root and also add a link tag referring to the file. But that&#8217;s overdoing it a little.</p>
<p>If you don&#8217;t like the default rounded gloss the iPhone uses to beautify your icon and you think you can do better, you have the option to do so by using the filename<br />
<code>apple-touch-icon-precomposed.png</code></p>
<p>Some examples in the wild:</p>
<ul class="list">
<li><a href="http://www.yahoo.com/apple-touch-icon.png">Yahoo! front page</a></li>
<li><a href="http://a.l.yimg.com/a/i/us/sch/gr3/iphone_icon_20080707.png">Yahoo! search</a> for the iPhone</li>
<li><a href="http://iphone.facebook.com/apple-touch-icon.png">Facebook</a> for iPhone</li>
<li><a href="http://s2.wordpress.com/wp-content/themes/h4/i/webclip.png">WordPress</a></li>
<li><a href="http://www.apple.com/apple-touch-icon.png">Apple</a> &#8211; they use a bigger 129&#215;129 pixels icon for whatever reason, after all it&#8217;s their specs that say 57&#215;57</li>
</li>
]]></content:encoded>
			<wfw:commentRss>http://phonydev.com/apple-touch-icon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

