<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Perquisite Design » Blog</title>
	
	<link>http://perquisitedesign.com</link>
	<description>fringe benefits without the edge</description>
	<lastBuildDate>Tue, 18 May 2010 19:56:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
    <title>Perquisite Design</title>
    <url>http://perquisitedesign.com/wp-content/themes/tommynolan/images/PerksRSS-img.png</url>
    <link>http://perquisitedesign.com</link>
    <width>400</width>
    <height>94</height>
    <description>Perquisite Design - http://perquisitedesign.com</description>
    </image>		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PerquisiteDesign" /><feedburner:info uri="perquisitedesign" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Cross-Browser CSS3 with LESS</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/6srV988-_ZE/cross-browser-css3-with-less</link>
		<comments>http://blog.perquisitedesign.com/cross-browser-css3-with-less#comments</comments>
		<pubDate>Tue, 18 May 2010 00:50:56 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=729</guid>
		<description><![CDATA[If you do any programing in CSS and haven&#8217;t heard about LESS, then go check out lesscss.org right now! LESS is a great way to simplify your CSS and speedify your web design process. In this tutorial, I show you how to add cross-browser support for many CSS3 properties using this wonderful CSS compiler. Meet [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/QlGSdNaxyNMKU5cBpVHhDmxvjaM/0/da"><img src="http://feedads.g.doubleclick.net/~a/QlGSdNaxyNMKU5cBpVHhDmxvjaM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QlGSdNaxyNMKU5cBpVHhDmxvjaM/1/da"><img src="http://feedads.g.doubleclick.net/~a/QlGSdNaxyNMKU5cBpVHhDmxvjaM/1/di" border="0" ismap="true"></img></a></p><p>If you do any programing in CSS and haven&#8217;t heard about LESS, then go check out <a target="_blank" href="http://lesscss.org/" >lesscss.org</a> right now! LESS is a great way to simplify your CSS and speedify your web design process. In this tutorial, I show you how to add cross-browser support for many CSS3 properties using this wonderful CSS compiler.<br />
<span id="more-729"></span></p>
<h3>Meet LESS</h3>
<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/05/lessismore.png" alt="" title="Less is More" width="574" height="175" class="aligncenter size-full wp-image-734" /><br />
There are a <a target="_blank" href="http://sass-lang.com/" >whole</a> <a target="_blank" href="http://sandbox.pocoo.org/clevercss/" >bunch</a> of ways to simplify your CSS stylesheets, but my personal favorite is <a target="_blank" href="http://lesscss.org" >LESS</a>. It&#8217;s simple documentation, ease of use, versatility, and <a target="_blank" href="http://incident57.com/less/" >Bryan Jones&#8217;s kick-ass mac plugin</a> make it one of the core additions to my design workflow.</p>
<p>LESS works by compiling your <code>.less</code> files into usable CSS stylesheets. While full <a target="_blank" href="http://lesscss.org/docs" >documentation</a> can be found on the LESS website, here&#8217;s a quick rundown of some of the basic syntax:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* 	---Variables---
 * Variables are defined by inserting
 * '@' in front of the defined variable name
 */</span>
&nbsp;
<span style="color: #a1a100;">@favorite-color: #7c180d;</span>
<span style="color: #a1a100;">@border-size: 3px;</span>
&nbsp;
<span style="color: #cc00cc;">#cool-box</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@border-size, solid, @favorite-color;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*	---Output---	*/</span>
&nbsp;
<span style="color: #cc00cc;">#cool-box</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#7c180d</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* 	---Mixins---
 * Mixins allow you to insert one class into another selector
 * They help keep your code DRY
 */</span>
&nbsp;
<span style="color: #6666ff;">.alert</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#fbc2c4</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#8a1f11</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fbe3e4</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#important-message</span> <span style="color: #00AA00;">&#123;</span>
	.alert<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*	---Output---	*/</span>
<span style="color: #cc00cc;">#important-message</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#fbc2c4</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#8a1f11</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fbe3e4</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>LESS also has support for nested rules, operations, and a whole bunch of other options, but we&#8217;ll just be using the variables and mixins for our cross browser support.</p>
<h3>Rounded Corners</h3>
<div id="attachment_769" class="wp-caption aligncenter" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/05/roundedCorner.png" alt="" title="Rounded Street Corner" width="574" height="175" class="size-full wp-image-769" /><p class="wp-caption-text">rounds street corners as well!</p></div>
<p>Rounded corners have been one of the most sought-after &#8216;Web 2.0&#8242; style effects. LESS makes their implementation beyond easy. Plus, if any new browser-specific declarations come out (I&#8217;m looking at you IE) then you only need to add them to one rule.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.border_radius<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@radius:5px) { /* 5px is the default */</span>
	-khtml-border-radius<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@radius;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@radius;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@radius;</span>
	border-radius<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@radius;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*	---Usage---	*/</span>
&nbsp;
<span style="color: #6666ff;">.roundish-header</span> <span style="color: #00AA00;">&#123;</span>
	...
	.border_radius<span style="color: #00AA00;">&#40;</span><span style="color: #933;">15px</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Works in:<br />
<img src="/wp-content/uploads/2010/05/safari-e1274148186891.png" alt="" title="Apple&#039;s Safari" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/firefox-e1274148250668.png" alt="" title="Mozilla&#039;s Firefox" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/chrome-e1274148270722.png" alt="" title="Google&#039;s Chrome" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/Opera-e1274148218745.png" alt="" title="Opera" width="100" height="100" class="alignleft size-full no-border" /></p>
<hr />
<h3>Text &#038; Box Shadow</h3>
<div id="attachment_776" class="wp-caption aligncenter" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/05/peopleshadow.png" alt="" title="Shadowy couple" width="574" height="175" class="size-full wp-image-776" /><p class="wp-caption-text">shady, isn't it?</p></div>
<p>Text and box shadows are IMHO, two of the most underused CSS3 properties. Not only can you make traditional shadows with them, they can also be used to make inset and glow effects. Just brows around this site to get an idea of the opportunities.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.text_shadow</span> <span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@x:0, @y:0, @blur:0, @color:transparent) {</span>
	-moz-<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	-webkit-<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	-khtml-<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	-o-<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.box_shadow</span> <span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@x:0, @y:0, @blur:0, @color:transparent) {</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@x @y @blur @color;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*	---Usage---	*/</span>
&nbsp;
<span style="color: #6666ff;">.shady-text</span> <span style="color: #00AA00;">&#123;</span>
	...
	.text_shadow<span style="color: #00AA00;">&#40;</span><span style="color: #933;">2px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#404040</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	.box_shadow<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#3a76d1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Works in:<br />
<img src="/wp-content/uploads/2010/05/safari-e1274148186891.png" alt="" title="Apple&#039;s Safari" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/firefox-e1274148250668.png" alt="" title="Mozilla&#039;s Firefox" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/chrome-e1274148270722.png" alt="" title="Google&#039;s Chrome" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/Opera-e1274148218745.png" alt="" title="Opera" width="100" height="100" class="alignleft size-full no-border" /></p>
<hr />
<h3>Gradients</h3>
<div id="attachment_782" class="wp-caption aligncenter" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/05/sky.png" alt="" title="Beautiful Sunset" width="574" height="175" class="size-full wp-image-782" /><p class="wp-caption-text">make your very own sunset</p></div>
<p>This one&#8217;s pretty neat! Cross browser native CSS gradients. There are two gotchas though: 1) it doesn&#8217;t work in Opera yet and 2) the IE values are rejected by the LESS compiler. The LESS developers are working on sorting out #2 (<a target="_blank" href="https://less.tenderapp.com/discussions/problems/6-ie-specific-transformations-fail-with-less-css" >so I hear</a>).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.vert_gradient<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@from:#fff, @to:#000) {</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@from;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span> 90deg<span style="color: #00AA00;">,</span> <span style="color: #a1a100;">@to, @from);</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</span> <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span><span style="color: #00AA00;">,</span> <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">,</span> from<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@from), to(@to));</span>
	<span style="color: #808080; font-style: italic;">/* filter: progid:DXImageTransform.Microsoft.gradient(GradeintType=0, startColorstr=@from, endColorstr=@to); */</span>
	<span style="color: #808080; font-style: italic;">/* -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradeintType=0, startColorstr=@from, endColorstr=@to); */</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*	---Usage---	*/</span>
&nbsp;
<span style="color: #6666ff;">.sunset</span> <span style="color: #00AA00;">&#123;</span>
	...
	.vert_gradient<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@from:#ff8901, @to:#b1cbcc)</span>
	...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Works in:<br />
<img src="/wp-content/uploads/2010/05/safari-e1274148186891.png" alt="" title="Apple&#039;s Safari" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/firefox-e1274148250668.png" alt="" title="Mozilla&#039;s Firefox" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/chrome-e1274148270722.png" alt="" title="Google&#039;s Chrome" width="100" height="100" class="alignleft size-full no-border" /></p>
<hr />
<h3>Opacity</h3>
<div id="attachment_785" class="wp-caption aligncenter" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/05/bottle.png" alt="" title="Clear Bottle" width="574" height="175" class="size-full wp-image-785" /><p class="wp-caption-text">see? through!</p></div>
<p>Can you say cross browser? I sure hope so! Because this opacity rule works in everything! Yup!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.opacity<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@value:1) {</span>
	<span style="color: #a1a100;">@ievalue: @value*100; /* special value for IE*/</span>
	filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #a1a100;">@ievalue); </span>
	-khtml-opacity<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@value;</span>
	-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@value;</span>
	opacity<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@value;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*	---Usage---	*/</span>
&nbsp;
<span style="color: #6666ff;">.see-through</span> <span style="color: #00AA00;">&#123;</span>
	...
	.opacity<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.75</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Works in:<br />
<img src="/wp-content/uploads/2010/05/safari-e1274148186891.png" alt="" title="Apple&#039;s Safari" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/firefox-e1274148250668.png" alt="" title="Mozilla&#039;s Firefox" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/chrome-e1274148270722.png" alt="" title="Google&#039;s Chrome" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/Opera-e1274148218745.png" alt="" title="Opera" width="100" height="100" class="alignleft size-full no-border" /><img src="/wp-content/uploads/2010/05/Internet_Explorer_7_Logo-e1274210433228.png" alt="" title="Microsoft&#039;s Internet Explorer" width="100" height="100" class="alignleft size-full no-border" /></p>
<hr />
<h3>Phew!</h3>
<p>Those are the properties I use, but this is infinitely extendable to other CSS3 properties and their new LESSifications. I&#8217;ve included a complete <code>.less</code> file for you to download and use in your projects.</p>
<p><a href="http://perquisitedesign.com/wp-content/uploads/2010/05/cross-browser-CSS3.less"  class="glow_pill">Download Source</a></p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/6srV988-_ZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/cross-browser-css3-with-less/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/cross-browser-css3-with-less</feedburner:origLink></item>
		<item>
		<title>Fight Internet Ignorance</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/LBzavvC-g9M/fight-internet-ignorance</link>
		<comments>http://blog.perquisitedesign.com/fight-internet-ignorance#comments</comments>
		<pubDate>Wed, 17 Mar 2010 03:38:32 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=583</guid>
		<description><![CDATA[If you&#8217;ve ever heard an elderly person refer to &#8220;The Google&#8221; or gotten a blank stare when using the term &#8220;Internet Browser,&#8221; then you have met a victim of Internet Ignorance. While mocking these uneducated computer users has become 4chan comedy gold, perhaps it is time to take steps to counter this growing phenomenon. Good [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/76D3gam0FRlwjUja_-BLy0e48Vs/0/da"><img src="http://feedads.g.doubleclick.net/~a/76D3gam0FRlwjUja_-BLy0e48Vs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/76D3gam0FRlwjUja_-BLy0e48Vs/1/da"><img src="http://feedads.g.doubleclick.net/~a/76D3gam0FRlwjUja_-BLy0e48Vs/1/di" border="0" ismap="true"></img></a></p><p>If you&#8217;ve ever heard an elderly person refer to &#8220;The Google&#8221; or gotten a blank stare when using the term &#8220;Internet Browser,&#8221; then you have met a victim of <em>Internet Ignorance</em>. While mocking these uneducated computer users has become 4chan comedy gold, perhaps it is time to take steps to counter this growing phenomenon.<span id="more-583"></span></p>
<h3>Good grief, Google!</h3>
<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/gg-google.png" title="It&#039;s a search engine, charlie brown!" width="574" height="175" class="alignleft size-full wp-image-586" /><br />
As <a target="_blank" href="http://www.theonion.com/content/news_briefs/google_launches_the_google" >the Onion so brilliantly spoofed</a>, many internet users (especially those older than the internet) have a poor concept of what Google actually is. This misconception was hilariously illustrated by an article on <a target="_blank" href="http://www.readwriteweb.com/archives/facebook_wants_to_be_your_one_true_login.php" >ReadWriteWeb.com</a>. As you may have heard, the article became the number one hit for the search term <em>facebook login</em> on Google and the comments thread was overwhelmed by users mistaking RWW for the new facebook.</p>
<p>The results were unintentionally hilarious! Comedic mayhem ensued, rivaling the antics of Moe, Larry, and Curly. Confused internet users showcased their ignorance and the more knowledgeable elite came to point and laugh.</p>
<p>But this was our fault.</p>
<h3>Ye Olde AOL</h3>
<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/vintage-aol.jpg" alt="" title="Vintage AOL, circa 1992" width="574" height="175" class="alignleft size-full wp-image-601" /><br />
Remember way back in the 90&#8242;s when the internet <strong><em>was</em></strong> AOL? I can still hear those ear-piercing dial-up screeches whenever I see that Mr.Running Man. Back in those days, AOL was everything: browser, ISP, and search. Users never had to discern any difference.</p>
<p>Things have changed a bit since then. Not only are there more than 150 Pokémon, the internet has exploded in every different direction. We surf the net over high-speed, power-boosted, fiber-optic information mega highways. But has the average internet user stayed above the minimum speed limit?</p>
<h3>No Fighting in the War Room</h3>
<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/internet-worker.png" title="&quot;Gotta get this bolt tightened before lunch hour&quot;" width="574" height="175" class="alignleft size-full wp-image-593" /><br />
If this recent ReadWriteWeb fiasco is any standard to go by, the average internet user has quite a bit to learn about the differences between search engines and URLs. But how will they learn?</p>
<p><strong>We will teach them.</strong></p>
<p>As a fledgling blogger, just dipping his pinky toe in the blogosphere, I assume a lot by using the collective &#8220;we.&#8221; But I feel this camaraderie among web designers, programers, hackers, and the like must be used to our advantage. Now is the time to stop making fun of the greater masses and start helping them. For starters, let&#8217;s teach the difference between URLs and searches. The difference between the address bar and the google search box. If we can teach the general public to use the internet more effectively, not only are we forwarding our own professional cause, we are fortifying the foundation of the internet itself.</p>
<p>What will you do to fight the ignorance?</p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/LBzavvC-g9M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/fight-internet-ignorance/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/fight-internet-ignorance</feedburner:origLink></item>
		<item>
		<title>Making an Apple Calculator - Part 2: the JS</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/OWqoLzgTbo8/making-an-apple-calculator-part-2-the-js</link>
		<comments>http://blog.perquisitedesign.com/making-an-apple-calculator-part-2-the-js#comments</comments>
		<pubDate>Mon, 15 Mar 2010 23:02:33 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=565</guid>
		<description><![CDATA[You&#8217;ve seen the CSS, now we pull back the curtain and take a look at the javascript magic working behind the scenes. Did you miss Part 1? Go check it out &#187; Full Disclosure I began web programming with just HTML and CSS. When I found that these languages were not enough, I discovered jQuery, [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/tUKskPuYLZr8QHuDQ6NSbSK98Zs/0/da"><img src="http://feedads.g.doubleclick.net/~a/tUKskPuYLZr8QHuDQ6NSbSK98Zs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tUKskPuYLZr8QHuDQ6NSbSK98Zs/1/da"><img src="http://feedads.g.doubleclick.net/~a/tUKskPuYLZr8QHuDQ6NSbSK98Zs/1/di" border="0" ismap="true"></img></a></p><p><a href="/making-an-apple-calculator-part-1-the-css">You&#8217;ve seen the CSS</a>, now we pull back the curtain and take a look at the javascript magic working behind the scenes.<span id="more-565"></span></p>
<p><strong>Did you miss Part 1?</strong> <a href="http://blog.perquisitedesign.com/making-an-apple-calculator-part-1-the-css" >Go check it out &raquo;</a></p>
<h3>Full Disclosure</h3>
<p>I began web programming with just HTML and CSS. When I found that these languages were not enough, I discovered <a target="_blank" href="http://jquery.com/" >jQuery</a>, the javascript language for designers and fell in love! In short, I am not a trained, black-belt, javascript ninja. Alright, enough apologetic babble, go check out <a href="http://perquisitedesign.com/wp-content/uploads/2010/03/Calculator_Demo3.html"  target="_blank">the demo</a>. I&#8217;ll wait here till you get back.</p>
<p>Pretty cool, huh? Let me walk you though a few of the key pieces.</p>
<h3>The Fly In</h3>
<p>I&#8217;m thinking I might nickname this project &#8220;Super Calc!&#8221;  Here&#8217;s how the initial fly-in works.</p>
<p>First, we send the calculator outside the viewport with css:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#calc</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> translateY<span style="color: #00AA00;">&#40;</span><span style="color: #933;">-1000px</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Then, we send it flying back in once the document is ready with jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#calc&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'webkitTransform'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'translateY(0)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Pretty neat, huh? It&#8217;s cooler if you reload the page so the background image isn&#8217;t trying to load while the calculator flies in.</p>
<h3>For the Hard of Vision</h3>
<p>I hinted at this feature yesterday, but now you get to see it come to full realization! Plug in an equation a hit the equal button. The display zooms at you with the result. Two bits of code make this work. First, the CSS:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* These two rules style the default display */</span>
<span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#display</span> <span style="color: #00AA00;">&#123;</span>
	...
	-webkit-transition-property<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">,</span> -webkit-transform<span style="color: #00AA00;">,</span> scale<span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">;</span>
	-webkit-transition-duration<span style="color: #00AA00;">:</span> 1s<span style="color: #00AA00;">;</span>
	-webkit-transition-timing-function<span style="color: #00AA00;">:</span> ease<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#display</span> input<span style="color: #00AA00;">&#123;</span>
	...
	-webkit-transition-property<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">,</span> -webkit-transform<span style="color: #00AA00;">,</span> scale<span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">;</span>
	-webkit-transition-duration<span style="color: #00AA00;">:</span> 1s<span style="color: #00AA00;">;</span>
	-webkit-transition-timing-function<span style="color: #00AA00;">:</span> ease<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* And these are for the zoomed display */</span>
<span style="color: #6666ff;">.largeDisplay</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #00AA00;">&#41;</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.largeDisplay</span> input <span style="color: #00AA00;">&#123;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#fff</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.75</span><span style="color: #00AA00;">&#41;</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The transition settings are defined in the original display rule with <code>-webkit-transition-property</code>, <code>-webkit-transition-duration</code>, and <code>-webkit-transition-timing-function</code>. It seems a little counter-intuitive at first, but it&#8217;s actually really neat! I could, for example, define several styles for the display to &#8220;animate to&#8221; and I&#8217;d only need to define these rules once.</p>
<p>The second bit of code is the jQuery:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#equal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	...
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#display&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'largeDisplay'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseout</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#display&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'largeDisplay'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>When the <code>#equal</code> button is clicked, we dynamically add the class to the <code>#display</code> input. Then, once the user&#8217;s mouse leaves the equal button, we send the display back to it&#8217;s normal look. Pretty snazzy if I do say so myself.</p>
<h3>Postscript</h3>
<p>There are a couple more features that I haven&#8217;t gone into detail about so be sure to check out <a href="http://perquisitedesign.com/wp-content/uploads/2010/03/Calculator_Demo3.html"  target="_blank">the demo</a> to see them all.</p>
<p> I&#8217;m pretty pleased with this little project. I hope it can help you in some way. Here are some features that could be added to make this an even more versatile Super Calc:</p>
<ul>
<li>Keys that fire with the keyboard</li>
<li>A resize funciton</li>
<li>Use the calculator as attached to a &#8220;real&#8221; input (in a form or something like that)</li>
<li>Add a cape to make Super Calc truly super!</li>
</ul>
<p>Happy arithmetic!</p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/OWqoLzgTbo8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/making-an-apple-calculator-part-2-the-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/making-an-apple-calculator-part-2-the-js</feedburner:origLink></item>
		<item>
		<title>Making an Apple Calculator - A Teaser</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/Mb1008l8Xc8/making-an-apple-calculator-a-teaser</link>
		<comments>http://blog.perquisitedesign.com/making-an-apple-calculator-a-teaser#comments</comments>
		<pubDate>Sun, 14 Mar 2010 23:38:14 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[teaser]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=551</guid>
		<description><![CDATA[A quickie but a goodie today. Here&#8217;s a sneak peak at some of the effects that&#8217;ll be in the CSS / jQuery Apple-style calculator (now that&#8217;s a mouthful, isn&#8217;t it?) No More Squinting My grandma is always complaining that she can&#8217;t see the screen of her digital calculator. Alright, I&#8217;m lying, my grandma uses an [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/YnsFRHSd5Kk87qulbduP8ZOxJTI/0/da"><img src="http://feedads.g.doubleclick.net/~a/YnsFRHSd5Kk87qulbduP8ZOxJTI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YnsFRHSd5Kk87qulbduP8ZOxJTI/1/da"><img src="http://feedads.g.doubleclick.net/~a/YnsFRHSd5Kk87qulbduP8ZOxJTI/1/di" border="0" ismap="true"></img></a></p><p>A quickie but a goodie today. Here&#8217;s a sneak peak at some of the effects that&#8217;ll be in the CSS / jQuery Apple-style calculator (now that&#8217;s a mouthful, isn&#8217;t it?)<span id="more-551"></span></p>
<h3>No More Squinting</h3>
<p>My grandma is always complaining that she can&#8217;t see the screen of her digital calculator. Alright, I&#8217;m lying, my grandma uses an abacus. Either way, sometimes it&#8217;s nice to see the display with more clarity. That&#8217;s exactly what this next bit of javascript does:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">	onmouseover=&quot;display.style.webkitTransform='scale(4) translateY(10px)'&quot;
	onmouseout=&quot;display.style.webkitTransform='scale(1)'&quot;</pre></div></div>

<h3>Here to save the day</h3>
<p>Calculators are sort of like heros&#8230;sort of. So I thought it&#8217;d be fun if the calculator &#8220;flies in&#8221; for you to meet it (the demo for this still needs some work, but you get the idea:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">	onmouseover=&quot;calc.style.webkitTransform='translateY(-1000px)'&quot;
	onmouseout=&quot;calc.style.webkitTransform='translateY(0)'&quot;</pre></div></div>

<h3>A Fancy Clear</h3>
<p>Normally when you clear your calculator, the numbers just disappear. That&#8217;s no fun! What if the whole display flipped around to give you a brand new clean slate:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">	onmouseover=&quot;display.style.webkitTransform='rotateY(180deg)'&quot;
	onmouseout=&quot;display.style.webkitTransform='rotateY(0deg)'&quot;</pre></div></div>

<p>That&#8217;s it! Check out <a href="http://perquisitedesign.com/wp-content/uploads/2010/03/Calculator_Demo2.html" >the demo</a> to see these nifty effects in action! And stay tuned for the completed, fully functional, javascript powered calculator!</p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/Mb1008l8Xc8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/making-an-apple-calculator-a-teaser/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/making-an-apple-calculator-a-teaser</feedburner:origLink></item>
		<item>
		<title>Making an Apple Calculator - Part 1: the CSS</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/GB0cDhUlKs4/making-an-apple-calculator-part-1-the-css</link>
		<comments>http://blog.perquisitedesign.com/making-an-apple-calculator-part-1-the-css#comments</comments>
		<pubDate>Sun, 14 Mar 2010 02:12:41 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=504</guid>
		<description><![CDATA[While many attempt to flaunt their psychic abilities, few can accurately predict what is happening inside the balding cranium of Steve Jobs. His affinity for brushed metal and slightly rounded corners has truly developed a cult of a following and has seeped into the core of our societal design aesthetic. While imitating apple&#8217;s design principals [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/hQTdlFYAtV7U1lcJfmQ5ejpZnMQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/hQTdlFYAtV7U1lcJfmQ5ejpZnMQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hQTdlFYAtV7U1lcJfmQ5ejpZnMQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/hQTdlFYAtV7U1lcJfmQ5ejpZnMQ/1/di" border="0" ismap="true"></img></a></p><p>While many attempt to flaunt their psychic abilities, few can accurately predict what is happening inside the balding cranium of Steve Jobs. His affinity for brushed metal and  slightly rounded corners has truly developed a <a target="_blank" href="http://www.amazon.com/gp/product/1593270666?ie=UTF8&#038;tag=anystageorg-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1593270666" >cult of a following</a> and has seeped into the core of our societal design aesthetic. While imitating apple&#8217;s design principals is <a target="_blank" href="http://psd.tutsplus.com/articles/web/40-apple-themed-photoshop-tutorials/" >nothing</a> <a target="_blank" href="http://www.smashingmagazine.com/2009/03/25/45-apple-inspired-photoshop-tutorials/" >new</a>, there is still room for simple apple design imitation on the web. In this two-part post, I&#8217;ll take a look at how to re-create the default apple calculator program with only CSS and jQuery.<span id="more-504"></span></p>
<h3>A Heads Up</h3>
<p>This technique takes advantage of several safari specific CSS rules to maintain &#8220;the apple effect.&#8221; If you&#8217;d like to see the full results, be sure to <a target="_blank" href="http://www.apple.com/safari/" >get the latest version</a> and check out <a href="http://perquisitedesign.com/wp-content/uploads/2010/03/Calculator_Demo.html"  target="_blank">the demo</a>.</p>
<h3>Start at the Very Beginning &#8211; HTML</h3>
<p>The calculator will be primarily built out of an input field (for the display) and styled buttons (for the buttons, of course). Here, let me show you and then I&#8217;ll do some &#8216;splanin.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrap&quot;</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- to center calculator in window --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;calc&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;innercalc&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;display&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span>&gt;</span>	
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;C&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;plusmn;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;divide;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;times;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span>&gt;</span>	
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;7&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;9&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;minus;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span>&gt;</span>	
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;6&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;#43;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>	
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;equal&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&amp;#61;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row&quot;</span>&gt;</span>	
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zero&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
				<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- end of innercalc --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- end of calc --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- end of wrap...mmmm, I'd like a wrap right now --&gt;</span></pre></td></tr></table></div>

<p>Some things to notice:</p>
<ul>
<li><strong>Divs are used to wrap rows &#45</strong> I could have used a table for this whole thing, but this ended up being much easier.</li>
<li><strong>HTML character codes &#45</strong> Some of the buttons required special characters. (see <a target="_blank" href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references" >Wikipedia</a> for more info</li>
<li><strong>Other wrapping divs &#45</strong> There were still some &#8220;hackey&#8221; things that I needed to do to get everything looking just right. More on these later.</li>
</ul>
<p>Let&#8217;s fire up Safari and take a look. </p>
<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/no-css.png" alt="" title="no-css" width="166" height="134" class="alignleft size-full wp-image-521" /></p>
<p>Not very pretty yet. But it does already have that &#8220;calculator&#8221; feel to it. Before we move on to the meat of this tutorial, I&#8217;d like to make a brief sidebar about input formatting. If you&#8217;ve spent anytime working with CSS, you know of the intentional inconsistencies across browsers in the rendering of input elements. Apple&#8217;s Safari is no different. As you can see, both the text input and the buttons retain a distinguished &#8220;aqua&#8221; look. Luckily, the gurus over at <a target="_blank" href="http://webkit.org/" >the WebKit open-source project</a> have added a little magic gem:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-khtml-appearance<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>This little baby resets all the input elements to their bare bones (at least in WebKit based browsers). It&#8217;s quite the godsend in tricky css situations.</p>
<h3>When you design you begin with C-S-S</h3>
<h4>The Chrome</h4>
<p>We&#8217;ve got to give a body to the calculator before we can do anything else, so I&#8217;ll start with that. First we&#8217;ll lay down the easy stuff, padding, width, background, border etc:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#calc</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">216px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#cbcbcb</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#9b9b9b</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#9b9b9b</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#a7a7a7</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#innercalc</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#dfdfdf</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/Screen-shot-2010-03-13-at-10.57.56-PM.png" alt="" title="chrome-css" width="240" height="149" class="alignright size-full wp-image-527" /></p>
<p>And this leaves us with something that looks like it came out of MS-DOS. You&#8217;ll notice, however, that we&#8217;re using the <code>#innercalc</code> div to add that subtle white highlight on the top. Now that we&#8217;ve gotten the basics, let&#8217;s add some webkit to this baby. We add the following rules:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#calc</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #933;">70px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.60</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>
		linear<span style="color: #00AA00;">,</span>
		<span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span>
		<span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.0</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#cfcfcf</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.15</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#a7a7a7</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.85</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#a7a7a7</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.0</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#909090</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#innercalc</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/Screen-shot-2010-03-13-at-11.01.30-PM-300x210.png" alt="" title="chrome-css-webkit" width="300" height="210" class="alignleft size-medium wp-image-530" /></p>
<p>First we round the corners with the <code>-webkit-border-radius</code>. Note that we also have to round the corners of the innter div as well. Next we add a nice hefty drop-shadow to the calculator (it&#8217;ll look better later). By defining the shadow color using the <code>rgba()</code> color-code, we can define transparency for when we add a nice background.</p>
<p>Lastly comes the gradient background. This one&#8217;s a little hefty so bear with me. First, we&#8217;re creating a <code>background-image</code> so we start with that. Then comes the propriatry <code>-webkit-gradient</code> syntax. We want a <code>linear</code> gradient starting at the <code>left, top</code> and ending at the <code>left, bottom</code>. Then, each <code>color-stop</code> defines where one color blends to another. It took some fudging around to get it just right, but it looks pretty believable.</p>
<h4>The Buttons</h4>
<p>The buttons are more of the same, so I&#8217;ll just cut to the chase and give you the basic CSS:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#calc</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;button&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">46px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#7b7b7b</span><span style="color: #00AA00;">;</span>		
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#cacaca</span><span style="color: #00AA00;">;</span>
	-webkit-<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>
		linear<span style="color: #00AA00;">,</span>
		<span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span>
		<span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.0</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#efefef</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#d5d5d5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.9</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#d5d5d5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span>
		color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1.0</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#9d9d9d</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/button-css.png" alt="" title="button-css" width="295" height="266" class="alignright size-full wp-image-534" /></p>
<p>Some new things to notice:</p>
<ul>
<li><strong>Font size is defined &#45</strong> Strangely enough, <code>font-sizes</code> are not inherited in input elements. I imagine this is a &#8220;feature&#8221; rather than a &#8220;bug.&#8221;</li>
<li><strong>Subtle shadows &#45</strong> We add both a <code>-webkit-box-shadow</code> and a <code>-webkit-text-shadow</code> to the buttons. Both are very subtle, and more noticeable when they&#8217;re gone.</li>
</ul>
<h4>The Display</h4>
<p>The display was the hardest to get right. I&#8217;m still not 100% pleased with it, but it looks pretty good:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#display</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">198px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-2px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.5</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#calc</span> <span style="color: #cc00cc;">#display</span> input<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">166px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f1faca</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#c4cba4</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">30px</span> <span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.75</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/Screen-shot-2010-03-13-at-11.26.51-PM.png" alt="" title="full-css" width="278" height="281" class="alignleft size-full wp-image-537" /></p>
<p>The most important thing to notice about the display is the double-shadow. Since Safari does not support multiple <code>-webkit-box-shadow</code>s yet, we need an extra wrapping div to make the magic happen.</p>
<hr />
<p>And that&#8217;s it! Check out <a href="http://perquisitedesign.com/wp-content/uploads/2010/03/Calculator_Demo.html"  target="_blank">the demo</a> to see it in action, along with a few extra goodies (active states and a snazzy background).</p>
<p>Check back in a few days to see the addition of jQuery to the Apple CSS Calculator!</p>
<p><strong>Update (3-15-10):</strong> <a href="http://blog.perquisitedesign.com/making-an-apple-calculator-part-2-the-js" >Part 2 is finished and ready to go &raquo;</a></p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/GB0cDhUlKs4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/making-an-apple-calculator-part-1-the-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/making-an-apple-calculator-part-1-the-css</feedburner:origLink></item>
		<item>
		<title>Kickin’ it Old School - Hand Drawing</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/yQhfQihktmY/kickin-it-old-school-hand-drawing</link>
		<comments>http://blog.perquisitedesign.com/kickin-it-old-school-hand-drawing#comments</comments>
		<pubDate>Sat, 13 Mar 2010 00:13:31 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[sketch]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=460</guid>
		<description><![CDATA[The first copies of Photoshop were distributed way back in 1987. Not only could this twenty-three year old program see &#8216;R&#8217; rated movies before I could, it even has its own verb. Many have mastered this juggernaut of a program, a few still have more to learn, and even more are just testing the waters. [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/rNiv8r9FJToVC48VeYcl2Yn62A8/0/da"><img src="http://feedads.g.doubleclick.net/~a/rNiv8r9FJToVC48VeYcl2Yn62A8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rNiv8r9FJToVC48VeYcl2Yn62A8/1/da"><img src="http://feedads.g.doubleclick.net/~a/rNiv8r9FJToVC48VeYcl2Yn62A8/1/di" border="0" ismap="true"></img></a></p><p>The first copies of <a target="_blank" href="http://en.wikipedia.org/wiki/Photoshop" >Photoshop</a> were distributed way back in 1987. Not only could this twenty-three year old program see &#8216;R&#8217; rated movies before I could, it even has <a target="_blank" href="http://en.wiktionary.org/wiki/photoshop" >its own verb.</a> Many have mastered this juggernaut of a program, a few <a target="_blank" href="http://photoshopdisasters.blogspot.com/" >still have more to learn</a>, and even more are just testing the waters.<span id="more-460"></span></p>
<p>But we&#8217;re not going to talk about photoshop right now&#8230;</p>
<h3>Crawl Before You Draw</h3>
<p>Alright, cheap trick. I know. But they do it on <em>Law and Order</em> all the time. What I&#8217;m trying to point out is the importance of <strong>hand drawing</strong> to any designer&#8217;s repertoire. Photoshop skills are great, but learning to hand-draw can vastly expand your horizons. Here are some things to keep in mind on your pencil-and-paper quest.</p>
<div id="attachment_470" class="wp-caption alignright" style="width: 225px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/sleeping-dog-225x300.jpg" alt="Sleeping Dog" title="sleeping-dog" width="225" height="300" class="size-medium wp-image-470" /></a><p class="wp-caption-text">Isn't sleeping dog a yoga position?</p></div>
<h4>1. Drawing is a Skill</h4>
<p>Since I have ESP, I can hear you thinking, &#8220;But I don&#8217;t know how to draw.&#8221; Of course you don&#8217;t! Neither do I. I&#8217;m getting better, but there are <a target="_blank" href="http://en.wikipedia.org/wiki/Van_Gogh" >tons</a> <a target="_blank" href="http://en.wikipedia.org/wiki/Davinci" >of</a> <a target="_blank" href="http://en.wikipedia.org/wiki/Charles_Schulz" >people</a> who can draw better than I can. That&#8217;s okay! Drawing is a skill (like tying your shoe) that must be learned and improved. Go out and take a class (that&#8217;s what I did). Find somebody you can learn from. Remember that you <em>can</em> improve. With training and practice, you&#8217;ll see your skills develop over time. Which leads me to&#8230;</p>
<h4>2. Practice, Practice, Practice</h4>
<p>The only way you can can learn to draw is, well, <em>just to draw.</em> You can&#8217;t learn to draw by thinking about drawing or by buying sketch paper. All you need to do is draw. <a target="_blank" href="http://www.azcentral.com/arizonarepublic/business/articles/2008/12/07/20081207biz-mackay1207.html" >One study</a> says it takes about 10,000 hours to gain mastery of a skill. That&#8217;s five years of constant drawing! Now, it may not be your goal to become a <em>master</em> of drawing, but &#8220;getting your hours in&#8221; can do nothing but good. A favorite pastime of mine is doodling during my American Literature class. That&#8217;s three hours every week! (Unless there&#8217;s a test that day&#8230;)</p>
<div id="attachment_484" class="wp-caption alignleft" style="width: 300px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/IMG_0062-300x298.jpg" alt="Flying Yoga" title="flying-yoga" width="300" height="298" class="size-medium wp-image-484" /><p class="wp-caption-text">Now this is a yoga position!</p></div>
<h4>3. Start Small</h4>
<p>If your only experience with &#8220;actual&#8221; drawing ended with Crayola crayons in Kindergarden, then don&#8217;t worry about being to ambitious right from the start. Find a simple, black and white photo and do your best to copy it. Draw your hand. Set up a kleenex box under a desk light and sketch it. If you stumble over your first few tries, that&#8217;s okay! Just keep going. Once you&#8217;ve got that perfect sketch of your desktop stapler where the lighting is just right, frame it and hang it on your wall. You&#8217;ve just made art!</p>
<h4>4. Take Your Time</h4>
<p>Both the winter and summer Olympics have yet to pick up hand drawing as an official sport. With a pencil in your hand, speed is never a priority. Most of the sketches I&#8217;m proud of took at least an hour to complete. Many took even longer. You&#8217;ll get faster as you progress, but don&#8217;t worry about that! Set yourself down in a nice, supportive chair, turn of the TV, throw the cat in the closet and spend some quality time with your sketchbook.</p>
<div id="attachment_488" class="wp-caption alignright" style="width: 225px"><img src="http://perquisitedesign.com/wp-content/uploads/2010/03/IMG_0065-225x300.jpg" alt="Say Cheese" title="say-cheese" width="225" height="300" class="size-medium wp-image-488" /><p class="wp-caption-text">Smile! Even if you don't look quite right</p></div>
<h4>5. Have Fun</h4>
<p>Roll your eyes if you must, but remembering to have fun can actually help improve your drawings. If you are having fun while you draw, your mind is more relaxed and you are less concerned with &#8220;messing up.&#8221; This enjoyment helps shut off the logical side of your brain letting the more creative side take control. Plus, having fun is usually a good thing anyway!</p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/yQhfQihktmY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/kickin-it-old-school-hand-drawing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/kickin-it-old-school-hand-drawing</feedburner:origLink></item>
		<item>
		<title>Make a Snazzy Scrolling Header</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/7jxfdYxY2-I/make-a-snazzy-scrolling-header</link>
		<comments>http://blog.perquisitedesign.com/make-a-snazzy-scrolling-header#comments</comments>
		<pubDate>Sun, 28 Jun 2009 06:02:13 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=234</guid>
		<description><![CDATA[Snazzy, shiny effects are all the rage in this current Web 2.0 design frenzy. So are are super-cool graphics, especially in the header of your page. In this article, I&#8217;ll show you a crafty parallax scrolling technique you can use for pleasure and profit! Check out the tutorial or skip straight to the demo. Paralla-wha? [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/3-TlPMXyZP3-8hPQcP2AFlt4E7M/0/da"><img src="http://feedads.g.doubleclick.net/~a/3-TlPMXyZP3-8hPQcP2AFlt4E7M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3-TlPMXyZP3-8hPQcP2AFlt4E7M/1/da"><img src="http://feedads.g.doubleclick.net/~a/3-TlPMXyZP3-8hPQcP2AFlt4E7M/1/di" border="0" ismap="true"></img></a></p><p>Snazzy, shiny effects are all the rage in this current Web 2.0 design frenzy. So are are super-cool graphics, especially in the header of your page. In this article, I&#8217;ll show you a crafty parallax scrolling technique you can use for pleasure and profit! Check out the tutorial or skip straight to <a href="/wp-content/uploads/2009/06/parallax.html">the demo</a>.<br />
<span id="more-234"></span></p>
<div class="span-15">
<h3>Paralla-wha?</h3>
<p>Not to be confused with high-school geometry, <a target="_blank" href="http://en.wikipedia.org/wiki/Parallax"  title="wikipedia">parallax</a> is a visual concept oft&#8217; used in old-timey video games. Picture a mustachioed plumber defeating strange shell creatures. As the stumpy plumber scrolls jollily right, the floor scrolls at the same speed as him. However, the happy clouds in the background scroll slower than our hero. This creates the amazing appearance that the clouds (or sun or stars or evil castle walls) are further away than the hero. This effect can be modified by altering the speed of the numerous elements.</p>
<div id="attachment_253" class="wp-caption alignleft" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2009/06/mario.png" alt="A slower background seems further away." title="Super Mario Bros. 3" width="574" height="300" class="size-full wp-image-253" /><p class="wp-caption-text">A slower background seems further away.</p></div>
<h3>Prepping the Images</h3>
<p>Taking a step away from our plumber friend, our header will scroll up (or down if you like thinking backwards). The first step in creating the header is preparing the artwork. We&#8217;ll make a three layer scroller and add a fourth layer for the character.</p>
<p>When designing your layers, it is important to consider both their layering and transparency. Where do you want parts to shine through? Where are things obscured. I&#8217;ll leave this part up to you. Here&#8217;s a quick-and-dirty sample I&#8217;ve prepared earlier</p>
<div><div id="attachment_264" class="wp-caption alignleft" style="width: 584px"><img src="http://perquisitedesign.com/wp-content/uploads/2009/06/layer-comps.png" alt="Layers are numbered from top to bottom. Transparency is not visible, but you get the idea." title="Layer Comps" width="574" height="695" class="size-full wp-image-264" /><p class="wp-caption-text">Layers are numbered from top to bottom. Transparency is not visible, but you get the idea.</p></div></div>
<h3>A Note on Image Size</h3>
<p>Images should be in PNG-24 format to accommodate varying opacities (sorry IE). Also important are the heights of the images. Static elements (like the title) can be whatever hight they need to be. Everything else has a hight relative to how fast you want it to move. The faster it moves, the taller it should be.</p>
<h3>Putting it Together &#8211; the HTML</h3>
<p>The structure of the page is quite simple. We need four elements to enclose our four images. These four will be wrapped in each other.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>  <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;snazzyheader&quot;</span>&gt;</span>Falling Man Productions<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Easy huh? That&#8217;s because we&#8217;re gonna be doing most of the heavy lifting with jQuery. How&#8217;s about them apples? Let&#8217;s look at the CSS before we get to the lifting.</p>
<h3>Putting it Together &#8211; the CSS</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">610px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
h1<span style="color: #6666ff;">.snazzyheader</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">610px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;layer-2.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">3</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-4</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-3</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-1</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">610px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-4</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;layer-4.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-3</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;layer-3.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#header</span> <span style="color: #6666ff;">.layer-1</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">4</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;layer-1.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Ok, some explaining. First <code>#header</code> houses all our elements so it needs some basic styling. Width, height, and relative positioning all help us later on.</p>
<p>The <code>h1</code> element gets the same width and height as the finished header. A super high, super negative text-indent keeps the header text invisible to the end user while still letting google-bot and it&#8217;s ilk find the site. Most important are the z-index and relative positioning. The z-index puts the layer in the stack (higher numbers are &#8220;closer&#8221; to you) and the positioning lets the layer play in the same world as absolutely positioned elements.</p>
<p>Then a catch-all declaration for our other three layers. Again, the same width and height. These layers, however, have absolute positioning to keep them over each other. Because they are contained in the relatively positioned <code>#header</code>, they cannot escape. <code>top: 0</code> makes sure these elements stay glued to the top of the <code>#header</code> element.</p>
<p>Lastly, the three layer elements get their individual z-indexes and background images.</p>
<p>Phew!</p>
<h3>Putting it Together &#8211; the jQuery</h3>
<p>Now for the fun part! The jQuery! You&#8217;ll need <a target="_blank" href="http://jquery.com/"  title="jQuery">the latest jQuery build</a> and the wonderful <a target="_blank" href="http://plugins.jquery.com/project/backgroundPosition-Effect"  title="Background Position Effect">Background Position Animation Plugin</a>. Got &#8216;em? Good. Now first we have to get these layers into our document. We do this with jQuery&#8217;s <code>append</code> function.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#header&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;layer-1&quot;&gt;&lt;/span&gt;&lt;span class=&quot;layer-3&quot;&gt;&lt;/span&gt;&lt;span class=&quot;layer-4&quot;&gt;&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2000</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After appending the three spans we immediately <code>hide</code> them and use a makeshift timer (<code>animate({opacity: "1"}, 2000)</code>) to give time for the background images to load. After this time has past, we <code>fadeIn</code> the images. Now it&#8217;s time to start the scrolling. Because we want the scrolling to be continuous, we&#8217;ll build the functions as loops outside of the <code>$(document).ready</code> function and include them later. The basic function looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> layer1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 -482px)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">12000</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 0)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;layer1()&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">12000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We animate the <code>backgroundPosition</code> to a negative value <strong>equal to the height of the image.</strong> Then, we animate it back to &#8220;0 0&#8243; in no time at all (to seamlessly reset the animation). The <code>setTimeout</code> function gets the same timing as the original animation and fires this same function again creating a loop. Three of these functions are made, one for each of the animating layers. The final javascript looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.backgroundPosition.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> layer1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 -482px)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">12000</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 0)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;layer1()&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">12000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> layer3<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 -780px)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">12000</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 0)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;layer3()&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">12000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> layer4<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 -1000px)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">12000</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundPosition<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;(0 0)&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;linear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;layer4()&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">12000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#header&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;layer-1&quot;&gt;&lt;/span&gt;&lt;span class=&quot;layer-3&quot;&gt;&lt;/span&gt;&lt;span class=&quot;layer-4&quot;&gt;&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>
		     .<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2000</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">//Firefox Needs us to set the backgroundPosition manually for the animation to work</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;backgroundPosition&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;0 0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;backgroundPosition&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;0 0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.layer-4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;backgroundPosition&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;0 0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
	layer1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	layer3<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	layer4<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Note that we have to set the <code>backgroundPosition</code> to &#8220;0 0&#8243; manually for Firefox to play nice.</p>
<h3>Falling is Easy</h3>
<p>And that&#8217;s all she wrote! Check out <a href="/wp-content/uploads/2009/06/parallax.html">the demo</a> to see the effect in action. And be sure to stay tuned for more exciting tutorials.</p>
</div>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/7jxfdYxY2-I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/make-a-snazzy-scrolling-header/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/make-a-snazzy-scrolling-header</feedburner:origLink></item>
		<item>
		<title>Fancy New Website</title>
		<link>http://feedproxy.google.com/~r/PerquisiteDesign/~3/fGtSVRJxFIM/fancy-new-website</link>
		<comments>http://blog.perquisitedesign.com/fancy-new-website#comments</comments>
		<pubDate>Fri, 26 Jun 2009 19:40:01 +0000</pubDate>
		<dc:creator>omtay38</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[announcement]]></category>

		<guid isPermaLink="false">http://perquisitedesign.com/?p=206</guid>
		<description><![CDATA[It seems sort of self-serving to post about one&#8217;s own blog on that blog, but here goes! Welcome, salutations and other good wishes! Perquisite Design is up and running. You have found yourself on the blog section of my site. Here will be posted web-design tutorials and other ramblings about other fancy topics. Tell me [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/ui1bmYCIEr81R5W1ZRyElF8Uhos/0/da"><img src="http://feedads.g.doubleclick.net/~a/ui1bmYCIEr81R5W1ZRyElF8Uhos/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ui1bmYCIEr81R5W1ZRyElF8Uhos/1/da"><img src="http://feedads.g.doubleclick.net/~a/ui1bmYCIEr81R5W1ZRyElF8Uhos/1/di" border="0" ismap="true"></img></a></p><p>It seems sort of self-serving to post about one&#8217;s own blog <i>on</i> that blog, but here goes! Welcome, salutations and other good wishes! Perquisite Design is up and running. You have found yourself on the blog section of my site. Here will be posted web-design tutorials and other ramblings about other fancy topics.</p>
<p><span id="more-206"></span><br />
<div id="attachment_212" class="wp-caption alignleft" style="width: 620px"><img src="http://perquisitedesign.com/wp-content/uploads/2009/06/watching.png" alt="I&#039;ve got my eye on you" title="Eyes" width="610" height="90" class="size-full wp-image-212" /><p class="wp-caption-text">I've got my eye on you</p></div></p>
<h3>Tell me what you think!</h3>
<p>I&#8217;m just a lowly website developer (with a bad sense of spelling). Let me know what you think! Is everything working right? Something you think looks cool? Something spelled wrong? Have at it!</p>
<img src="http://feeds.feedburner.com/~r/PerquisiteDesign/~4/fGtSVRJxFIM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.perquisitedesign.com/fancy-new-website/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.perquisitedesign.com/fancy-new-website</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 2.395 seconds -->
