<?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>Atomic Robot Design &#187; CSS3</title>
	<atom:link href="http://atomicrobotdesign.com/blog/tag/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://atomicrobotdesign.com/blog</link>
	<description>Design From The Future &#124; Blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 03:13:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recreate the 3D slider effect from the Android home page</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/recreate-the-3d-slider-effect-from-the-android-home-page/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/recreate-the-3d-slider-effect-from-the-android-home-page/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 03:58:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=1447</guid>
		<description><![CDATA[I think I’ve mentioned on here before that once in a while I’ll see an effect on a web page and I’ll become obsessed with how it was down. The latest thing to catch my attention is the 3D slide &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/recreate-the-3d-slider-effect-from-the-android-home-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I think I’ve mentioned on here before that once in a while I’ll see an effect on a web page and I’ll become obsessed with how it was down. The latest thing to catch my attention is the 3D slide effect that’s on the home page of the <a href="http://www.android.com/" target="_blank">Android site</a>. It’s a great effect and makes use of CSS3 3D transforms. But it does continue a trend I’ve been seeing from Google lately, it only works in Webkit browsers like Chrome and Safari although it could be set to work in Firefox 10, which is in beta right now. This might be because Google wanted it to work a certain way and Firefox’s implementation doesn’t work quite the same as Webkit’s.</p>
<p>The trick to how the effect works is that it’s powered by CSS but it uses JavaScript to trigger the effect. And the CSS it uses are translateX, transitions and animations. The animations are used to create a fade effect when the slider moves more than one “slide”. I’m not going to go step by step on how to build this, I’ll just go over the key parts and then if you really want to build your own version, you can go through the <a href="http://atomicrobotdesign.com/blog_media/android-page-effect/android-page-effect.html" target="_blank">demo</a> I’ve created. Here’s our basic HTML:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box-wrapper&quot;</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box-container&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;home&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;about&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image-left&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contact&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>First off, anytime you use 3D with CSS, then you need to set the <a href="https://developer.mozilla.org/en/CSS/perspective" target="_blank">perspective</a>:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.box-wrapper</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp;-webkit-perspective<span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span><span style="color: #00AA00;">;</span><br />
&nbsp;-webkit-perspective-origin<span style="color: #00AA00;">:</span> <span style="color: #933;">2000px</span> <span style="color: #933;">-200px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>A div with the class box-wrapper is the wrapper div for everything. The perspective property is set to 600 pixels, which essentially means the content is 600 pixels away on the z index. Next, the <a href="https://developer.mozilla.org/en/CSS/perspective-origin" target="_blank">perspective-origin</a> property is set to 2000px on the x axis and -200px on the y axis. This sets up the view that the user has. Next, we need to set up our transform-style:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#box-container</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp;-webkit-transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span><br />
&nbsp;-webkit-transition<span style="color: #00AA00;">:</span> -webkit-transform .6s ease-in-out<span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Inside box-wrapper is a div with the id of box-container. I’ve set the <a href="https://developer.mozilla.org/en/CSS/transform-style" target="_blank">transform-style</a> to perserve-3d. There’s only two options, perserve-3d or flat, the first says everything should be positioned in 3D space, the other positions everything on the same plane as the container element.</p>
<p>Now it needs some JavaScript to set up the translateZ property of all the divs. The reason I decided to use to set all the z axis positioning on the divs is mainly because it allows you to add or remove divs without worrying about setting anything for them manually.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> startDist <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
boxContainer.<span style="color: #660066;">style</span><span style="color: #009900;">&#91;</span>transform<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'translateZ('</span> <span style="color: #339933;">+</span> startDist <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px)'</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> boxes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;boxes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">style</span><span style="color: #009900;">&#91;</span>transform<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'translateZ('</span> <span style="color: #339933;">+</span> startDist <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px)'</span><span style="color: #339933;">;</span><br />
&nbsp;startDist <span style="color: #339933;">-=</span> <span style="color: #CC0000;">400</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>First thing this does is set the translateZ property of the box-container div to 0. Next, the boxes array contains all the divs with a class of box and in the loop they are all given a translateZ value that’s 400 less than the previous one.</p>
<p>The basics to how this works is this, there’s four divs, the first one is 0, the next -400, then -800 and finally -1200. To get the moving through 3D space effect, the box-container div’s translateX value is changed to be the same as the one we want to see, so if the 3rd one is selected, it will be set to -800 and that div is the one in the view port. To trigger this effect, the translateX of the box-container will be set depending on what link is clicked:</p>
<p>There’s one other effect that really helps flesh this out and that’s when the user clicks on a div that not the next div, say they click on div 3 when they’re currently on div 1, there’s a nice fading animation to make it look like the user is moving through the other divs. First the animation:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a1a100;">@-webkit-keyframes half-fade {</span><br />
&nbsp;<span style="color: #933;">0%</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp;opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp;<span style="color: #00AA00;">&#125;</span><br />
&nbsp;<span style="color: #933;">50%</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp;opacity<span style="color: #00AA00;">:</span> .4<span style="color: #00AA00;">;</span><br />
&nbsp;<span style="color: #00AA00;">&#125;</span><br />
&nbsp;<span style="color: #933;">100%</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp;opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp;<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>So this just fades the div in to 40% opacity and then back to zero to add to the transition effect. To add this effect, there’s a class called transition:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.transition</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp;-webkit-animation<span style="color: #00AA00;">:</span> half-fade .6s ease<span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>What happens is that if the user is going from say, div 1 to div 3, then div 2 would have the transition class added to it and you’d get that fade effect. But there’s one problem, once a CSS animation is fired, there’s no way to restart it. This was the part that caused me the most problems but a quick search lead me to <a href="http://css-tricks.com/restart-css-animation/" target="_blank">CSS-Tricks</a>, where of course <a href="https://twitter.com/#!/chriscoyier" target="_blank">Chris Coyier</a> had the answer. The solution is that you have remove the element and then add a new version of it. Luckily, that only takes 5 lines of JS:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> clone<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #003366; font-weight: bold;">var</span> el <span style="color: #339933;">=</span> boxes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #003366; font-weight: bold;">var</span> nel <span style="color: #339933;">=</span> el.<span style="color: #660066;">cloneNode</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;el.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">replaceChild</span><span style="color: #009900;">&#40;</span>nel<span style="color: #339933;">,</span> el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This code gets the element, clones the element and then replaces the element with the new element. This allows use to reset the animations.</p>
<p>Poke around the code in my <a href="http://atomicrobotdesign.com/blog_media/android-page-effect/android-page-effect.html" target="_blank">demo</a>. I didn’t use jQuery because A) Google didn’t on their site and B) because I want to make sure that I don’t rely on jQuery for everything. I made my demo to work in Firefox and also future proofed it to work in the other major browsers for the one day when they include 3D transforms.</p>
<p>One other thing, in at least my version of Chrome, the dev channel on Windows 7, you can’t click on either of the back two divs, in my version or on <a href="http://www.android.com/" target="_blank">android.com</a>. The same goes for Firefox. It does let you click on them in Safari, so I’m guessing this is a temporary bug but one that really make using this on real sites impossible, hopefully it gets fixed soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/recreate-the-3d-slider-effect-from-the-android-home-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with CSS3 can be fun but it can also be amazingly frustrating</title>
		<link>http://atomicrobotdesign.com/blog/general/working-with-css3-can-be-fun-but-it-can-also-be-amazingly-frustrating/</link>
		<comments>http://atomicrobotdesign.com/blog/general/working-with-css3-can-be-fun-but-it-can-also-be-amazingly-frustrating/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 02:18:33 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=1430</guid>
		<description><![CDATA[I recently decided to redesign my site and the main CSS3 effect I want to use works great in Webkit browsers but not so much in Firefox, at least not yet. I know you’re thinking, wait, what about Opera or &#8230; <a href="http://atomicrobotdesign.com/blog/general/working-with-css3-can-be-fun-but-it-can-also-be-amazingly-frustrating/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently decided to redesign my site and the main CSS3 effect I want to use works great in Webkit browsers but not so much in Firefox, at least not yet. I know you’re thinking, wait, what about Opera or IE? Well, over 80% of my visitors are Chrome or Firefox users, so I figure I’ll make sure it works in there first and I’m pretty sure it will work in IE10 whenever that’s released. And I’ll get around to Opera, I swear!</p>
<p>Imagine this, I’m working along, getting this idea I have to work in Chrome, but the site I saw that inspired my idea only works in Chrome. And then I see that CSS3 3D transforms now work in Firefox 10. So I start messing around and seeing I can get this to work in Firefox. I’m using CSS3 tranforms, but I’m using JavaScript to set the CSS and the first thing I discover is that while the Webkit version makes sense:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">el.<span style="color: #660066;">style</span>.<span style="color: #660066;">webkitTransform</span> <span style="color: #339933;">=</span> ‘translateZ<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>400px<span style="color: #009900;">&#41;</span>’<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The Firefox version does not. You’d think it would be this:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">el.<span style="color: #660066;">style</span>.<span style="color: #660066;">mozTransform</span> <span style="color: #339933;">=</span> ‘translateZ<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>400px<span style="color: #009900;">&#41;</span>’<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>But it’s not. That won’t work, you have to capitalize the m:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">el.<span style="color: #660066;">style</span>.<span style="color: #660066;">MozTransform</span> <span style="color: #339933;">=</span> ‘translateZ<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>400px<span style="color: #009900;">&#41;</span>’<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>I only found this out be <a href="http://www.zachstronaut.com/posts/2009/02/17/animate-css-transforms-firefox-webkit.html" target="_blank">Zachary Johnson did some digging</a> and as far as I can tell, this is the only mention out there about how to properly write it. Problem solved now, right? I mean all the demos using CSS3 for Firefox that have translateZ working fine. But my test still wasn’t working and in fact I wasn’t even sure you could use CSS transition on the translateZ property in Firefox. It turns out you can but not if the CSS property is set as an inline style with JavaScript, which is needed for my idea to work properly. So the transition works right if <a href="http://atomicrobotdesign.com/blog_media/moz-translate-test.html" target="_blank">it’s CSS</a> but not if <a href="http://atomicrobotdesign.com/blog_media/moz-translate-test-js.html" target="_blank">it’s JavaScript</a> powered in Firefox. And in Chrome, it works both ways.</p>
<p>I’m still going to redesign my site because even though the 3D effect will only work in Chrome, at least right now, I’ll still get a fade in and out effect in the other browsers. The main traffic going to my site is web designers and developers and since over 40% of them use Chrome, a decent amount of visitors will site the site the way I intend them to. I’m sure Firefox will add the missing functionality sooner than later, so I’m not too worried about them missing out.</p>
<p>Cutting edge effects are pretty sweet, but you better have the patience to deal with the differences between browsers. Nothing can be more frustrating than when something isn’t working because the browsers use different syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/general/working-with-css3-can-be-fun-but-it-can-also-be-amazingly-frustrating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I used the Flexible Box Model in my blog redesign</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/why-i-used-the-flexible-box-model-in-my-blog-redesign/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/why-i-used-the-flexible-box-model-in-my-blog-redesign/#comments</comments>
		<pubDate>Fri, 06 May 2011 01:25:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[modernizr]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=1041</guid>
		<description><![CDATA[This week I redesigned my blog and I decided to used the CSS3 flexible box model to control the positioning of most of the elements. If you’ve taken a look at it, the flexible box model is a great addition &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/why-i-used-the-flexible-box-model-in-my-blog-redesign/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This week I redesigned my blog and I decided to used the <a href="http://www.html5rocks.com/tutorials/flexbox/quick/">CSS3 flexible box model</a> to control the positioning of most of the elements. If you’ve taken a look at it, the flexible box model is a great addition to our web site building tools and makes positioning a lot easier. Any experienced web designer or developer knows that sometimes the biggest challenge of turning a design into an actual web page is positioning elements like columns horizontally and enabling the page to stretch based on content. This is one of the problems that the flexible box model solves.</p>
<p>You’ve probably heard of the <a href="http://nicolasgallagher.com/micro-clearfix-hack/">clearfix hack</a>. Honestly, it took me a while before I started using it, mainly because for the longest time I followed the advice that you shouldn’t use hacks in your CSS. But eventually, I saw how many developers that I looked up to were using and I will admit, it made things a lot easier. At the same time though, it is still a hack and it’s the kind of thing that the flexible box model make unnecessary. At least in the browsers that implement it that is and predictably, Internet Explorer isn’t one that supports it, not even IE9.</p>
<p>So, wait. If not version of IE doesn’t support it and it’s the most widely used browser, then why would I use the flexible box model? There’s two reasons. The first being, I looked at my analytics and saw the IE users amounted to a very small about of the visitors to my blog, and since Firefox, Chrome and Safari all support it, then I shouldn’t have that much to worry about. But what kind of web developer would I be, if I didn’t make my blog display properly in most browsers. I needed a way to know if the browser supports the flexible box model or not.</p>
<p>That’s where <a href="http://www.modernizr.com/">Modernizr</a> came in. Like the clearfix hack, for a while I was a bit wary of relying on a JavaScript file to make my site work. But, the more I looked into it and the more I built sites that used more and more JS, I realized the chance of it not loading is pretty low. What Modernizr does is add class names to the html tag of a web page. In my blog’s case, if the browser has implemented Flexbox, the it will Modernizr will add a class of flexbox and, in my CSS file, it will run this (shown without the vendor pre-fixes):</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.flexbox</span> <span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; box-orient<span style="color: #00AA00;">:</span>vertical<span style="color: #00AA00;">;</span><br />
&nbsp; box-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>If it doesn’t support Flexbox, then Modernizr adds a class of no-flexbox and this CSS will be used:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.no-flexbox</span> <span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>I’ve become a big fan of Modernizr and I’m using it on more and more sites. If you’re planning on using it for just one or two CSS3 or HTML5 features, then you can now just download a <a href="http://modernizr.github.com/Modernizr/2.0-beta/">custom build of Modernizr</a> so it’s an even smaller file to load and run. Use Modernizr and you can start building websites using the modern features of HTML5 and CSS3 that you may have been putting off because you weren’t sure if it would work or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/why-i-used-the-flexible-box-model-in-my-blog-redesign/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why I think Flash Developers get so defensive</title>
		<link>http://atomicrobotdesign.com/blog/general/why-i-think-flash-developers-get-so-defensive/</link>
		<comments>http://atomicrobotdesign.com/blog/general/why-i-think-flash-developers-get-so-defensive/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 03:44:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=931</guid>
		<description><![CDATA[A couple of days ago I came across this tweet by Keith Peters, who runs the great bit-101 blog. I think there are two reasons that some Flash developers reacted badly to him talking about JavaScript. First, Keith is well &#8230; <a href="http://atomicrobotdesign.com/blog/general/why-i-think-flash-developers-get-so-defensive/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I came across this<a href="http://twitter.com/#!/bit101/status/42641892411850752"> tweet by Keith Peters</a>, who runs the great<a href="http://www.bit-101.com/blog/"> bit-101 blog</a>. I think there are two reasons that some Flash developers reacted badly to him talking about JavaScript. First, Keith is well known guy in the Flash development community and a guy that many people, myself included, value his opinion. And if he’s giving the impression that he’s abandoned Flash for HTML5 and JS, then I bet some developers think they’re losing a leader. Although, this isn’t really true, as Keith and I share the same opinion about web technologies, if you marry yourself to one technology, then you’re going to be limiting yourself and your career.</p>
<p>The other reason could be imagine if a company that you really liked and used their products, like Apple, and all of a sudden they declared they didn’t like the technology you used to make your living. Then all of a sudden, people in the web community and outside of it, were saying that technology was dead. Imagine if you’re a FedEx delivery person and the post office declares that they have a technology that makes your job no longer needed, not only that, but other people are actively celebrating the end of FedEx. That would kinda suck. Although, really, any person that actually knows anything about Flash, HTML5 and web development knows that Flash isn’t done, it’s just moving on to other things.</p>
<p>I think there’s another reason for the animosity towards Flash. The earlier versions of ActionScript were easier to use and now it’s turned into a fullblown programming language. It went from a scripting language used to make simple effects and animations to a full development platform and some of the early users felt left behind. And now HTML5 and JavaScript is replacing Flash for those needs.</p>
<p>But it has to be funny for some Flash developers to see that HTML5 and JS are being used to create those types of things that Flash was ripped on for for so long, things like animated menus and intros. I’ve already said that I think <a href="http://atomicrobotdesign.com/blog/htmlcss/eventually-we%E2%80%99ll-hear-the-same-complaints-about-html5-that-we-hear-about-flash/">HTML5 will get the same complaints that Flash got</a> and <a href="http://shiflett.org/blog/2011/feb/javascript-and-urls">it already is</a>. Just like some sites are a blank page if you don’t have the Flash player installed, there’s more and more sites out there that don’t have even basic functionality if you have JavaScript turned off.</p>
<p>I’m not saying ones better than the other. I like working with Flash but it doesn’t come up much in my day job, so I’ve been focusing more on JavaScript, HTML5 and CSS3. I just think I understand why some Flash developers can get so worked up over something as simple as Keith Peters posting on his blog about JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/general/why-i-think-flash-developers-get-so-defensive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sometimes it’s the simpler things (Or how jQuery has warped my brain)</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/sometimes-its-the-simpler-things-or-how-jquery-has-warped-my-brain/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/sometimes-its-the-simpler-things-or-how-jquery-has-warped-my-brain/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 03:00:08 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=863</guid>
		<description><![CDATA[I was reading an interview on .net magazine with Dan Cederholm, the creator of Dribbble among other things. Dan runs a studio called SimpleBits and after reading the interview, I went to his site to check it out. For some &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/sometimes-its-the-simpler-things-or-how-jquery-has-warped-my-brain/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was reading an interview on <a href="http://www.netmag.co.uk/">.net magazine</a> with <a href="http://www.netmag.co.uk/zine/discover-interview/dan-cederholm">Dan Cederholm</a>, the creator of <a href="http://dribbble.com/">Dribbble</a> among other things. Dan runs a studio called <a href="http://simplebits.com/">SimpleBits</a> and after reading the interview, I went to his site to check it out. For some reason, I resized my browser window and I noticed something. If you change the width of your browser, the background of the SimpleBits website moves in the opposite direction.</p>
<p>I thought, “How is that done? It must be jQuery or something.” There’s jQuery being used on the site, but it’s simple stuff that is used for some hover animations and class changes, but nothing about positioning the background. So I decided to check out the CSS. And I was a bit surprised to see how simple the effect was to produce.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">background.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat</span> <span style="color: #933;">-50%</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>To create the effect, all you need to do is set the background’s x position to negative 50% and then when the browser is resized, it will move in the opposite direction. After I saw that, I realized, of course, that’s how you would do it, but I think because I’m so used to see effects done with jQuery or CSS3, that it didn’t cross my mind that it could be this simple.</p>
<p>I don’t know if it’s a bad thing that my first guess was jQuery, but I think that it’s reminded me, that while things like jQuery are great, sometimes there’s a simpler way to do it. If I can do it with CSS and not use JavaScript, then that’s been the way that I’ve tried to go. I’ve been really excited about CSS3 and what it lets me do, but I need to remember that we can still do cool things with the CSS that works in all browsers. And when it’s something as simple as that, it makes it even more interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/sometimes-its-the-simpler-things-or-how-jquery-has-warped-my-brain/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The CSS3 Flexible Box Module is going to make positioning a lot easier&#8230;.when we can use it in all browsers</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/the-css3-flexible-box-module-is-going-to-make-positioning-a-lot-easier-when-we-can-use-it-in-all-browsers/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/the-css3-flexible-box-module-is-going-to-make-positioning-a-lot-easier-when-we-can-use-it-in-all-browsers/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 03:16:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=801</guid>
		<description><![CDATA[I’d say a majority of websites are center aligned now and it’s probably the way it’s going to be for as long as I can see, at least until we stop designing for the monitors and browsers we are now. &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/the-css3-flexible-box-module-is-going-to-make-positioning-a-lot-easier-when-we-can-use-it-in-all-browsers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’d say a majority of websites are center aligned now and it’s probably the way it’s going to be for as long as I can see, at least until we stop designing for the monitors and browsers we are now. One of the great things about CSS3 is that it’s taken some of the things that web developers and designers were creating using floats and multiple divs and created ways to do it with a line or two of CSS. One of these is the <a href="http://dev.w3.org/csswg/css3-flexbox/">Flexible Box Module</a>, which allows a developer to position a div with a couple of lines of CSS and make the browser do all the calculating instead of messing around with margins.</p>
<p>I’ve made a <a href="http://atomicrobotdesign.com/blog_media/flexible_box_module.html">demo</a> that features some other CSS3 but I’m just going to talk about the Flexbox, as the cool kids call it. It’s pretty simple to start up but there are a couple of things that can be confusing if you’ve never worked with it before. The first thing you do is set the display element:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>box<span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-webkit-</span>box<span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-moz-</span>box<span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>Of course, as with most things CSS3, we have to use vendor pre-fixes but I’m used to that by now. Now this is where one of the confusing parts can appear. Let’s say you have a container div and you want to center it using Flexbox, you would think you’d put all the FLexbox settings into the container div’s CSS but you actually put it into the parent’s and then all of that element’s immediate children are affected. So in order for our container div to be centered we have to set up the Flexbox in the body tag’s CSS.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">body <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-webkit-</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-moz-</span>box<span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>This on it’s own won’t do anything but it sets the child elements up so that we can tell the browser how we want them displayed. The example I’ve made has the container div set to be 800 pixels wide and 500 high and it’s going to be centered on the page. We just need to set two more CSS values for that:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">box-pack<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
box-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>First off, I should be setting the box-orient property but it’s default setting is horizontal, which is what we would be setting it to anyway, so we don’t need it here. Box-pack sets the alignment of our div along the axis of what we’ve set the box-orient to. The options are ‘start’, ‘end’, ‘center’ and ‘justify’, we’re going with center. And box-align sets the other axis, so if it’s on a horizontal alignment like ours, it will set the vertical alignment. The options are ‘start’, ‘end’, ‘center’, ‘baseline’ and ‘stretch’. And again, we’re going with center. This will position the container div to always be in the center of the page no matter how tall or wide the browser window is. But, of course, we need vendor pre-fixes, so our CSS will look like this:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">body <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-webkit-</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:-moz-</span>box<span style="color: #00AA00;">;</span><br />
&nbsp; <br />
&nbsp; -webkit-box-pack<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; -moz-box-pack<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; box-pack<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; <br />
&nbsp; -webkit-box-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; -moz-box-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; box-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Now, some people are probably wondering why you would go to all the trouble of using this many lines of CSS instead of something like:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">auto</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>This would center the div and position it 100 pixels from the top, but the Flexbox module is made to position this and will probably eliminate some of the annoying bugs that happen when we are trying to position multiple divs. There’s a lot more to the Flexbox and you can find out more in Paul Irish’s article on HTML5Rocks <a href="http://www.html5rocks.com/tutorials/flexbox/quick/">titled Quick hits with the Flexible Box Model</a>. It’s perfect if you want to learn more.</p>
<p>There is one thing that really surprised me about using the Flexbox to position a div was how much processor power it used when I was resizing the browser window, actually going up to nearly 100% of both cores at one point. This was in both Chrome and Firefox 4 and  I don’t know if it’s because browser makers are still working on it or what, but I’m sure it will improve as developers start to use it on more and more sites.</p>
<p>Would I recommend using this now? Sure, I think you could, but you’ll just have to remember none of this works in any version of Internet Explorer, so you’ll have to set up alternative positioning for it, using either a separate stylesheet or JavaScript.</p>
<p>So view source on the <a href="http://atomicrobotdesign.com/blog_media/flexible_box_module.html">demo page</a> and see how things are set up. There’s some other interesting CSS3 stuff in there and it will work in Firefox, it will look best in Chrome or Safari.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/the-css3-flexible-box-module-is-going-to-make-positioning-a-lot-easier-when-we-can-use-it-in-all-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Animation vs jQuery Animation</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/css3-animation-vs-jquery-animation/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/css3-animation-vs-jquery-animation/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 04:03:37 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=791</guid>
		<description><![CDATA[With CSS3 transition support in Firefox 4, I’m happy that eventually we’ll need to rely on JavaScript for one less thing. But, of course, right now CSS3 transitions are only supported in Webkit browsers, Firefox 4 and Opera. Internet Explorer &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/css3-animation-vs-jquery-animation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With CSS3 transition support in Firefox 4, I’m happy that eventually we’ll need to rely on JavaScript for one less thing. But, of course, right now CSS3 transitions are only supported in Webkit browsers, Firefox 4 and Opera. Internet Explorer 9 doesn’t have CSS3 transition support right now, as far as I know, so, like with most cutting edge web development, full support is a while off.</p>
<p>But I was wondering, if there was a difference in using jQuery for animation as opposed to the new CSS3 transitions. When you check out the <a href="http://atomicrobotdesign.com/blog_media/css3-vs-jquery.html">test page</a> I’ve made, you can see, there’s not really that much difference in the results, except putting in the same numbers in gets you slightly different end positions. And, since we still need to use JavaScript to trigger the CSS3 animation, we don’t really save any lines of code, we just move a couple of lines from JS to CSS.</p>
<p>Seeing that there’s really no difference in the results, I would eventually prefer to use CSS for things like this, when, of course, it’s supported in all browsers. Why? Well, for the most part, 99% of websites we build will have CSS for style and positioning, so creating the animation with a file that’s going to be loaded already means less requests and that’s a good thing. Less HTTP requests means less chance something might not be loaded.</p>
<p>Of course, with Firefox 4 still being in beta and Internet Explorer 9 not supporting CSS3 transitions at all, I think jQuery and JavaScript built animations are going to be around for a while at least. Personally, if I have the time when working on a project, I’d go the same route as <a href="http://hardboiledwebdesign.com/">Hardboiled Web Design</a> did in his old design (before he went the copy Apple’s nav route so many, many sites go) where he used CSS3 animation to move a character if your browser supported it, if not, he used jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/css3-animation-vs-jquery-animation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Even Google uses other people’s code and you can learn from it</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/even-google-uses-other-peoples-code-and-you-can-learn-from-it/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/even-google-uses-other-peoples-code-and-you-can-learn-from-it/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 04:50:44 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=776</guid>
		<description><![CDATA[After Google officially announced the Chrome OS, I was looking around the site, and I got distracted by the animated icons they have on the Features page. Usually when I see things like that, I have to poke around until &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/even-google-uses-other-peoples-code-and-you-can-learn-from-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After Google officially announced the <a href="http://www.google.com/chromeos/">Chrome OS</a>, I was looking around the site, and I got distracted by the animated icons they have on the <a href="http://www.google.com/chromeos/features.html">Features page</a>. Usually when I see things like that, I have to poke around until I figure out how the effect was created. Google stuck true to their HTML5 credo and animated the icons using the canvas tag and JavaScript.</p>
<p>Most of the JavaScript is pretty straight forward but I was surprised to find out that Google was using a tween library created by someone else, <a href="http://coderepos.org/share/wiki/JSTweener">JSTweener</a>. The library was created by Yuichi Tateno.</p>
<p>This is one of the great things about the HTML5/CSS3/JS movement, if you see something that interests you, then you can dig through the code and figure out how they did it. And you can learn a lot when it’s made by someone like Google because you know that some of the best developers out there worked on it.</p>
<p>Not only can you see the JavaScript they used but also their HTML and CSS. I was surprised to see that although they used the HTML5 doctype and the canvas tag, that’s about all the actual HTML5 you’ll find on the page. There’s no other HTML5 tags used. I’m sure this has a lot to do with making the site work in pretty much every browser possible.</p>
<p>If you want want to learn, I can’t think of a better example than something made by Google. I would love for them to put up an example of how to create the same effect on <a href="http://www.html5rocks.com/">HTML5Rocks.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/even-google-uses-other-peoples-code-and-you-can-learn-from-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It’s super easy to make 3D text with CSS3</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/its-super-easy-to-make-3d-text-with-css3/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/its-super-easy-to-make-3d-text-with-css3/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 02:16:30 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=756</guid>
		<description><![CDATA[One of the great things about CSS3 is that we can create text effects that we used to need to use images to create. And another great thing about CSS3, is you can use the text-shadow to create something that &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/its-super-easy-to-make-3d-text-with-css3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the great things about CSS3 is that we can create text effects that we used to need to use images to create. And another great thing about CSS3, is you can use the text-shadow to create something that you wouldn’t necessarily think you could create with it. Since you can have more than one text-shadow applied to some text, you can use this to create a 3D effect on it.</p>
<p>It’s pretty simple, all you need to do is add one line to your CSS:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">4px</span> <span style="color: #933;">4px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">6px</span> <span style="color: #933;">6px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">7px</span> <span style="color: #933;">7px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">8px</span> <span style="color: #933;">8px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">9px</span> <span style="color: #933;">9px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">,</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#aa0000</span><span style="color: #00AA00;">;</span></div></td></tr></tbody></table></div>
<p>What’s going on here is that there’s ten text-shadows being applied to the text and each one is one pixel to the right and down more then the last one, which will give us a ten pixel solid shadow because we’ve also set the blur to 0. You can change the angle of the shadow with negative values for the x or y of the shadows.</p>
<p>Check out the <a href="http://atomicrobotdesign.com/blog_media/3d_text.html">demo</a>.</p>
<p>That’s all it takes. This doesn’t work in any version of Internet Explorer, but hopefully it gets added to IE9 eventually. If the effect is really important to the design, you can use some JavaScript to replace it with an image if the browser doesn’t support text-shadow.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/its-super-easy-to-make-3d-text-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with CSS3 Transform and some jQuery too</title>
		<link>http://atomicrobotdesign.com/blog/htmlcss/fun-with-css3-transform-and-some-jquery-too/</link>
		<comments>http://atomicrobotdesign.com/blog/htmlcss/fun-with-css3-transform-and-some-jquery-too/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 05:09:20 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://atomicrobotdesign.com/blog/?p=736</guid>
		<description><![CDATA[I am a huge fan of CSS3 transforms and transitions and can’t wait for the day when all the major browsers support them. Why? Well, as great as something like jQuery is, if you want to incorporate a transition or &#8230; <a href="http://atomicrobotdesign.com/blog/htmlcss/fun-with-css3-transform-and-some-jquery-too/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am a huge fan of CSS3 transforms and transitions and can’t wait for the day when all the major browsers support them. Why? Well, as great as something like jQuery is, if you want to incorporate a transition or animation as part of your design, the less files you have to load, the better. And the main purpose of CSS is to style the HTML, so using CSS for the animation just makes more sense to me. And because the animation is being render by the browser’s CSS engine, so far they’ve been incredibly smooth.</p>
<p>I’ve just been messing around with some transitions made a couple of examples of what you can do. You can check out the demo <a href="http://atomicrobotdesign.com/blog_media/css3_transforms.html">here</a>. </p>
<p>The first example is pure CSS. The animation is triggered by the :active selector which unfortunately won’t let you just click on the div to tigger it. The second example uses jQuery to toggle the a class on and off to trigger the animation. Although I’m using jQuery here, it’s just to trigger the effect, the animation is still 100% CSS.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomicrobotdesign.com/blog/htmlcss/fun-with-css3-transform-and-some-jquery-too/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

