<?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>GirlieMac! Blog &#187; WebKit</title>
	<atom:link href="http://girliemac.com/blog/category/webkit/feed/" rel="self" type="application/rss+xml" />
	<link>http://girliemac.com/blog</link>
	<description>Web and Mobile Development</description>
	<lastBuildDate>Thu, 29 Mar 2012 22:56:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Creating Non-disruptive Notifications with HTML5</title>
		<link>http://girliemac.com/blog/2012/03/29/creating-non-disruptive-notifications-with-html5/</link>
		<comments>http://girliemac.com/blog/2012/03/29/creating-non-disruptive-notifications-with-html5/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 20:59:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=476</guid>
		<description><![CDATA[The HTML5 Web Notifications API (now available on Chrome) allows you to display the Growl-like notification windows outside of the web browser window. Unlike the alert dialog, [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2012%252F03%252F29%252Fcreating-non-disruptive-notifications-with-html5%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2F7wfyFL%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Creating%20Non-disruptive%20Notifications%20with%20HTML5%22%20%7D);"></div>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2012/03/notifications.png" alt="web notifications" title="notifications" class="aligncenter" /></p>
<p>The <strong>HTML5 Web Notifications API</strong> (now available on Chrome) allows you to display the Growl-like notification windows outside of the web browser window. Unlike the alert dialog, the notification windows do not disrupt a user&#8217;s action, or requires extra user interactions.</p>
<p>Using the API is quite simple, so I tried to replicate the infamous webOS notification system in HTML5. (In case you are not familiar with webOS UI and UX, see it on <a href="http://www.youtube.com/watch?v=G8tFODkacak" target="_blank">YouTube</a>). </p>
<p>Live demo: <a href="http://girliemac.github.com/html5-notifications-webOS-style" target="_blank">http://girliemac.github.com/html5-notifications-webOS-style</a></p>
<h2>Basic Notifications</h2>
<p>First, check if the browser supports the API, by looking for the Notifications property.</p>
<pre class="js">
if (window.webkitNotifications)
</pre>
<p>Apparently, it is only supported by WebKit-based browser (well, Chrome, so far) so you need to add the vender prefix, instead of just <code>webkitNotifications</code>.</p>
<p>Next, your script needs to requests the user agent to ask a user for permission to show notifications. If you are already familiar with the <em>geolocation</em> API, you have seen the &#8220;Info bar&#8221; on top of the browser.</p>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2012/03/notifications-permission.png" alt="permission bar" title="notifications-permission" /></p>
<p>To request the permission by <code>requestPermission()</code>, you must invoke some event from a user, such as mouse click. See the example below:</p>
<pre>
document.getElementById('#someButton').addEventListener('click', function() {
  // check if a permission is set allowed
  if (window.webkitNotifications.checkPermission() == 0) { // Allowed
    // do show the notifications
  } else {
    // request a user permission
    window.webkitNotifications.requestPermission();
  }
}, false);
</pre>
<p>There are two ways to create the notifications &#8211; plain text or html.</p>
<p>1. Plain text- use <code>createNotification</code> function that takes three optional params, icon image, title, and text:</p>
<pre>
var notification = window.Notifications.createNotification(
  'avatar.png',
  'New tweet from @girlie_mac',
  'OMG, a glass of water! http://instagr.am/p/...'
);
</pre>
<p>2. HTML &#8211; use <code>createHTMLNotification</code> to include an external html file:</p>
<pre>
var notification = window.webkitNotifications.createHTMLNotification('tweet.html');
</pre>
<p>To show the notification:</p>
<pre>
notification.show();
</pre>
<p>Also, you can use the <code>cancel</code> method to close the notifications if you wish. This example below let the notification close by itself 5 second after it is displayed:</p>
<pre>
notification.ondisplay = function(event) {
  setTimeout(function() {
    event.currentTarget.cancel();
    }, 5000);
}
</pre>
<p>Besides the <code>ondisplay</code>, other event handlers available are:<br />
<code>onclick</code>, <code>onshow</code>, <code>onerror</code>, and <code>onclose</code>.</p>
<p>In my demo, I used the HTML notifications because only the HTML notification style allows you to fully customize the UI with CSS and add some UX with JavaScript.<br />
To create the webOS-esque &#8220;slide-to-dismiss&#8221; effect, I used jQuery UI&#8217;s draggable and droppable. (I attempted to use the HTML5 drag and Drop, but for some reasons, I could not successfully make my code work within the notification window, although the code does work in a regular window.)<br />
The source code is on <a href="https://github.com/girliemac/html5-notifications-webOS-style" target="_blank">github</a>.</p>
<p>Hopefully, this API will be available on other browsers. (And Klout will replace the modal dialogs from hell to something more subtle like the web notifications in future. Can you believe once they had me to close seven modals after logging in? This has to be stopped no matter what.)</p>
<h2>References</h2>
<p><a href="<br />
http://dev.w3.org/2006/webapi/WebNotifications/publish/" target="_blank">W3C Draft</a><br />
<a href="http://www.chromium.org/developers/design-documents/desktop-notifications/api-specification" target="_blank">Chromium API Specification</a><br />
<a href="http://www.html5rocks.com/en/tutorials/notifications/quick/" target="_blank">HTML5 ROCKS</a></p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2012/03/29/creating-non-disruptive-notifications-with-html5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick Fun: CSS3 Filter Effects</title>
		<link>http://girliemac.com/blog/2011/12/21/quick-fun-css3-filter-effects/</link>
		<comments>http://girliemac.com/blog/2011/12/21/quick-fun-css3-filter-effects/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 23:30:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=411</guid>
		<description><![CDATA[I quickly played with the brand-new CSS Filter Effects on the latest WebKit Nightly! (Edited: and Chrome Canary 18.0.976.0 +) Click the images to view in the [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2011%252F12%252F21%252Fquick-fun-css3-filter-effects%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2Fww3fYB%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Quick%20Fun%3A%20CSS3%20Filter%20Effects%22%20%7D);"></div>
<p>I quickly played with the brand-new <a href="https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html" target="_blank">CSS Filter Effects</a> on the latest <a href="http://nightly.webkit.org" target="_blank">WebKit Nightly</a>! (Edited: and <a href="http://tools.google.com/dlpage/chromesxs" target="_blank">Chrome Canary</a> 18.0.976.0 +)</p>
<p>Click the images to view in the full size.</p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/default.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/default-300x235.png" alt="no filter" title="no filter" width="300" height="235" class="alignleft size-medium wp-image-412" /></a><br />
This is a default google.com screen.<br />
No filter added.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/blur-2px.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/blur-2px-300x235.png" alt="filter:blur(2px)" title="filter:blur(2px)" width="300" height="235" class="alignleft size-medium wp-image-413" /></a><br />
<strong>blur(radius)</strong> to create Gaussian blur</p>
<pre class="css">
-webkit-filter: blur(2px);
</pre>
<p>The default is 0, no blur.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/brightness-30.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/brightness-30-300x235.png" alt="filter:brightness(30%)" title="filter:brightness(30%)" width="300" height="235" class="alignleft size-medium wp-image-416" /></a><br />
<strong>brightness(amount)</strong></p>
<pre class="css">
-webkit-filter: brightness(<del>30%</del>);
</pre>
<p><del>The default is 100%. Values of amount over 100% are allowed.</del><br />
<strong>Updated</strong>: I am not sure when it has modified, but it seems that not the accepted value is the range between -100% (dark) and 100% (light), and the default is 0.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/contrast-30.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/contrast-30-300x235.png" alt="filter:contrast(30%)" title="filter:contrast(30%)" width="300" height="235" class="alignleft size-medium wp-image-418" /></a><br />
<strong>contrast(amount)</strong></p>
<pre class="css">
-webkit-filter: contrast(30%);
</pre>
<p>The default is 100%. Values of amount over 100% are allowed.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/grayscale-100.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/grayscale-100-300x235.png" alt="filter:grayscale(100%)" title="filter:grayscale(100%)" width="300" height="235" class="alignleft size-medium wp-image-419" /></a><br />
<strong>grayscale(amount)</strong></p>
<pre class="css">
-webkit-filter: grayscale();
</pre>
<p>The default is 100%.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/sepia-100.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/sepia-100-300x235.png" alt="filter:sepia(100%)" title="filter:sepia(100%)" width="300" height="235" class="alignleft size-medium wp-image-420" /></a><br />
<strong>sepia(amount)</strong></p>
<pre class="css">
-webkit-filter: sepia();
</pre>
<p>The default is 100%.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/invert-100.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/invert-100-300x235.png" alt="filter:invert(100%)" title="filter:invert(100%)" width="300" height="235" class="alignleft size-medium wp-image-421" /></a><br />
<strong>invert(amount)</strong></p>
<pre class="css">
-webkit-filter: invert();
</pre>
<p>The default is 100%.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/opacity-30.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/opacity-30-300x235.png" alt="filter:opacity(30%)" title="filter:opacity(30%)" width="300" height="235" class="alignleft size-medium wp-image-422" /></a><br />
<strong>opacity(amount)</strong></p>
<pre class="css">
-webkit-filter: opacity(30%);
</pre>
<p>The default is 100%, no transparency.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/saturate-50.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/saturate-50-300x235.png" alt="filter:saturate(50%)" title="filter:saturate(50%)" width="300" height="235" class="alignleft size-medium wp-image-423" /></a><br />
<strong>Saturate(amount)</strong></p>
<pre class="css">
-webkit-filter: saturate(50%);
</pre>
<p>The default is 100%.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/saturate-300.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/saturate-300-300x235.png" alt="filter:saturate(300%)" title="filter:saturate(300%)" width="300" height="235" class="alignleft size-medium wp-image-436" /></a><br />
<strong>Saturate(amount)</strong> &#8211; the amount over 100% is also allowed.</p>
<pre class="css">
-webkit-filter: saturate(300%);
</pre>
<p><br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/hue-rorate-90deg.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/hue-rorate-90deg-300x235.png" alt="filter:hue-rotate(90deg)" title="filter:hue-rotate(90deg)" width="300" height="235" class="alignleft size-medium wp-image-424" /></a><br />
<strong>hue-rotate(angle)</strong></p>
<pre class="css">
-webkit-filter: hue-rotate(90deg);
</pre>
<p>The default is 0deg.<br />
<br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/hue-rorate-300deg.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/hue-rorate-300deg-300x235.png" alt="filter:hue-rotate(300deg)" title="filter:hue-rotate(300deg)" width="300" height="235" class="alignleft size-medium wp-image-425" /></a><br />
<strong>hue-rotate(angle)</strong></p>
<pre class="css">
-webkit-filter: hue-rotate(300deg);
</pre>
<p><br clear="all" /></p>
<p><a href="http://girliemac.com/blog/wp-content/uploads/2011/12/drop-shadown-on-toolbar.png"><img src="http://girliemac.com/blog/wp-content/uploads/2011/12/drop-shadown-on-toolbar-300x235.png" alt="filter:drop-shadow(...)" title="filter:drop-shadow(...)" width="300" height="235" class="alignleft size-medium wp-image-441" /></a><br />
<strong>drop-shadow(&lt;shadow&gt;)</strong></p>
<pre class="css">
/* Adding Drop-shadow on the toolbar at the top */

#bg {
  -webkit-filter: drop-shadow(rgba(0,0,0,0.5) 0 5px 5px);
}
</pre>
<p><br clear="all" /></p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2011/12/21/quick-fun-css3-filter-effects/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Five CSS tricks used in Enyo JS Framework, and you can try them too!</title>
		<link>http://girliemac.com/blog/2011/07/29/five-css-tricks-used-in-enyo/</link>
		<comments>http://girliemac.com/blog/2011/07/29/five-css-tricks-used-in-enyo/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 03:08:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=264</guid>
		<description><![CDATA[Since I have joined Palm (now HP), I don&#8217;t blog frequently because working for the webOS have kept me super busy. Especially when working on the webOS [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2011%252F07%252F29%252Ffive-css-tricks-used-in-enyo%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2F0BiS8L%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Five%20CSS%20tricks%20used%20in%20Enyo%20JS%20Framework%2C%20and%20you%20can%20try%20them%20too%21%22%20%7D);"></div>
<p>Since I have joined Palm (now HP), I don&#8217;t blog frequently because working for the webOS have kept me super busy. Especially when working on the webOS 3.0 for the Touchpad tablet, I have been in multiple teams until I switched my position to commit for the Developer Relations team.
</p>
<p>Anyway, in case you are not familiar with webOS and Enyo &#8211; webOS is a mobile platform running on Linux kernel/ webkit UI with V8 engine, so most of core apps are either written in JS and CSS, or native C/C++. And the JS framework for 3.0 is called <em><strong>Enyo</strong></em>.  Basically working on the webOS framework and apps is just like developing web (in fact, I use Chrome for development).  So here, I want to share some cool CSS tracks used in the framework!
</p>
<h2>1. Flexible Box Model</h2>
<p>Enyo&#8217;s basic UI is created with using the <a href="http://www.w3.org/TR/css3-flexbox/" target="_blank">CSS3 flexible box model</a>.<br />
You no longer have to worry about all the <code>float</code> craziness. I actually have written an article, <strong><a href="http://developer.palm.com/blog/2011/07/css-3-flexible-box-model-and-enyo-flex-layout/" target="_blank">CSS 3 Flexible Box Model and Enyo Flex Layout</a></strong> for webOS Developer Blog too, so please read it too!
</p>
<h4>Example:</h4>
<p>When you want to achieve a layout that has an avatar at the left, and two lines of a person&#8217;s info at the right side like this,<br/> </p>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2011/07/flexbox-tweets.png" alt="flex box demo" title="flexbox-tweets" style="border: 1px dotted #ccc; border-radius: 10px; padding:.5em" /><br/></p>
<p>You can create this UI without float if the browser support flex-box:</p>
<pre class="html">
&lt;div class="tweet"&gt;
  &lt;div class="tweet-avatar"&gt;&lt;img src="avatar.png"&gt;&lt;/div&gt;
  &lt;div class="tweet-contents"&gt;
    &lt;div class="tweet-username"&gt;@n00b_css3_user&lt;/div&gt;
    &lt;div class="tweet-text"&gt;Hello, world. CSS3 Flexbox is cool.&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<pre class="css">
.tweet {
  display: -webkit-box;
  -webkit-box-orient: horizontal;
}

.tweet-contents {
  margin-left: .5em;
  display: -webkit-box;
  -webkit-box-flex: 1;
  -webkit-box-orient: vertical;
  -webkit-box-pack: center;
}
</pre>
<p>Note: this is an original spec from 2009 and this is what browsers currently support (if they do), and likely to keep supporting. I have no idea why the spec has been completely re-written recently, but so far no browsers support the new specs.</p>
<h2>2. Root Em </h2>
<p>There is a new unit in CSS, <strong><code>rem</code></strong> unit, which stands for &#8220;root em&#8221;. The sizing only with <code>em</code> could be troublesome because how it relates to the parent&#8217;s font-size. However, the <code>rem</code> is relative to the root, which is html.<br />
In Enyo framework, the root font size is set to 20px. So by using <code>rem</code>, you can set its children font-size easily without being affected by their parents.
</p>
<p>
Here&#8217;s a comparison of em and rem:
</p>
<pre class="html">
&lt;div class="container"&gt;
  &lt;p class="subdue"&gt;48 minutes ago&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>With <code>em</code></p>
<pre class="css">
html {font-size: 20px;}
.container {font-size: .8em}
.subdue {font-size: .75em} /* the font size = 12px (20 x .8 x .75) */
</pre>
<p>With <code>rem</code></p>
<pre class="css">
html {font-size: 20px;}
.container {font-size: .8em}
.subdue {font-size: .75rem} /* the font size = 15px (20 x .75) */
</pre>
<h2>3. Pointer-events</h2>
<p>This is a little obscure and simple trick not everybody has known, and a secret(?) trick I have been using since the earlier webOS framework called Mojo.<br />
The <code>pointer-events</code> property was originally defined for SVG content, and later adopted as a CSS property.<br />
For CSS, there are only two values: <code>auto</code> or <code>none</code>.<br />
You can control the target of the mouth event, and by setting this value none, the element is no longer a target of mouse events, so when a user click the element, it pass through to its descendant during the event bubbling.
</p>
<pre class="html">
&lt;div style="position:relative"&gt;
  &lt;div class="overlay"&gt;&lt;/div&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href=""&gt;link 1 on fading list&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;link 2 on fading list&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;link 3 on fading list&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;div&gt;
</pre>
<pre class="css">
.overlay {
  pointer-events: none;
}
</pre>
<p>
The screenshots at left indicates that when the <code>pointer-events</code> property value is not set (default), the first link underneath of the visual overlay is not clickable, and when it is set none, the element becomes clickable (right).
</p>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2011/07/pointer-events.png" alt="pointer-events demo" title="pointer-events" /></p>
<p>
The demo: <a href="http://jsfiddle.net/girlie_mac/7TvVY/" target="_blank">http://jsfiddle.net/girlie_mac/7TvVY/</a>
</p>
<h2>4. border-image with sprites</h2>
<p>
You have seen some demos how to use the CSS3 <code>border-image</code>.<br />
But making multiple assets used for <code>border-image</code> is trivial because how an image needs to be &#8220;sliced&#8221; into 9 tiles with css.<br />
However, if an each asset in the sprites only requires into 3 tiles. (For example, [static-left] [stretchable center] [static-right], and top and bottom borders are zero, you can create a single sprite image of multiple states of a button, and still be able to achieve the <code>border-image</code>.
</p>
<pre class="css">
.alert-button {
  /* notice the fat border-bottom */
  -webkit-border-image: url(images/alert-button.png) 0 14 111 14 repeat repeat;

  /* notice that border-top and bottom are set zero */
  border-width: 0 14px;

  /* some visual styling here */
  -webkit-box-sizing: border-box;
  height: 37px;
  line-height: 37px;
}

.alert-button:active {
  /* the fat border-top and bottom adjusted */
  -webkit-border-image: url(images/alert-button.png) 37 14 74 14 repeat repeat;
}
</pre>
<p>
<img src="http://girliemac.com/blog/wp-content/uploads/2011/07/border-img-button1.png" alt="border-image demo" title="border-img-button" width="588" height="574" class="alignleft size-full wp-image-313" />
</p>
<p>
The demo: <a href="http://jsfiddle.net/girlie_mac/89C2T/" target="_blank">http://jsfiddle.net/girlie_mac/89C2T/</a>
</p>
<h2>5. Hardware acceleration</h2>
<p>
WebKit enables hardware-acceleration to render CSS 3D transforms. Although some WebKit (like webOS) may not render 3D visuals correctly, it still uses the GPU to speed up. So all you need to take advantage of this is to use the <code>-webkit-transform</code> <a href="http://www.w3.org/TR/css3-3d-transforms/" target="_blank">CSS property</a>!<br />
The easiest possible way to achieve it is using <code>translate3d</code> instead of <code>translate</code> (also <code>scale3d</code> instead of <code>scale</code>), although you are not intend to make your web in 3D visual effect.
</p>
<pre class="css">
.toaster {
  -webkit-transform: translate3d(0,0,0);
}
</pre>
<p>or just set only the z-axis:</p>
<pre class="css">
.toaster {
  -webkit-transform: translateZ(0);
}
</pre>
<p><br/></p>
<p>I hope some of the stuff I just wrote are new to you!<br />
There are more fun stuff I can write about Enyo JS framework, but I keep them for the official <a href="http://developer.palm.com/blog" target="_blank">HP webOS Dev Blog</a>!</p>
<p>Bye now!</p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2011/07/29/five-css-tricks-used-in-enyo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Open Web Camp III</title>
		<link>http://girliemac.com/blog/2011/07/19/open-web-camp-iii/</link>
		<comments>http://girliemac.com/blog/2011/07/19/open-web-camp-iii/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 01:18:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[GirlieMac! News]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[WAP]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[WinMo]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=244</guid>
		<description><![CDATA[I had this wonderful opportunity to speak at OpenWebCamp III at Stanford University on this weekend, and I feel very honor to be there with so many [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2011%252F07%252F19%252Fopen-web-camp-iii%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2FpQQxJS%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Open%20Web%20Camp%20III%20%23mobile%20%23w3c%22%20%7D);"></div>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2011/07/owc-logo-orig.png" alt="owc-logo" />
<p>I had this wonderful opportunity to speak at <a href="http://openwebcamp.org/" target="_blank">OpenWebCamp III</a> at Stanford University on this weekend, and I feel very honor to be there with so many great speakers and attendees. </p>
<p>Apparently, I have been doing mobile development longer than most of people, I picked the subject on developing mobile web, and how it has been changed and what we can do next.</p>
<p>I covered the topics including:</p>
<ul>
<li>How the mobile development has changed from WML, XHTML-MP, HTML4 and finally HTML5 with CSS3
<li>Legacy to HTML5: using input attributes to make easier for a user to type on phone
<li>Dealing with smarter phones: Viewport and Media-queries
<li>High DPI display: CSS pixel != Device pixel
<li>Device API
</ul>
<p><a href="http://girliemac.com/slides/owc3/" target="_blank">My slides, &#8220;WAP to HTML5: Mobile web &#8211; past, present, and future&#8221; is available in html5</a>, not Powepoint or Keynotes so I couldn&#8217;t post it on SlideShare!</p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2011/07/19/open-web-camp-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Demo: CSS3 Fancy Avatar</title>
		<link>http://girliemac.com/blog/2011/02/17/quick-demo-css3-fancy-avatar/</link>
		<comments>http://girliemac.com/blog/2011/02/17/quick-demo-css3-fancy-avatar/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 06:27:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=225</guid>
		<description><![CDATA[Now I started using jsfiddle for code snippets so I can show the code AND the actual results on browsers. This fancy avatar frame is created pretty [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2011%252F02%252F17%252Fquick-demo-css3-fancy-avatar%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2Fvkqh04%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Quick%20Demo%3A%20CSS3%20Fancy%20Avatar%20%23css3%22%20%7D);"></div>
<p><img src="http://girliemac.com/blog/wp-content/uploads/2011/02/css3-avatar.png" alt="css3-avatar" title="css3-avatar" width="413" height="106" class="aligncenter size-full wp-image-227" /></p>
<p>Now I started using jsfiddle for code snippets so I can show the code AND the actual results on browsers.</p>
<p><iframe style="width: 100%; height: 260px" src="http://jsfiddle.net/girlie_mac/cQ99J/embedded/css,html,result"></iframe></p>
<p>This fancy avatar frame is created pretty easily by using CSS box-shadow inset values.<br />
Basically, what I did is that giving a div container (with an avatar picture as a background image) an inset shadow to bottom/right, and glare to top/left. Oh and added border-radius for the rounded corners.</p>
<p>This works without the vendor-specific extensions on latest Firefox, Chrome, Webkit Nightly, and Opera. Safari 5 still requires <code>-webkit</code> extension to make the box-shadow work.</p>
<p>Really easy and practical!</p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2011/02/17/quick-demo-css3-fancy-avatar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick Demo: Webkit CSS3 Mask with SVG</title>
		<link>http://girliemac.com/blog/2010/09/20/201/</link>
		<comments>http://girliemac.com/blog/2010/09/20/201/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 00:27:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[svg]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=201</guid>
		<description><![CDATA[I haven&#8217;t got a chance to create the apps and demos I&#8217;ve been thinking because my day job at Palm has kept me really busy. (Yeah, we&#8217;re [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2010%252F09%252F20%252F201%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2F19wIpL%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Quick%20Demo%3A%20Webkit%20CSS3%20Mask%20with%20SVG%20%23css3%20%23svg%22%20%7D);"></div>
<p>I haven&#8217;t got a chance to create the apps and demos I&#8217;ve been thinking because my day job at Palm has kept me really busy. (Yeah, we&#8217;re shipping webOS 2.0 pretty soon!)<br />
So instead of writing a new material, I decided to post the stuff I was testing around a while ago because SVG seems to be a hot topic since the HTML5 buzz!</p>
<p><img src="http://girliemac.com/blog/wp-content/images/svg-mask.png" align="right"/>This is an example of CSS mask with SVG. -The CSS alpha mask is introduced by <a href="http://webkit.org/blog/181/css-masks/" target="_blank">Webkit.org</a> back in 2008.</p>
<p>And this image at the right is a screen capture from WebKit Nightly browser. The photo I use here is a Twitter avatar photo of <a href="http://twitter.com/SOCKINGTON" target="_blank">@sockington</a>, masked with an <a href="http://girliemac.com/sandbox/svg/twitter-bird-new.svg">SVG file</a> (I used the vector image created by <a href="http://eagl0r.deviantart.com/#/d2yth6g" target="_blank">eagl0r</a> on DeviantArt and converted it as as SVG with Adobe Illustrator) with using Webkit-only CSS 3 property, <code style="font-weight:bold">-webkit-mask</code>.
</p>
<p>
<a href="http://girliemac.com/sandbox/mask.html" target="_blank">The actual demo is here.</a><br />
This works only on advanced webkit-browsers with SVG support, such as Safari 4+ and Chrome 2+ (not sure. I need to check). Android webkit browsers currently do not support SVG.<br />
For non-supporting browsers, you should just see three rectangle pictures as fallback. Nothing should look broken.
</p>
<h3>The code is Simple</h3>
<pre class="html">
<code>
&lt;img class="avatar" src="avatar-pic.png"/&gt;
</code>
</pre>
<pre class="css">
<code>
.avatar {
  -webkit-mask-box-image: url(twitter-bird.svg);
}
</code>
</pre>
<p>I used <code>mask-box-image</code> instead of <code>mask-image</code> to make the mask stretch to fit with various image sizes and aspect ratio. <code>mask-image</code> repeats the mask images as patterns (also you can specify the type of repeat, and position etc. I am not going to talk about them here but you can read on the reference link below).<br />
<h3>Reference</h3>
<p><strong>Surfin&#8217; Safari (webkit.org)</strong> &#8211; <a href="http://webkit.org/blog/181/css-masks/"  target="_blank"> CSS Masks</a></p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2010/09/20/201/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simulating MacOS Dock-like menu with CSS3</title>
		<link>http://girliemac.com/blog/2010/06/02/simulating-macos-dock-like-menu-with-css3/</link>
		<comments>http://girliemac.com/blog/2010/06/02/simulating-macos-dock-like-menu-with-css3/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 06:14:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=173</guid>
		<description><![CDATA[Since my original &#8220;CSS Aqua button&#8221; written last year, I have seen more and more fan CSS3 UI mimic of MacOS components around! I think I have [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2010%252F06%252F02%252Fsimulating-macos-dock-like-menu-with-css3%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Simulating%20MacOS%20Dock-like%20menu%20with%20CSS3%22%20%7D);"></div>
<p><img src="http://girliemac.com/blog/wp-content/images/dock-screenshot.jpg" alt="css3 Dock screenshot"/></p>
<p>
Since my original &#8220;CSS Aqua button&#8221; written last year, I have seen more and more fan CSS3 UI mimic of MacOS components around! I think I have seen some Mac docks too, but as I remember they all use jQuery.<br />
So I was thinking about making one only with CSS.
</p>
<p>Initially I thought it was easy &#8211; let&#8217;s make an hovered icon larger like 200%, and make siblings in 150% of the original size using CSS sibling selector, and done! A piece of cake, huh? &#8211; Then I realized I made a mistake. The adjacent-sibling selector apply to an element which is immediately <em>after</em> the element in markup, not both before and after.<br />
Oh well, so I needed to write a minimal JavaScript (so you don&#8217;t need to import a whole JS library) to add a class name to the element comes before the hovered object.</p>
<p>Anyway, here&#8217;s the <a href="http://girliemac.com/sandbox/dock.html" target="_blank">live-demo!</a> (Try it with the the latest Webkit Nightly or Safari 4) for the best experience!), and I&#8217;ll show you how I did-
</p>
<h3>Markup (Simplified)</h3>
<p>Let&#8217;s create menu items as a list.</p>
<pre class="html">
<code>
&lt;div id="dock-container"&gt;
  &lt;div id="dock"&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href="http://android.com"&gt;&lt;img src="images/dock-icons/android.png"/>&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://palm.com"&gt;&lt;img src="images/dock-icons/palm.png"/&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;...
  &lt;/ul&gt;
  &lt;div class="base"&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code>
</pre>
<p>The list should be displayed horizontally by setting the style to <code>#dock li {display:inline-block}</code>. Please see the source code from the demo for the details.
</p>
<h3>Magnify the icon with CSS transform</h3>
<p>
<img style="border:1px solid #666;" src="http://girliemac.com/blog/wp-content/images/dock-tutorial.png" align="right"/>First, let&#8217;s define the dock icon animation with css transition.<br />
The origin of the transform has to set to bottom, so the icon doesn&#8217;t scale from the middle of the icon. (Diagram #1).</p>
<p>I used only a webkit extension for this example but you can use <code>-moz</code> and <code>-o</code> extensions, for Firefox and Opera respectively.</p>
<p>Then, set the hover state &#8211; use css transform to scale the icon image up to 200%. Also you need to add some margin otherwise the enlarged icon overlaps with neighboring icons!
</p>
<pre class="css">
<code>
#dock li img {
  width: 64px;
  height: 64px;
  -webkit-box-reflect: below 2px
		    -webkit-gradient(linear, left top, left bottom, from(transparent),
		    color-stop(0.7, transparent), to(rgba(255,255,255,.5))); /* reflection is supported by webkit only */
  -webkit-transition: all 0.3s;
  -webkit-transform-origin: 50% 100%;
}
#dock li:hover img {
  -webkit-transform: scale(2);
  margin: 0 2em;
}
</code>
</pre>
<h3>Magnify adjacent icons</h3>
<pre class="css">
<code>
#dock li:hover + li img,
#dock li.prev img {
  -webkit-transform: scale(1.5);
  margin: 0 1.5em;
}
</code>
</pre>
<p>To magnify the icon at the right hand side of the hovered icon (Diagram #2), all you need to do is define the scale with using a CSS adjacent-sibling selector, E + F (an F element immediately preceded by an E element).</p>
<p>For the icon at the left (Diagram #3), ss I mentioned earlier, there is no css to get the <em>previous</em> sibling, so I need to rely on JavaScript.<br />
I used the DOM node interface, <code>previousElementSibling</code> to access the sibling node. <code>previousElementSibling</code> should be supported by Webkit, Opera and Firefox.</p>
<p>Basically what I am doing here is that get the mouseovered object (should be an img element), find the parent li element (the immediate parent should be an a-alement, not a li, so get a&#8217;s parent! Check the HTML code again!), find the previous sibling li, then give a classname &#8220;prev&#8221; so I can apply the style.<br />
Don&#8217;t forget to remove the class name as mouseout, otherwise the icon stays large.
</p>
<pre class="js">
<code>
function addPrevClass (e) {
  var target = e.target;
    if(target.getAttribute('src')) { // check if it is img
      var li = target.parentNode.parentNode;
      var prevLi = li.previousElementSibling;
      if(prevLi) {
        prevLi.className = 'prev';
      }

      target.addEventListener('mouseout', function() {
        prevLi.removeAttribute('class');
      }, false);
  }
}
if (window.addEventListener) {
  document.getElementById("dock").addEventListener('mouseover', addPrevClass, false);
}
</code>
</pre>
<p>For more details with the fancy CSS3 effects (e.g. the gradient and 3D-transform to create the &#8220;base&#8221; of the dock), please see the source code of the <a href="http://girliemac.com/sandbox/dock.html" target="_blank">demo page!</a></p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2010/06/02/simulating-macos-dock-like-menu-with-css3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>CSS3 Box-Shadow with Inset Values &#8211; The Aqua Button ReReVisited!</title>
		<link>http://girliemac.com/blog/2010/02/04/css3-box-shadow-with-inset-values-the-aqua-button-rerevisited/</link>
		<comments>http://girliemac.com/blog/2010/02/04/css3-box-shadow-with-inset-values-the-aqua-button-rerevisited/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 05:22:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=151</guid>
		<description><![CDATA[This is my third article on CSS3 No Image Aqua Buttons. The previous articles include: CSS3 Gradients: No Image Aqua Button CSS3 Aqua Button – Revisited for [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2010%252F02%252F04%252Fcss3-box-shadow-with-inset-values-the-aqua-button-rerevisited%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22CSS3%20Box-Shadow%20with%20Inset%20Values%20-%20The%20Aqua%20Button%20ReReVisited%21%20%22%20%7D);"></div>
<p><a href="http://girliemac.com/sandbox/button.html"><img alt="Screenshot ot CSS Aqua buttons" src="http://girliemac.com/blog/wp-content/images/screenshot_css3button_2.png" title="Screenshot" width="224" height="135" align="right" /></a></p>
<p>This is my third article on CSS3 No Image Aqua Buttons. The previous articles include:</p>
<ol>
<li><a href="http://girliemac.com/blog/2009/04/30/css3-gradients-no-image-aqua-button/" target="_blank">CSS3 Gradients: No Image Aqua Button</a></li>
<li><a href="http://girliemac.com/blog/2010/01/28/css3-aqua-button-revisited-for-firefox-3-6/" target="_blank">CSS3 Aqua Button – Revisited for Firefox 3.6</a></li>
<li>And this one &#8211; Read on!</li>
</ol>
<p>Since Smashing Magazine has selected the original Aqua button demo for their article, <a href="http://www.smashingmagazine.com/2010/02/01/50-brilliant-css3-javascript-coding-techniques/" target="_blank">&#8220;50 Brilliant CSS3/JavaScript Coding Techniques&#8221;</a>, I have had so much more visitors to my blog. </p>
<p>This resulted quality developers leave useful comments and tips for me &#8211; thank you, <a href="http://girliemac.com/blog/2010/01/28/css3-aqua-button-revisited-for-firefox-3-6/#comment-1411" target="_blank">Zoley</a> for suggesting using <code>box-shadow</code> with the <em>inset</em> value, and a big thank you to <a href="http://girliemac.com/blog/2010/01/28/css3-aqua-button-revisited-for-firefox-3-6/#comment-1428" target="_blank">Jim</a> for actually re-writing the Aqua button with the technique!!!</p>
<p>So, now the CSS3 Aqua button is revised with semantic markup (no more &#8220;glare&#8221; div! Yes, I complained it by myself before!) and shorter CSS.<br />
And this time, no CSS gradients! &#8211; use CSS <code>box-shadow</code> property with multiple <em>inset</em> values to draw layers of inner-shadows to create the visual effect.</p>
<h3>Syntax</h3>
<p><code>(-moz-)box-shadow:  none | &lt;shadow&gt; [,&lt;shadow&gt;]*    where &lt;shadow&gt; is defined as:  inset? &#038;&#038; [ &lt;offset-x&gt; &lt;offset-y&gt; &lt;blur-radius&gt;? &lt;spread-radius&gt;? &#038;&#038; &lt;color&gt;? ]<br />
</code></p>
<h3>Values</h3>
<p>from <a href="https://developer.mozilla.org/en/CSS/-moz-box-shadow" target="_blank">Mozilla Developer Center</a>:</p>
<blockquote><p>
<strong>inset (optional)</strong><br />
If not specified (default), the shadow is assumed to be a drop shadow (as if the box were raised above the content).<br />
The presence of the <code>inset</code> keyword changes the shadow to one inside the frame (as if the content was depressed inside the box). Inset shadows are drawn above background, but below border and content.<br/><br />
<strong>&lt;color&gt; (optional)</strong><br />
If not specified, the color depends on the browser. In Gecko (Firefox), the value of the <code>color</code> property is used. Safari&#8217;s shadow is transparent and therefore useless if &lt;color&gt; is omitted.<br/><br />
<strong>&lt;offset-x&gt; &lt;offset-y&gt; (required)</strong><br />
This are two &lt;length&gt; values to set the shadow offset. &lt;offset-x&gt; specifies the horizontal distance. Negative values place the shadow to the left of the element. &lt;offset-y&gt; specifies the vertical distance. Negative values place the shadow above the element.<br />
If both values are 0, the shadow is placed behind the element (and may generate a blur effect if &lt;blur-radius&gt; and/or &lt;spread-radius&gt; is set).<br/><br />
<strong>&lt;blur-radius&gt; (optional)</strong><br />
This is a third &lt;length&gt; value. The higher this value, the bigger the blur, so the shadow becomes bigger and lighter. If not specified, it will be 0.<br/><br />
<strong>&lt;spread-radius&gt; (optional)</strong><br />
This is a fourth &lt;length&gt; value. Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. If not specified, it will be 0 (the shadow will be the same size as the element).<br />
<strong></strong><br/>
</p></blockquote>
<p>Note &#8211; The <code>box-shadow</code> property has been removed from <a href="http://www.w3.org/TR/css3-background/#the-box-shadow" target="_blank">W3C CSS3 Background</a> Candidate recommendation document.</p>
<h3>The Entire Code!</h3>
<p>Use <code>-moz</code> and <code>-webkit</code> prefix for <code>box-shodow</code> to support these browsers. For Opera, there&#8217;s no need to add <code>-o</code>.</p>
<p>Also, notice there are three <code>inset</code> values are defined for detailed visual effects!</p>
<pre class="html">
<code>
&lt;input type="button" class="new-aqua" value="Login"/&gt;
</code>
</pre>
<pre class="css">
<code>
input[type=button].new-aqua {
  width: 155px;
  height: 35px;
  background: #cde;
  border: 2px solid #ccc;
  border-color: #8ba2c1 #5890bf #4f93ca #768fa5;
  font: 600 16px/1 Lucida Sans, Verdana, sans-serif;
  color: #fff;
  text-shadow: rgba(10, 10, 10, 0.5) 1px 2px 2px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  border-radius: 16px; -moz-border-radius: 16px; -webkit-border-radius: 16px;
  box-shadow: 0 10px 16px rgba(66, 140, 240, 0.5), inset 0 -8px 12px 0 #6bf, inset 0 -8px 0 8px #48c, inset 0 -35px 15px -10px #7ad;
  -moz-box-shadow: 0 10px 16px rgba(66, 140, 240, 0.5), inset 0 -8px 12px 0 #6bf, inset 0 -8px 0 8px #48c, inset 0 -35px 15px -10px #7ad;
  -webkit-box-shadow: 0 10px 16px rgba(66, 140, 240, 0.5), inset 0 -8px 12px 0 #6bf, inset 0 -8px 0 8px #48c, inset 0 -35px 15px -10px #7ad;
}
.new-aqua:hover {
  text-shadow: rgb(255, 255, 255) 0px 0px 5px;
}
</code>
</pre>
<p><br/></p>
<p>View the <a href="http://girliemac.com/sandbox/button.html" target="_blank">live demo page</a>! This new aqua button works on FF 3.6, Webkit 4 (the current Safari 4 doesn&#8217;t support inset box-shadow yet), Chrome 4 and Opera 10. (But fails on 10.1 on Mac).</p>
<p style="color:#777"><em>* Edited on Feb.5 &#8211; Opera 10.1 fail and Safari4 (I noticed this works only on Webkit Nightly after published this!)</em></p>
<p>And again, a huge thanks to <a href="www.coroflot.com/trickitty" target="_blank">Jim Green</a> for the revised CSS!</p>
<h3>References</h3>
<ul style="margin-top:1em">
<li><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html" target="_blank">Safari CSS Reference</a> by Apple Safari Dev Center</li>
<li><a href="https://developer.mozilla.org/en/CSS/-moz-box-shadow" target="_blank">-moz-box-shadow</a> by Mozilla Developer Center</li>
<li><a href="http://dev.opera.com/articles/view/css3-border-background-boxshadow/" target="_blank">CSS3 borders, backgrounds and box-shadows</a> by Dev.Opera</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2010/02/04/css3-box-shadow-with-inset-values-the-aqua-button-rerevisited/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Classification of Mobile Browsers</title>
		<link>http://girliemac.com/blog/2009/09/22/classification-of-mobile-browsers/</link>
		<comments>http://girliemac.com/blog/2009/09/22/classification-of-mobile-browsers/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 03:00:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[WAP]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[WinMo]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/?p=93</guid>
		<description><![CDATA[Today, I am not going to post some CSS3 tricks on Webkit, or stuff like that. Instead, I post a list mobile browsers, since I am often [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2009%252F09%252F22%252Fclassification-of-mobile-browsers%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Classification%20of%20Mobile%20Browsers%20%22%20%7D);"></div>
<p>Today, I am not going to post some CSS3 tricks on Webkit, or stuff like that. Instead, I post a list mobile browsers, since I am often asked about mobile / WAP browsers by engineers, product managers, and mobile-curious or mobile-newbie people.
<p>I gathered 30+ major browsers I have worked with (plus a few I have never even seen), and categorize by the markup that browsers can render &#8211; WML, CHTML, XHTML-MP, and HTML4.</p>
<p>So, here you go. If you find some mistakes, let me know!</p>
<style type="text/css">
			#mobile-browsers table {width: 500px; margin-bottom: 1em; border-right: 1px solid #999;border-bottom: 1px solid #999;}
			#mobile-browsers table tr td,
			#mobile-browsers table tr th {margin: 0; padding: 3px; border-left: 1px solid #999;}
			#mobile-browsers table tr.first td {border-top: 1px solid #999;}
		</style>
<div id="mobile-browsers">
<table>
<tr style="background-color:#ebb06a;">
<th colspan="2">WML Browsers (WAP 1.x)</th>
</tr>
<tr>
<td width="40%">Openwave earliy browsers 4.x </td>
<td>&nbsp;</td>
</tr>
<tr class="first">
<td>Early Nokia browser</td>
<td>&nbsp;</td>
</tr>
<tr class="first">
<td>Early Obigo browser</td>
<td>&nbsp;</td>
</tr>
</table>
<table>
<tr style="background-color:#bbda78;">
<th colspan="2">CHTML Browsers (Common in Japan)</th>
</tr>
<tr>
<td width="40%" rowspan="2">CHTML browsers</td>
<td>Compact-HTML browsers</td>
</tr>
<tr>
<td>Compact NetFront</td>
</tr>
<tr class="first">
<td>i-mode browsers (CHTML / XHTML) </td>
<td>NTT Docomo</td>
</tr>
</table>
<table>
<tr style="background-color:#f2a1d3">
<th colspan="2">XHTML Browsers (WAP 2.x &#8211; XHTML-MP / WML)</th>
</tr>
<tr>
<td rowspan="2" width="40%">WebKit</td>
<td>Nokia S40</td>
</tr>
<tr>
<td>Nokia S60 &#8211; earlier versions, or &#8220;Services&#8221; browser</td>
</tr>
<tr class="first">
<td rowspan="2">NetFront by Access</td>
<td>Palm Blazer 3.x -</td>
</tr>
<tr>
<td>Sony Ericsson WAP browser</td>
</tr>
<tr class="first">
<td>Blazer by Handspring</td>
<td>original browsers before accured by Palm</td>
</tr>
<tr class="first">
<td rowspan="5">Openwave 6.x</td>
<td>Siemens</td>
</tr>
<tr>
<td>Sharp</td>
</tr>
<tr>
<td>Sanyo</td>
</tr>
<tr>
<td>Motorola</td>
</tr>
<tr>
<td>Toshiba</td>
</tr>
<tr class="first">
<td>Blackberry by RIM</td>
<td>Blackberry browser- earlier version ~4.3? (<a href="http://docs.blackberry.com/en/developers/subcategories/?userType=21&#038;category=BlackBerry+Browser" target="_blank">*</a>)</td>
</tr>
<tr class="first">
<td>Obigo by Teleca</td>
<td></td>
</tr>
<tr class="first">
<td>Polaris by InfraWare</td>
<td></td>
</tr>
<tr class="first">
<td>Helio</td>
<td></td>
</tr>
<tr class="first">
<td>Motorola MIB</td>
<td></td>
</tr>
</table>
<table>
<tr style="background-color:#91e0f1;">
<th colspan="2">HTML Browsers</th>
</tr>
<tr>
<td width="40%" rowspan="7">WebKit</td>
<td>Nokia S60 3rd gen., &#8220;Web&#8221; Mini-map browser</td>
</tr>
<tr>
<td>Apple Mobile Safari</td>
</tr>
<tr>
<td>Google Android </td>
</tr>
<tr>
<td>Palm WebOS </td>
</tr>
<tr>
<td>Iris, by Torch Mobile (now RIM)</td>
</tr>
<tr>
<td>Bitstream Bolt (Proxy)</td>
</tr>
<tr>
<td>MOTOMAGX (Motorola Linux devices)</td>
</tr>
<tr class="first">
<td rowspan="4">Gecko</td>
<td>Mozilla Minimo (dead?)</td>
</tr>
<tr>
<td>Mozilla Fennec</td>
</tr>
<tr>
<td>Maemo (aka MicroB)</td>
</tr>
<tr>
<td>Skyfire</td>
</tr>
<tr class="first">
<td rowspan="4">Opera (proxy)</td>
<td>Opera Mobile</td>
</tr>
<tr>
<td>Opera Mini</td>
</tr>
<tr>
<td>Nintendo DSi</td>
</tr>
<tr>
<td>Nintendo Wii</td>
</tr>
<tr class="first">
<td>Blackberry by RIM</td>
<td>Blackberry browser ver.4.6+ (I am not sure about 4.4 and 4.5)</td>
</tr>
<tr class="first">
<td>Microsoft Internet Explorer (was Microsoft Pocket IE) </td>
<td>(earlier versions do not support CSS?)</td>
</tr>
<tr class="first">
<td rowspan="4">NetFront 3.x ?</td>
<td>Sony Ericsson browsers</td>
</tr>
<tr>
<td>Sony PlayStation / PSP browsers</td>
</tr>
<tr>
<td>Palm Blazer 4.x</td>
</tr>
<tr>
<td>Amazon Kindle</td>
</tr>
<tr class="first">
<td>Teleca</td>
<td>Teleca Browser V3.x ? (LG Voyager)</td>
</tr>
<tr class="first">
<td>Danger (now by Microsoft)</td>
<td>Sidekick</td>
</tr>
</table></div>
<p>I have categorized only with the markup type, and did not sub-categorize these browsers. However, if I would, I may want to grade XHTML-MP devices with page memory size (=&#8221;deck size&#8221;, yes I said deck size), and screen resolution for UI design purpose. </p>
<p>To grade full-HTML browsers, you need to spend massive time and effort on testing rendering capability with CSS, and Javascript DOM compatibility, events, etc.  Actually, PPK  has done excellent work on mobile browser testing, so you can simply visit <a href="http://www.quirksmode.org/m/" target="_blank">Quirksmode.org</a>!</p>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2009/09/22/classification-of-mobile-browsers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Webkit CSS 3D + Local DB Demo</title>
		<link>http://girliemac.com/blog/2009/09/03/webkit-css-3d-local-db-demo/</link>
		<comments>http://girliemac.com/blog/2009/09/03/webkit-css-3d-local-db-demo/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 06:37:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://girliemac.com/blog/2009/09/03/webkit-css-3d-local-db-demo/</guid>
		<description><![CDATA[Ever since I heard of Snow Loepard&#8217;s hardware-accelerated CSS, I wanted try some cool CSS animation for Safari 4. So after installing Snow Leopard, I spent about [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_jade" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fgirliemac.com%252Fblog%252F2009%252F09%252F03%252Fwebkit-css-3d-local-db-demo%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Webkit%20CSS%203D%20%2B%20Local%20DB%20Demo%22%20%7D);"></div>
<p><img src="http://girliemac.com/blog/wp-content/images/css3d.jpg" alt="css 3D screenshot"/></p>
<p>Ever since I heard of Snow Loepard&#8217;s hardware-accelerated CSS, I wanted try some cool CSS animation for Safari 4.</p>
<p>So after installing Snow Leopard, I spent about a day and half to try creating my first 3D animation with Flickr API.<br />
Honestly, I wasn&#8217;t sure where to get started to make some cool 3D effect, so what I did was I tried to reproduce the one on webkit.org example and modify a lot by trial and error approach.<br />
Also, I have been freqently asked about how I did with &#8220;My Favorites&#8221; feature on <a href="http://girliemac.com/blog/2009/08/29/pretty-cute-suite-another-cute-app-for-pre-from-me/">my Palm Pre app</a> (which is also a WebKit-based), so I throw the HTML5&#8242;s local storage demo with this 3D demo.
</p>
<p>So here, you can try my <a href="http://girliemac.com/sandbox/flickr_3d.html" target="_blank">CSS 3D and Local DB Demo</a>!!!<br />
Be sure to view this demo on Safari 4, iPhone Safari, or WebKit Nightly! This doesn;t seem to work on other Webkit-based browsers such as Chrome and Palm.
</p>
<p>I am not going to write a whole tutorial how to replicate this animation but I try to explain some examples.</p>
<h3>Spin a Wheel!</h3>
<p>Look at one of the flicke photo wheel on my demo. This is a combination of a few different animation.<br />
Let&#8217;s focus on the small wheel inside. This is the snippet of HTML of the wheel:</p>
<pre class="html">
<code>

&lt;div id="gallery"&gt;
  &lt;div id="pic01"&gt;&lt;img src="..."/&gt;&lt;/div&gt;
  &lt;div id="pic02"&gt;&lt;img src="..."/&gt;&lt;/div&gt;
  ... (10 more imgs)
&lt;/div&gt;	

</code>
</pre>
<p><img src="http://girliemac.com/blog/wp-content/images/coordinate.png" alt="3D Cood" align="left"/><br />
OK, for now, let&#8217;s ignore how each photo is rendered to form a loop, and just focus on the animation of one div, #gallery (= a wheel). A band of photos is ratating clockwise around Y-axis.<br />
This means the animation starts as <code>-webkit-transform: rotateY(0);</code> and goes around an circle for a whole 360 degree. <code> -webkit-transform: rotateY(-360deg);</code>.<br />
Use positive if you want to rotate in opposite direction.<br />
I set the whole circle completion span as 60 seconds in linier motion and the animation goes infinite. </p>
<p>This diagram from <a href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html" target="_blank">Apple&#8217;s Safari Reference Library</a> explains coordinates.</p>
<p>So the css for this movement is defined as:</p>
<pre class="css">
<code>
#gallery {
  -webkit-transform-style: preserve-3d;
  -webkit-animation: spinY 60s linear infinite;
}
</code>
</pre>
<pre class="css">
<code>
@-webkit-keyframes spinY {
  from { -webkit-transform: rotateY(0);}
  to   { -webkit-transform: rotateY(-360deg);}
}
</code>
</pre>
<p>Use 3D style, <code>-webkit-transform-style: preserve-3d;</code>to give 3D illusion. I set the initial perspective in its parent div as <code>-webkit-perspective: 380;</code>.<br />
It gives you an illusion of the depth. You can make the value lower to make it look more up-close to you.<br />
The unit of perspective should be &#8220;px&#8221;, but it looks like you&#8217;d better remove it for iPhone.</p>
<p><img src="http://girliemac.com/blog/wp-content/images/css3d_pers200.png" alt="perspective 200"/> <img src="http://girliemac.com/blog/wp-content/images/css3d_pers400.png" alt="perspective 400"/><br />
<img src="http://girliemac.com/blog/wp-content/images/css3d_pers500.png" alt="perspective 500"/> <img src="http://girliemac.com/blog/wp-content/images/css3d_pers0.png" alt="perspective 0"/></p>
<p>To figure out how to render each photo in loop, also other animations, please look at the source code of my demo.</p>
<p>Also, I will write about how to use HTML 5&#8242;s local storage sometimes later!</p>
<h3>References</h3>
<ul>
<li><a href="http://webkit.org/blog/386/3d-transforms/" target="_blank">3D Transforms</a> by Webkit.org</li>
<li><a href="http://webkit.org/blog/130/css-transforms/" target="_blank">CSS Transforms (2D)</a> by Webkit.org</li>
<li><a href="http://webkit.org/blog/138/css-animation/" target="_blank">CSS Animation</a> by Webkit.org</li>
<li><a href="http://www.w3.org/TR/css3-3d-transforms/" target="_blank">CSS 3D Transforms Module Level 3</a> W3C Working Draft</li>
<li><a href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html" target="_blank">Safari Reference Library -Transforms</a> by Apple</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://girliemac.com/blog/2009/09/03/webkit-css-3d-local-db-demo/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

