<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Fearless Flyer Web Design &#187; CSS</title> <atom:link href="http://fearlessflyer.com/tag/css/feed/" rel="self" type="application/rss+xml" /><link>http://fearlessflyer.com</link> <description>Fearless flyer is a blog that focuses on the latest topics of web design. This includes Wordpress, SEO, Photoshop, jQuery, PHP and CSS. Fearless flyer is owned and operated by Michael Soriano, a seasoned web developer living in Southern California.</description> <lastBuildDate>Mon, 23 Aug 2010 15:55:50 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>How to Create Your Own jQuery Content Slider</title><link>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/</link> <comments>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/#comments</comments> <pubDate>Sun, 15 Aug 2010 19:27:47 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Content Slider]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[slideshow]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1762</guid> <description><![CDATA[This tutorial will show you how to create your own jQuery content slider. You may ask &#8220;Why create my own if there are hundreds of already made sliders out there?&#8221; This is true: I myself almost always use ready made plugins for my projects. Yet, it is always a good thing to know how they [...]]]></description> <content:encoded><![CDATA[<p>This tutorial will show you how to create your own jQuery content slider. You may ask &#8220;<em>Why create my own if there are hundreds of already made sliders out there?</em>&#8221; This is true: I myself almost <em>always</em> use ready made plugins for my projects. Yet, it is always a good thing to know how they work. It also comes in handy &#8211; if you should ever want to customize it (it’s always harder to edit someone else’s code).</p><div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/content-slider/">View the Demo</a></div><div class="special">If you choose to skip the tutorial &#8211; you are free to download the source code from this <a href="http://fearlessflyer.com/downloads/content-slider.zip">link</a></div><p>So are you ready to get started? Let’s begin:</p><h3>Step 1: Create the Base Mark Up</h3><p>What we need is a series of images in an unordered list:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;image1.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image2.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image3.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image4.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image6.jpg&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div><p>Pretty straightforward code – view it in the browser and see a bunch of images listed from top to bottom.</p><h3>Step 2: Add jQuery Code to hide unfocused images:</h3><p>What we’re trying to achieve is to only show the first image of the list and hide the rest. We do this by applying some CSS rules via jQuery to the mark up we&#8217;ve created. We also want to line up the hidden images to the right – so we can add controls that animate the entire ul a little bit to the left at a time (see illustration below):</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot1.jpg" alt="screenshot1" title="screenshot1" width="576" height="490" class="alignnone size-full wp-image-1763" style="border:none;" /></p><p>Add the following code right above the closing head tag:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</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: #003366; font-weight: bold;">var</span> theImage <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul li img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> theWidth <span style="color: #339933;">=</span> theImage.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #006600; font-style: italic;">//wrap into mother div</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;mother&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
	<span style="color: #006600; font-style: italic;">//assign height width and overflow hidden to mother</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mother'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		width<span style="color: #339933;">:</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: #000066; font-weight: bold;">return</span> theWidth<span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		height<span style="color: #339933;">:</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: #000066; font-weight: bold;">return</span> theImage.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
		position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'relative'</span><span style="color: #339933;">,</span>
		overflow<span style="color: #339933;">:</span> <span style="color: #3366CC;">'hidden'</span>  	
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">//get total of image sizes and set as width for ul </span>
	<span style="color: #003366; font-weight: bold;">var</span> totalWidth <span style="color: #339933;">=</span> theImage.<span style="color: #660066;">length</span> <span style="color: #339933;">*</span> theWidth<span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		width<span style="color: #339933;">:</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: #000066; font-weight: bold;">return</span> totalWidth<span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span>				
	<span style="color: #009900;">&#125;</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: #006600; font-style: italic;">//doc ready</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div><p><strong>In English</strong>: in the first script tag – we have connected to the jQuery library online. Then we go in the <strong>window.load()</strong> event *as supposed to document.ready() – because of an <a href="http://stackoverflow.com/questions/1126272/are-image-properties-part-of-the-dom-jquery-webkit-inconsistency-with-other-br">issue detecting image width and height with webkit browsers</a>. Then we set up a couple of variables which are all the images inside the unordered list, along with their widths. We wrap the unordered list (using the .wrap() function) inside a div called “mother” with the CSS rules I mentioned.</p><h3>Step 3: Add “Next” and “Previous” Buttons</h3><p>In our HTML – add anchor tags with the class “<em>next</em>” (If you want to move forward the slider) and “<em>previous</em>” (to go backward) inside the list items:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;image1.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image2.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image3.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image4.jpg&quot; /&gt;&lt;a class=&quot;next&quot; href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;image6.jpg&quot; /&gt;&lt;a class=&quot;previous&quot; href=&quot;#&quot;&gt;prev&lt;/a&gt;&lt;a class=&quot;startover&quot; href=&quot;#&quot;&gt;startover&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div><p>Note that you will not see these links when you preview the page. This is because they are tucked away outside the visible region of the overflow property we’ve created:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot2.jpg" alt="" title="screenshot2" width="576" height="396" class="alignnone size-full wp-image-1764" style="border:none;" /></p><h3>Step 3: The Nifty .Animate()Method</h3><p>Okay, now we’ve come to the part where we actually see some action. The whole point of what we’re trying to do is to move the list a little to the right – when the &#8220;<em>next</em>&#8221; link is clicked, and to the left if &#8220;<em>previous</em>&#8221; is clicked:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot3.jpg" alt="" title="screenshot3" width="576" height="396" class="alignnone size-full wp-image-1765" style="border:none;" /></p><p>Add the following javascript code inside the existing script tags:</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="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>theImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>		
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>intIndex<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>				
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.next&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>	<span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</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>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>intIndex <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> theWidth<span style="color: #009900;">&#41;</span>				
					<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span>	
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.previous&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</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>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>intIndex <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> theWidth<span style="color: #009900;">&#41;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span>	
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.startover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</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>
				<span style="color: #3366CC;">&quot;margin-left&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//close .bind()									 </span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//close .each()</span></pre></td></tr></table></div><p><strong>Explanation:</strong> the code above starts out with the “<em>.each</em>” function – which is essentially a loop that looks for each of our images in the list. Then it finds all of the anchor tags next to the images (through <em>.nextAll</em>) and checks them for the assigned class. If the class says <em>“next”</em> – animate the parent (ul) to the left by applying a margin-left CSS property to it. The same thing goes for class<em> “previous”</em>. The only difference is the index is advanced vs. deducted multiplied by the image width. Lastly – is class “<em>startover</em>” which resets the slider to its original position.</p><p>Add the CSS code below inside the <em>“head”</em> tag so you can see the links and start testing them:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
<span style="color: #00AA00;">*</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</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: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ul li <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;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</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>
ul li a<span style="color: #6666ff;">.next</span> <span style="color: #00AA00;">&#123;</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #00AA00;">&#123;</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.startover</span><span style="color: #00AA00;">&#123;</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div><h3> Step 4: Make ‘er Nice and Purrty</h3><p>Technically – our slider is done. This section mainly focuses on making it look nice and presentable. So I grab this file: <a href="http://fearlessflyer.com/u/slider-constructor">Slider Constructor from Graphic River</a>. Slider Constructor is a high quality Photoshop filled with shiny slider buttons and controls that will surely bring life to your new slider. Create the buttons of your choice from this file and save them as individual .pngs.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/08/screenshot4.jpg" alt="" title="screenshot4" width="576" height="178" class="alignnone size-full wp-image-1766" style="border:none;" /></p><p>You can set a different button for each anchor tag in each slide. You can also place them anywhere you want with some CSS positioning. Either add an &#8220;id&#8221; attribute to the individual anchor tags, or an additional class (which is what I did). Below is the CSS for my demo &#8211; of course, you might want to code yours differently:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ul li a<span style="color: #6666ff;">.next</span><span style="color: #6666ff;">.red</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-red.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">57px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">73px</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">560px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">237px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span><span style="color: #6666ff;">.green</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-green.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</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: #933;">286px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">486px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #6666ff;">.green</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-green.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">67px</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: #933;">286px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">105px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span><span style="color: #6666ff;">.orange</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-orange.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">239px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">62px</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">360px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #6666ff;">.orange</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-orange.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">239px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">62px</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;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.next</span><span style="color: #6666ff;">.blue</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">next-blue.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">57px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">129px</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: #933;">150px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">562px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #6666ff;">.blue</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">prev-blue.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">58px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">129px</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: #933;">150px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.previous</span><span style="color: #6666ff;">.silver</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">previous-silver.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">49px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</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: #933;">305px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">360px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
ul li a<span style="color: #6666ff;">.startover</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">startover.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">176px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">73px</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: #933;">280px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">420px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>Also &#8211; the good thing about this code is you can place and style the buttons individually.</p><h3>Conclusion</h3><div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/content-slider/">View the Demo</a></div><p>There, there – you’ve just done yourself some good coding <em>Sparky</em>!  Feel free to modify, re-factor and make the code better. This is as basic as it gets – so have fun tweaking it. Make sure you leave a comment or spread the word by retweeting or liking it in facebook. Until next time!</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/08/how-to-create-your-own-jquery-content-slider/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Tasty Trends in Themeforest Templates</title><link>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/</link> <comments>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/#comments</comments> <pubDate>Fri, 25 Jun 2010 02:39:07 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Inspiration]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[html]]></category> <category><![CDATA[premium theme]]></category> <category><![CDATA[templates]]></category> <category><![CDATA[ThemeForest]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1546</guid> <description><![CDATA[One of my favorite ways to stay up to date on the latest design trends is to browse Themeforest. Themeforest has hundreds of the finest web and graphic designers trying to sell their work. It is no surprise that it is here that you will see new styles and craze to ever hit the world [...]]]></description> <content:encoded><![CDATA[<p>One of my favorite ways to stay up to date on the latest design trends is to browse Themeforest. Themeforest has hundreds of the finest web and graphic designers trying to sell their work. It is no surprise that it is here that you will see new styles and craze to ever hit the world of web design.  Below is a list of styles (along with some examples) that I have been noticing in new templates from Themeforest:</p><div class="special">Note &#8211; in case you&#8217;re wondering, yes &#8211; the links to the items below are affiliate links. But this doesn&#8217;t mean that I&#8217;m just trying to make a buck &#8211; these templates are truly awesome.</div><h3>Bokeh and Blurry Backgrounds</h3><p>I first saw this style from this popular <a href="http://fearlessflyer.tumblr.com/">Tumblr theme</a>. <strong>Bokeh</strong> is an effect where a colorful palette of round reflections are so washed and blurred from an out of focus lens of some sort. This mystique of photography somehow brings the subject (the content in our case) a much more focused and sharper look. The Bokeh effect gives the entire page an overall feeling of harmony and beauty.</p><h6><a href="http://fearlessflyer.com/u/blur">Blur</a></h6><p>Bokeh in combination with transparencies as well as rounded corners give this template a thumbs up from me!</p><p><a href="http://fearlessflyer.com/u/blur"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/blur.jpg" alt="blur" title="blur" width="576" height="323" class="alignnone size-full wp-image-1548" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/blur">You can view the Item here</a>, or <a href="http://enstyled.com/blur/index.html "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/modernbusiness">Modern Business 3</a></h6><p>This template uses bokeh in the inner frames of the page. Very sleek, professional and elegant.</p><p><a href="http://fearlessflyer.com/u/modernbusiness"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/modern-business.jpg" alt="modernbusiness" title="modernbusiness" width="576" height="323" class="alignnone size-full wp-image-1557" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/modernbusiness">You can view the Item here</a>, or <a href="http://www.theaterwebsiteservices.com/themeforest/modern_business3_dark/index.html "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/darknclean">Dark ‘n Clean</a></h6><p>Another Bokeh Beauty, don&#8217;t miss the amazing typography from this theme!</p><p><a href="http://fearlessflyer.com/u/darknclean"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/dark-n-clean.jpg" alt="darknclean" title="darknclean"  width="576" height="323" class="alignnone size-full wp-image-1550" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/darknclean">You can view the Item here</a>, or <a href="http://www.furtzdesigns.com/darknclean/ "target="_blank">Demo from Here</a></p><h3>Overlapping Folds</h3><p>This style has been around for a while, but still doesn&#8217;t fail to amaze me. It is when the designer takes page elements and wraps them among sections of the page, as if it was three dimensional.</p><h6><a href="http://fearlessflyer.com/u/unite">Unite</a></h6><p>Definitely one of my favorites. Exceptionaly detailed &#8211; the folds even change in orientation when scrolling up and down</p><p><a href="http://fearlessflyer.com/u/unite"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/unite.jpg" alt="" title="Make sure you check all the folds in this theme" width="576" height="356" class="alignnone size-full wp-image-1547 noborder showtip" style="border:none;" /><br /> </a><a href="http://fearlessflyer.com/u/unite">You can view the Item here</a>, or <a href="http://para.llel.us/themes/unite-wp/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/stage">Stage</a></h6><p>This one is very unorthodox. Folds, peels &#8211; 3d everywhere!</p><p><a href="http://fearlessflyer.com/u/stage"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/stage.jpg" alt="stage" title="so much depth in this template" width="576" height="405" class="showtip alignnone size-full wp-image-1561" style="border:none;" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/stage">You can view the Item here</a>, or <a href="http://idesi9n.com/stage/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/fancyfolio">Fancy Folio</a></h6><p>More in the safe and conservative style, checkout the folded navigation button</p><p><a href="http://fearlessflyer.com/u/fancyfolio"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/fancy-folio.jpg" alt="fancyfolio" title="fancyfolio"  width="576" height="409" class="alignnone size-full wp-image-1553" style="border:none;" /><br /> </a><a href="http://fearlessflyer.com/u/fancyfolio">You can view the Item here</a>, or <a href="http://theme-planet.com/fancyfolio/ "target="_blank">Demo from Here</a></p><h3>Wild Slideshow Transitions</h3><p>May it be Flash or Javascript &#8211; I&#8217;ve noticed a trend in transitions. The &#8220;fade&#8221; and the &#8220;sweep&#8221; no longer suffice, check out the slideshows in the templates below for a better demonstration.</p><h6><a href="http://fearlessflyer.com/u/perception">Perception</a></h6><p>Sliced, reversed, waves &#8211; the slideshow on Perception will leave you breathless.</p><p><a href="http://fearlessflyer.com/u/perception"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/perception.jpg" alt="perception" title="perception" width="576" height="323" class="alignnone size-full wp-image-1559" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/perception">You can view the Item here</a>, or <a href="http://pexeto.com/perception_wp/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/cleancut">CleanCut</a></h6><p>The transition effects on CleanCut will give your images that &#8220;Wow&#8221; factor.</p><p><a href="http://fearlessflyer.com/u/cleancut"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/cleancut.jpg" alt="cleancut" title="cleancut" width="576" height="323" class="alignnone size-full wp-image-1549" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/cleancut">You can view the Item here</a>, or <a href="http://www.kriesi.at/themes/cleancut/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/infinite">Infinite xHTML/CSS Theme</a></h6><p>The slideshow on this template is a combination of many styles, played in random order. Tastefully done.</p><p><a href="http://fearlessflyer.com/u/infinite"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/infinite.jpg" alt="infinite" title="infinite" width="576" height="323" class="alignnone size-full wp-image-1554" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/infinite">You can view the Item here</a>, or <a href="http://www.grupolasalida.com/themeforest/infinite/light/ "target="_blank">Demo from Here</a></p><h3>Accordions</h3><p>Instead of the regular slideshow, some templates integrate an Accordion effect (or both) right in the home page. Both are somewhat similar, though the Accordion is a new trend that gives your website that out of the ordinary style.</p><h6><a href="http://fearlessflyer.com/u/innovation">Innovation + Science</a></h6><p>Definitely of of my favorites &#8211; Innovation + Science is very sleek, sharp and clean. The accordion is a good choice for this template.</p><p><a href="http://fearlessflyer.com/u/innovation"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/innoscience.jpg" alt="" title="Gorgeous Accordion Here" width="576" height="450" class="showtip alignnone size-full wp-image-1555" style="border:none;" /><br /> </a><a href="http://fearlessflyer.com/u/innovation">You can view the Item here</a>, or <a href="http://warp.nazwa.pl/dc/innovation/index.html "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/newscast">Newscast</a></h6><p>Again, one of my favorites &#8211; this template&#8217;s got it all: typography, spacing, color, javascript effects &#8211; and of course the accordion. Probably the best magazine styled theme I&#8217;ve ever seen.</p><p><a href="http://fearlessflyer.com/u/newscast"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/newscast.jpg" alt="" title="You have to check out Newscast" width="576" height="476" class="showtip alignnone size-full wp-image-1558" style="border:none;" /><br /> </a><a href="http://fearlessflyer.com/u/newscast">You can view the Item here</a>, or <a href="http://www.kriesi.at/demos/newscast/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/echoes">Echoes</a></h6><p>Awesome, awesome, awesome!!! This template simply <em>echoes</em> &#8220;awesome!&#8221;</p><p><a href="http://fearlessflyer.com/u/echoes"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/echoes.jpg" alt="" title="Im so awesome, awesome, awesome" width="576" height="323" class="showtip alignnone size-full wp-image-1551"  /><br /> </a></p><p><a href="http://fearlessflyer.com/u/echoes">You can view the Item here</a>, or <a href="http://echoes.imaginemthemes.com/wp/ "target="_blank">Demo from Here</a></p><h3>Minimalist</h3><p>Just as the title describes, minimalist styled websites try to achieve the best look out of the least styling. The aim of the minimalist is to present beauty out of pure simplicity.</p><h6><a href="http://fearlessflyer.com/u/europa">Europa</a></h6><p>Big solid fonts, grayscale schema, massive spacing &#8211; this template speaks simple yet beauty.</p><p><a href="http://fearlessflyer.com/u/europa"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/europa.jpg" alt="europa" title="europa" width="576" height="323" class="alignnone size-full wp-image-1552" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/europa">You can view the Item here</a>, or <a href="http://alaja.info/europa/wordpress/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/squared3">Squared3</a></h6><p>Squared3 has good typography, as well as excellent color scheme.</p><p><a href="http://fearlessflyer.com/u/squared3"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/squared3.jpg" alt="squared" title="squared" width="576" height="323" class="alignnone size-full wp-image-1560" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/squared3">You can view the Item here</a>, or <a href="http://www.practicefieldadv.com/wp/squared3/ "target="_blank">Demo from Here</a></p><h6><a href="http://fearlessflyer.com/u/minimalistic">Minimalistic Studio</a></h6><p>This template should also have been in the &#8220;Wild Slideshow Transitions&#8221; category, again &#8211; a nice solid template with simple accents and design applications yet effective results.</p><p><a href="http://fearlessflyer.com/u/minimalistic"><br /> <img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/minimalisticstudio.jpg" alt="minimalistic" title="minimalistic" width="576" height="323" class="alignnone size-full wp-image-1556" /><br /> </a></p><p><a href="http://fearlessflyer.com/u/minimalistic">You can view the Item here</a>, or <a href="http://minimalistic-studio.wpstall.com/ "target="_blank">Demo from Here</a></p><h3>Conclusion</h3><p>There you have it, a collection of tasty design trends in themeforest templates. What did you think of them? Would you buy any of these templates? Did you at least get inspired to build something as beautiful? Do you notice any other trends in Themeforest or elsewhere that is worth mentioning? Let me know your thoughts in the comments section:</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/06/tasty-trends-in-themeforest-templates/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Pretty Hover Effects with CSS and jQuery</title><link>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/</link> <comments>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/#comments</comments> <pubDate>Wed, 09 Jun 2010 01:14:17 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jQuery]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1509</guid> <description><![CDATA[This article will show you how to create pretty hover effects for your images using jQuery and CSS. The plan is to use a clean mark up, adding the necessary elements on the fly. What this means is that we are starting from barebones image HTML tags, with title attributes only. This can come useful [...]]]></description> <content:encoded><![CDATA[<p>This article will show you how to create pretty hover effects for your images using jQuery and CSS. The plan is to use a clean mark up, adding the necessary elements on the fly. What this means is that we are starting from barebones image HTML tags, with title attributes only.  This can come useful especially if you already have hundreds of images that you want to apply this effect on.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/pretty-hovers/">View the Demo:</a></div><div class="special"> Or Download the source files from <a href="http://fearlessflyer.com/downloads/Pretty-Hovers.zip">Here.</a> Also, feel free to browse the rest of my <a href="http://fearlessflyer.com/downloads/">downloadable stuff</a></div><p>Take a look at our markup:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;&lt;img src=&quot;images/77335_4871.jpg&quot; title=&quot;Autumn Leaves&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/107023_5283.jpg&quot; title=&quot;Cloudy Skies&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1282015_12556521.jpg&quot; title=&quot;Nice Horsy&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1262387_19591724.jpg&quot;  title=&quot;Grassy Meadows&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/220121_3233.jpg&quot; title=&quot;Jigsaw Pieces&quot;  /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;images/1282209_96954111.jpg&quot; title=&quot;Retro Groove&quot;  /&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div><p>Pretty clean right? Ok, now we start manipulating and styling with code:</p><h3>Step 1: Wrapping Elements with jQuery</h3><p>We are going to use jQuery to find all these images in a list item and check if it has a title attribute. If it does, it will wrap the image in a DIV with class name “<em>wrapper</em>”.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td 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: #003366; font-weight: bold;">var</span> thumbs <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul li img&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
&nbsp;
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> ii <span style="color: #339933;">=</span> thumbs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> ii<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span> <span style="color: #339933;">&amp;&amp;</span> thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>								
				$<span style="color: #009900;">&#40;</span>thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=&quot;wrapper&quot; /&gt;'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div><p>jQuery will also take the contents of the image’s title and place it inside another DIV called “<em>caption</em>” and place it inside <strong>wrapper</strong>, right after the image itself. Finally, let&#8217;s remove the title attribute from the image tag.</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: #003366; font-weight: bold;">var</span> imgtitle <span style="color: #339933;">=</span> thumbs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span><span style="color: #339933;">;</span>	
after<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=<span style="color: #000099; font-weight: bold;">\'</span>caption<span style="color: #000099; font-weight: bold;">\'</span>&gt;'</span> <span style="color: #339933;">+</span> imgtitle <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>.
				<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>					
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>Now take a look at our mark up when the document loads:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul&gt;
&lt;li&gt;
&lt;div class=”wrapper”&gt;&lt;img src=&quot;images/77335_4871.jpg&quot; /&gt;&lt;/div&gt;
&lt;div class=”caption”&gt; Autumn Leaves&lt;/a&gt;
&lt;/li&gt;
...
&lt;/ul&gt;</pre></td></tr></table></div><p>Pretty slick right? Now let&#8217;s move forward.</p><h3>Step 2: General Styling with CSS</h3><p>Now that we have our DIVs in place, we can now set up the general styles with our stylesheet. What we’re trying to achieve is to hide the caption from a viewing area set on its containing DIV: wrapper.</p><p>Take a look at our stylesheet:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.wrapper</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;">218px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">218px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</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>
div<span style="color: #6666ff;">.caption</span> <span style="color: #00AA00;">&#123;</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: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>Note that the wrapper dimensions are taken from how wide and tall the images are.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/pretty-hovers1.jpg" style="border:none" /></p><h3>Step 3: Events and More Styling with jQuery</h3><p>Now back to our script, all we need to do now is assign a couple of events to the hover method of our wrapper DIV.  Thankfully, jQuery’s <strong>.hover()</strong> simplifies this action by letting us bind two handlers (in and out) all within the same context.</p><p>All we need to achieve is a way to slide the caption DIV upwards when we hover (maybe decrease the opacity of the image), then slide the DIV back downwards when we mouse out:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.wrapper'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</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;.6&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.caption'</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>top<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;-85px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</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.0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.caption'</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>top<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;85px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</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>Notice that I also used the <strong>.animate()</strong> function for manipulating the CSS properties which renders all of our effects smoothly.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/06/pretty-hovers2.jpg" style="border:none;" /></p><h3> Optional Pretty Styling:</h3><p>For demonstration purposes I’ve added pretty backgrounds, as well as font types to maximize the effect. Simply add a background to the DIV caption, and assign different font types and styles (check out <a href="http://code.google.com/webfonts">Google Fonts</a>).</p><p>There you have it. You have just created your own image hover effects using jQuery and CSS. You can download the source code from <a href="http://fearlessflyer.com/downloads/Pretty-Hovers.zip">here</a>, or <a href="http://demo.fearlessflyer.com/html/demo/pretty-hovers/">view the live demo</a>.</p><p>Please feel free to comment below on what you think of this tutorial.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/06/pretty-hover-effects-with-css-and-jquery/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Free HTML and PSD template &#8211; Sifiso</title><link>http://fearlessflyer.com/2010/05/free-html-and-psd-template-sifiso/</link> <comments>http://fearlessflyer.com/2010/05/free-html-and-psd-template-sifiso/#comments</comments> <pubDate>Mon, 17 May 2010 18:31:43 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[Freebies]]></category> <category><![CDATA[General]]></category> <category><![CDATA[HTML and PSD]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[free]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[portfolio]]></category> <category><![CDATA[PSD]]></category> <category><![CDATA[Quality]]></category> <category><![CDATA[template]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[Web 2.0]]></category> <category><![CDATA[XHTML]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1468</guid> <description><![CDATA[This time around I&#8217;m giving away an HTML template with the Photoshop files for &#8220;Sifiso&#8221;. Sifiso is a one page &#8220;portfolio-like&#8221; template which you can use for your personal site. It features bold colors, transparent elements as well as hard to miss extra large icons. Sifiso is ideal for web designers, illustrators and photographers; You [...]]]></description> <content:encoded><![CDATA[<p>This time around I&#8217;m giving away an HTML template with the Photoshop files for <em>&#8220;Sifiso&#8221;</em>. Sifiso is a one page &#8220;portfolio-like&#8221; template which you can use for your personal site. It features bold colors, transparent elements as well as hard to miss extra large icons. Sifiso is ideal for web designers, illustrators and photographers; You can use Sifiso as a final product for your own site, or as a good starting point for your clients.</p><div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/sifiso/">View The Demo!</a></div><div class="special">You can download Sifiso&#8217;s source code from <strong><a href="http://fearlessflyer.com/downloads/Sifiso-Source-Code.zip">here</a> </strong>and PSD files from this <strong><a href="http://fearlessflyer.com/downloads/Sifiso-PSD.zip">link</a></strong>.</div><h3>Features</h3><p>The one pager Sifiso has all the right stuff for a strong personal portfolio:</p><div class="one"><strong>a catchy introduction area</strong> &#8211; a sexy summary of what you do. You have to edit the text in the PSD to change this section</div><div class="two"><strong>a testimonials section </strong>- sport what your clients say about you. Simply edit the text inside the p tags in the HTML</div><div class="three"><strong>a spot for quotes </strong>- maybe a couple of words from famous people in your industry, again &#8211; open the PSD to edit this area</div><div class="four"><strong>showcase area</strong> &#8211; screenshots of your best stuff, add your own pictures and edit the HTML.</div><div class="five"><strong>finally, a contact form</strong> &#8211; how else will they get a hold of you? This will have to be done in a server side language of your choice</div><p><a href="http://demo.fearlessflyer.com/html/demo/sifiso/"><img class="alignnone size-full wp-image-1474" style="border: 0;" title="Features for Sifiso" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/full2.jpg" alt="" width="576" height="1100" /></a></p><h3>How to Edit</h3><p>The source code is very pretty straightforward &#8211; simply edit the HTML with your own. The PSD contains 4 files &#8211; one for each main section of the page. All files are layered, grouped and labeled. To edit a text section &#8211; find the layer and edit the text within. Fonts used are &#8220;AR Blanca&#8221; (for the logo), and &#8220;Helvetica Nueu LT Std&#8221; for everything else.</p><p><img class="alignnone size-full wp-image-1477" title="Editing Sifiso" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/how-to-edit.jpg" alt="" width="576" height="400" /></p><h3>Conclusion</h3><p>Keep in mind that even though Sifiso may be full of images, it is still coded professionally to conform to standards and SEO. I hardly used any &#8220;image&#8221; tags (except for the portfolio section), and still used HTML text where it should be (see screenshot below).</p><p><img class="alignnone size-full wp-image-1478" title="Sifiso is SEO friendly" src="http://fearlessflyer.com/main/wp-content/uploads/2010/05/seo.jpg" alt="" width="576" height="400" /></p><p>*Note that I talked about how to code this way in my 3 part post: <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">How to create a single page portfolio from scratch</a></strong>.</p><div class="viewdemo"><a href="http://demo.fearlessflyer.com/html/demo/sifiso/">View The Demo!</a></div><div class="special">You can download Sifiso&#8217;s source code from <strong><a href="http://fearlessflyer.com/downloads/Sifiso-Source-Code.zip">here</a> </strong>and PSD files from this <strong><a href="http://fearlessflyer.com/downloads/Sifiso-PSD.zip">link</a></strong>.</div><p>Credits to the icon developers:Coffee Mug by <a href="http://omercetin.deviantart.com/art/Apple-Mug-Icons-and-Extras-152648713"> Omercitin</a>, Paintbrushes by <a href="http://artdesigner.lv/en/archives/342">ArtDesigner.lv</a> and Briefcase by <a href="http://thirteen-eightyone.deviantart.com/art/Briefcase-149934549">thirteen eightyone</a>.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/05/free-html-and-psd-template-sifiso/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch – Part 3: jQuery and PHP</title><link>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/</link> <comments>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/#comments</comments> <pubDate>Fri, 23 Apr 2010 02:40:16 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1369</guid> <description><![CDATA[Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding [...]]]></description> <content:encoded><![CDATA[<p>Finally, we have come to the conclusion of this 3 part series. This part focuses on user interactions and functionality of our portfolio. The upper sections of the page I will take you through inserting several plugins as well as custom jQuery code that will make our page alive. This includes a rotating slideshow, expanding and hiding sections and a modal view of images – also known as a “<strong>lightbox</strong>” effect. And to wrap it all up, we will add a small PHP snippet into our footer so we will have a working contact form.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p>Are you ready to get your hands dirty? Let’s start coding:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/part3.jpg" alt="" title="Part 3 of 3" width="576" height="189" class="alignnone size-full wp-image-1370" style="border:0;" /></p><h3>Convert the Feature into a jQuery Powered Slideshow:</h3><p>Our feature section looks good as it is. Though it would be better if the large image on the right would change and cycle through other images. In other words, we need to convert it into a slideshow of our best work.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp1.jpg" alt="" title="Well convert this into a slideshow" width="576" height="323" class="alignnone size-full wp-image-1371" /></p><h4>Adding the Script Files</h4><p>First thing we need to do is download jQuery. jQuery will be powering all of the javascript we’re using for our page. Head on to <a href="http://jquery.com/">http://jquery.com/</a>, download and save it into our current directory.</p><p>Inside the head section of our HTML, insert our script tag:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;</pre></div></div><p>Now all of jQuery’s magic is in our fingertips. Download the slideshow plugin from: <a href="http://jquery.malsup.com/cycle/">http://jquery.malsup.com/cycle/</a>. Right below our first script tag, insert directly below:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;jquery.cycle.all.2.72.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
	$(document).ready(function(){
		//cycle plugin
		$('.slideshow').cycle({
			fx: 'fade' 
		});
&lt;/script&gt;</pre></td></tr></table></div><h4>Getting the images ready:</h4><p>Now that our scripts are intact, let’s get our images and our stylesheet ready so the animation will take place. Open <strong>feature.png</strong> in Photoshop and create new guides as shown below. Make sure you cut right down to the pixel.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp2.jpg" alt="" title="Add new guides" width="576" height="547" class="alignnone size-full wp-image-1372" /></p><p>Cut out the center image and fill with solid color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp3.jpg" alt="" title="Fill with color" width="576" height="547" class="alignnone size-full wp-image-1373" /></p><p>Save the file under the same name.</p><p>Create several images that will go inside the slideshow -<strong> all must have the same dimensions</strong> &#8211; in our case: 476 pixels and 349 pixels.</p><p>Insert the HMTL right below the feature div. Of course you will replace the image names with your images, along with the right path:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;slideshow&quot;&gt;
&lt;img src=&quot;images/feature-1.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-2.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-3.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-4.jpg&quot;/&gt;
&lt;img src=&quot;images/feature-5.jpg&quot;/&gt;		
&lt;/div&gt;</pre></td></tr></table></div><p>Append this code inside your existing style.css file:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #6666ff;">.slideshow</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;">right</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: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-24px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>This ensures that the slideshow will sit on top of the designated box in the feature div:</p><p>Preview index.html in your browser. By now you should see your new slideshow swapping your images in your feature section:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp4.jpg" alt="" title="Our slideshow is in place" width="576" height="323" class="alignnone size-full wp-image-1374" /></p><p><strong>Next up: The expanding sections, and the “lightbox” effect.</strong></p><h3>Adding the “More” click events on the sections below the fold:</h3><p>We have two sections below the fold that showcase what our work is all about. One is the useful “<strong>Testimonials</strong>” section – where visitors read what others are saying about our services. And of course, the “<strong>Previous Work</strong>” area – where you plug in screenshots of work that you’ve done. This may be websites, photographs, software; anything that can be screen captured you can apply.</p><p>The point is to only show a few of testimonials, and a few thumbnails of your previous work. When visitors click on the “<strong>More</strong>” buttons, the section expands to show the rest.</p><p>This approach is also best for people who have plenty of work, but only would like to show a little at first.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp5.jpg" alt="" title="The More Buttons" width="576" height="630" class="alignnone size-full wp-image-1375" /></p><p>Insert the code below inside the <strong>$(document)</strong>.ready function:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2), #previous-work ul li:gt(3)&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: #339933;">;</span>		
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-testimonials'&gt;More Testimonials&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div class='more'&gt;&lt;a id='more-previous-work'&gt;More Previous Work&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&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>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>		
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.column:gt(2)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-testimonials&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Testimonials&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&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>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>							
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Less Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#previous-work ul li:gt(3)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a#more-previous-work&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;More Previous Work&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>			
			event.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</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>The above code first hides our testimonial DIVS (that are greater than 3) and our previous work list items (that are greater than 4). Then it alters the HTML of our buttons, as well as toggle our hidden sections to appear while sliding slowly.</p><h3>Adding the light show effect for the Portfolio gallery:</h3><p>For the portfolio thumbnails &#8211; it would really be nice to add a “lightbox” effect once the images are clicked. Lightbox provide a way for viewers to see the detailed image without physically leaving the page. For our portfolio &#8211; we’re using <a href="http://fancybox.net/">http://fancybox.net/</a></p><p>Download: <a href="http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip">http://fancybox.googlecode.com/files/jquery.fancybox-1.2.6.zip</a><br /> Extract the files and copy the folder “<strong>fancybox</strong>” from the unzipped file and place in the root folder of our portfolio. Inside index.html, place the code in the head section:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;./fancybox/jquery.fancybox-1.2.6.pack.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./fancybox/jquery.fancybox-1.2.6.css&quot; media=&quot;screen&quot; /&gt;</pre></td></tr></table></div><p>Inside our custom script tag, (right after the last “<strong>});</strong>”) insert the block of code:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.zoom&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancybox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'zoomSpeedIn'</span>	<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'zoomSpeedOut'</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>In our unordered list of thumbnails, insert this “<strong>class</strong>” and “<strong>rel</strong>” attributes for each anchor tag:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">class=&quot;zoom&quot; rel=&quot;group&quot;</pre></div></div><p>Refresh <strong>index.html</strong> in your browser and click a thumbnail. You should now see the effects of Fancy box from your portfolio:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp-unknown.jpg" alt="" title="The lightbox effect" width="576" height="323" class="alignnone size-full wp-image-1377" /></p><p><strong>Last step: The contact form.</strong></p><h3>Completing the Contact Form with PHP</h3><p>Since HTML and javascript doesn’t support contents of a form to be sent through email, we need a little help from PHP to bring our contact form to life. We are now working with server side technology, so won’t be able to test our file without a web server. So in order to test our code, upload your file to your web host or run apache locally using <strong>WAMP</strong> or <strong>MAMP</strong>.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp6.jpg" alt="" title="Server side code needs a web server" width="576" height="400" class="alignnone size-full wp-image-1380" /></p><p>First thing we have to do is change the extension of <strong>index.html</strong> to <strong>.php</strong>. We will be working with the .php file from now on. You can discard the .html version – or keep it for archive.</p><p>Look for the form tag inside <strong>index.php</strong>; add a method and an action attribute:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form id=&quot;contact-form&quot; method=&quot;post&quot; action=&quot;&quot;&gt;</pre></div></div><p>This enables our form to use the <strong>$_POST</strong> array and be processed by the same page. To test the contents of our post array, type the following code right above the form:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;pre&gt;
&lt;?php print_r($_POST) ?&gt;</pre></td></tr></table></div></pre><p>Now, add some stuff to the form fields, click “<strong>Submit</strong>” and see what our pre tags have spitted out:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp7.jpg" alt="" title="Contents of our post array" width="576" height="400" class="alignnone size-full wp-image-1381" /></p><p>Now we know what we need to work with as far as the contents of our post array. We can now remove the  pre tags and continue to work on our code. Add the following code on the very top of the page (even before the !DOCTYPE declaration):</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="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//see number 1</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'send'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//see number 2</span>
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'youremail@mail.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is your email address</span>
	<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From Your Contact Form'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comments'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  
		<span style="color: #666666; font-style: italic;">//see number 3</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Name: <span style="color: #006699; font-weight: bold;">$name</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Email: <span style="color: #006699; font-weight: bold;">$email</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$message</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Comments: <span style="color: #006699; font-weight: bold;">$comments</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//see number 4</span>
	<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p><strong>What the above code is doing: </strong></p><div class="one">checks to see if the “<strong>submit</strong>” button has been clicked by checking if an array key by the name of “send” exists. If it does, the rest of the code executes:</div><div class="two">we’re creating several variables that we can work with – this includes $to – email address to send to, along with the contents of the post array</div><div class="three">we’re compiling the message by concatenating the variables we’ve created</div><div class="four">finally, the “<strong>mail</strong>” function which is what allows you send mail</div><p>Now it’s time to test the code. Enter your email address into the <strong>$to</strong> variable then upload index.php to your web server. Fill out the form fields and click “<strong>submit</strong>”. You should receive an email similar to below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/04/sp8.jpg" alt="" title="Sample Email" width="576" height="291" class="alignnone size-full wp-image-1382" /></p><p>Now remember <strong>that this is a stripped down version of a contact form</strong>. You should seriously consider adding several things such as form validation and formatting the entries for safe and legitimate values. Also add error and success messages to let the user know what’s going on. (I won’t cover such things because as you can see – this tutorial has gone waaay too long).</p><h3>Final Words</h3><p>There you have it - a complete single page portfolio. We started all the way from scratch: Mocked up the concept in Photoshop, hand coded the HTML, while slicing the images and writing the CSS. We've added some jQuery magic as well as a little bit of PHP functionality. As you see - a lot of work does go into it (and that's just a single page!)</p><p>In closing, I hope that you may learn something from this 3 part series. I also would like to thank the script and plugin developers which I included in this tutorial. You can <strong><a href="http://fearlessflyer.com/downloads/single-page-portfolio-final.zip">download the finished product from this link</a></strong>, and of course<strong><a href="http://demo.fearlessflyer.com/html/demo/one/"> view the live demo</a></strong> from here.</p><div class="special"> This tutorial is part 3 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>16 Beautiful Restaurant Websites</title><link>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/</link> <comments>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/#comments</comments> <pubDate>Fri, 22 Jan 2010 20:23:34 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Inspiration]]></category> <category><![CDATA[Websites]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[food]]></category> <category><![CDATA[menu]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[restaurant]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1196</guid> <description><![CDATA[One of the challenging parts of web design is to provide exactly what your client needs. Some of them look to advertise a product. Others offer some kind of service, while the rest want a website for general information about their organization. Recently, I had to design for a local restaurant. Restaurant owners are quite [...]]]></description> <content:encoded><![CDATA[<p>One of the challenging parts of web design is to provide exactly what your client needs. Some of them look to advertise a product. Others offer some kind of service, while the rest want a website for general information about their organization. Recently, I had to design for a local restaurant. Restaurant owners are quite the hybrid of all the clientele types I mentioned because they:  1) want a website to advertise their products *usually in a menu form, 2) promote their services and friendly staff and 3) show the world about their fine establishment.</p><p>As I was searching the net for good restaurant websites, I stumbled upon these 16 sites which had all the elements that my client needed.  In addition, some of these websites look so good – that it would inspire many of you designers out there. Note that I included my work in the list (its my blog &#8211; I can do whatever I want).</p><p><strong><a href="http://thenoodlebox.net/">http://thenoodlebox.net/</a></strong><br /> <a href="http://thenoodlebox.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/the-noodle-box.jpg" alt="the-noodle-box" width="576" height="323" class="alignnone size-full wp-image-1211" /></a></p><p><strong><a href="http://www.rubytuesday.com/">http://www.rubytuesday.com</a></strong><br /> <a href="http://www.rubytuesday.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/ruby-tuesdays.jpg" alt="ruby-tuesdays" width="576" height="323" class="alignnone size-full wp-image-1208" /></a></p><p><strong><a href="http://www.twelve-restaurant.co.uk/">http://www.twelve-restaurant.co.uk/</a></strong><br /> <a href="http://www.twelve-restaurant.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/twelve-restaurant.jpg" alt="twelve-restaurant" width="576" height="323" class="alignnone size-full wp-image-1213" /></a></p><p><strong><a href="http://www.pizzaza.ca/">http://www.pizzaza.ca/</a></strong><br /> <a href="http://www.pizzaza.ca/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/pizzaza.jpg" alt="pizzaza" width="576" height="323" class="alignnone size-full wp-image-1206" /></a></p><p><strong><a href="http://www.nuevo-aurich.de/">http://www.nuevo-aurich.de/</a></strong><br /> <a href="http://www.nuevo-aurich.de/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/nuevo-aurich.jpg" alt="nuevo-aurich" width="576" height="323" class="alignnone size-full wp-image-1205" /></a></p><p><strong><a href="http://www.pomonavalleyminingco.com/">http://www.pomonavalleyminingco.com/</a></strong><br /> <a href="http://www.pomonavalleyminingco.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/pomona-valley-mining.jpg" alt="pomona-valley-mining" width="576" height="323" class="alignnone size-full wp-image-1207" /></a></p><p><strong><a href="http://www.lapizarraproject.com/">http://www.lapizarraproject.com/</a></strong><br /> <a href="http://www.lapizarraproject.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/la-pizarra.jpg" alt="la-pizarra" width="576" height="323" class="alignnone size-full wp-image-1204" /></a></p><p><strong><a href="http://www.villagerkent.com/">http://www.villagerkent.com/</a></strong><br /> <a href="http://www.villagerkent.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/the-villager.jpg" alt="the-villager" width="576" height="323" class="alignnone size-full wp-image-1212" /></a></p><p><strong><a href="http://www.bertoldis.ca/">http://www.bertoldis.ca/</a></strong><br /> <a href="http://www.bertoldis.ca/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/bertoldis.jpg" alt="bertoldis" width="576" height="323" class="alignnone size-full wp-image-1198" /></a></p><p><strong><a href="http://www.caferouge.co.uk/">http://www.caferouge.co.uk/</a></strong><br /> <a href="http://www.caferouge.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/cafe-rouge.jpg" alt="cafe-rouge" width="576" height="323" class="alignnone size-full wp-image-1199" /></a></p><p><strong><a href="http://jakesrh.net/">http://jakesrh.net/</a></strong><br /> <a href="http://jakesrh.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/jakes-roadhouse.jpg" alt="" title="I did this!" width="576" height="323" class="alignnone size-full wp-image-1203" /></a></p><p><strong><a href="http://www.belgo-restaurants.co.uk/">http://www.belgo-restaurants.co.uk/</a></strong><br /> <a href="http://www.belgo-restaurants.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/belgo.jpg" alt="belgo" width="576" height="323" class="alignnone size-full wp-image-1197" /></a></p><p><strong><a href="http://www.giraffe.net/">http://www.giraffe.net/</a></strong><br /> <a href="http://www.giraffe.net/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/giraffe.jpg" alt="giraffe" width="576" height="323" class="alignnone size-full wp-image-1200" /></a></p><p><strong><a href="http://www.sandiegobrewing.com/">http://www.sandiegobrewing.com/</a></strong><br /> <a href="http://www.sandiegobrewing.com/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/san-diego-brewing.jpg" alt="san-diego-brewing" width="576" height="323" class="alignnone size-full wp-image-1209" /></a></p><p><strong><a href="http://www.hoddows-gastwerk.de/">http://www.hoddows-gastwerk.de/</a></strong><br /> <a href="http://www.hoddows-gastwerk.de/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/hoddows.jpg" alt="hoddows" width="576" height="323" class="alignnone size-full wp-image-1201" /></a></p><p><strong><a href="http://www.strada.co.uk/">http://www.strada.co.uk/</a></strong><br /> <a href="http://www.strada.co.uk/"><img src="http://fearlessflyer.com/main/wp-content/uploads/2010/01/strada.jpg" alt="strada" width="576" height="323" class="alignnone size-full wp-image-1210" /></a></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2010/01/16-beautiful-restaurant-websites/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</title><link>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/</link> <comments>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/#comments</comments> <pubDate>Sun, 13 Dec 2009 23:30:22 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Websites]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[html]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[php]]></category> <category><![CDATA[single page portfolio]]></category> <category><![CDATA[tutorial]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=1035</guid> <description><![CDATA[Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in [...]]]></description> <content:encoded><![CDATA[<p>Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in my case I’m using Dreamweaver) and multiple browsers for page testing. We’re also going to toggle between these tools a lot so be prepared to switch programs by using alt + tab often.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p>To preview what we are going to build &#8211; <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">see the demo page</a></strong>. Just in case you missed the first tutorial, click <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">here</a></strong>. So are you ready to get started? Let’s begin:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/part2.jpg" alt="part2" title="This is Part 2 of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1122" style="border:0;" /></p><h3>The Wrap, Header and Feature Divs</h3><p>First of all, you will notice that our layout doesn’t really have anything in the header. This is because I’m sure you will use your own logo for your design &#8211; so I left that out. Second, is there really is no need for a navigation bar because we’re only building a single page. Although we may include some anchors in this area so we can quickly jump from one section of the page to another. Also important to recognize that most modern websites now have a large “feature” section which packs the main message of the website. This effect is proven to be pretty effective &#8211; that’s why we’re applying the same concept to our portfolio site.</p><p>In Dreamweaver, create a new HTML page, name it “<strong>index.html</strong>” and save it.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp1.jpg" alt="sp1" title="New HTML document in Dreamweaver" width="576" height="478" class="alignnone size-full wp-image-1037" /></p><p>Create a CSS document &#8211; name it “<strong>styles.css</strong>” and save it in the same location as “index.html”. Link to the stylesheet from index.html by using a link tag:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;link type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>  href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;styles.css&quot;</span> rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> /<span style="color: #00AA00;">&gt;</span></pre></div></div><p>Now, we create the main DIV &#8211; we’ll call this the “<strong>wrap</strong>”. In this DIV we’ll house almost all of our elements (all but one: the footer &#8211; which I’ll explain later). In index.html, enter the code:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;div id<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;wrap&quot;</span><span style="color: #00AA00;">&gt;</span>  &lt;/div<span style="color: #00AA00;">&gt;</span>&lt;!--wrap--<span style="color: #00AA00;">&gt;</span></pre></div></div><p>Next, we grab the body style of our page. Go to Photoshop and open our mockup. Flatten the image (“<strong>Layer</strong>” > “<strong>Flatten Image</strong>”) and grab a piece of background:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp2.jpg" alt="sp2" title="Grab a piece for the background" width="576" height="334" class="alignnone size-full wp-image-1038" /></p><p>Still in Photoshop, press Ctrl + C to copy the selected area, create a new document &#8211; and paste (this will be our HTML body background that will span horizontally). Save this file as “<strong>body-bg.gif</strong>” inside a folder called “<strong>images</strong>” in our root directory.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp3.jpg" alt="sp3" title="Save as body-bg.gif" width="576" height="478" class="alignnone size-full wp-image-1039" /></p><p>Next is we apply some fixin’s to our CSS:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</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: #cc66cc;">0</span><span style="color: #00AA00;">&#125;</span>
  body<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/body-bg.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #cc00cc;">#f3f2ed</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>The above code tells everything to reset to 0 padding and 0 margin. It also applies the body background to the image we just created, repeat it horizontally and apply the color #f3f2ed everywhere else. View your file in the browser, you should have something like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp4.jpg" alt="sp4" title="This is how our HTML looks so far" width="576" height="454" class="alignnone size-full wp-image-1040" /></p><p>Now remember we created the main div? That is just sitting in somewhere in the page. Let’s apply some standard measurements to it and align it so it settles perfectly in the middle of our browser.</p><p>Note that in the beginning of this tutorial &#8211; I was going to use the <strong>960.gs</strong> framework, but feel as though I’m cheating because the tutorial calls for “<strong>from scratch</strong>”. So I decided, I’m not using the framework and code everything by hand, hence &#8211; “<strong>from scratch</strong>”.</p><p>Add this code to your style.css:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#CCCCCC</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>This centers our wrap in the middle of the page, as well as set the default 960 pixels width. The background color and the minimum height properties are added temporarily so we can tell from the browser what we’re working with. Refresh your page and you should have something like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp5.jpg" alt="sp5" title="Our Wrap DIV in gray background" width="576" height="349" class="alignnone size-full wp-image-1041" /></p><p>Go back to index.html and add the <strong>header </strong>div inside the wrap div:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div  id=&quot;header&quot;&gt;&lt;/div&gt;&lt;!--header--&gt;</pre></div></div><p>Back to our style.css &#8211; add this piece of code:</p><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;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>Refresh your browser &#8211; and you can see where our header sits nicely on top. The background color again is temporary.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp6.jpg" alt="sp6" title="See the Header?" width="576" height="349" class="alignnone size-full wp-image-1042" /></p><p>Next is our feature div. Create a new div tag in your index.html with the id of “<strong>feature</strong>”, place in between the “feature” divs. Add two paragraph tags inside with your own text. In my case &#8211; I’m using the default Lorem latin filler text:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;feature&quot;&gt;
&lt;p id=&quot;slogan&quot;&gt;&lt;!--your fantastic slogan goes here--&gt;&lt;/p&gt;
&lt;p&gt;&lt;!--followed by a smaller, but also fantastic slogan here--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--feature--&gt;</pre></td></tr></table></div><p>Notice the first paragraph tag has an id of “<strong>slogan</strong>”. This is because this is the primary text that we are going to style with an image. We are treating it as regular text for SEO purposes.</p><p>Go back to your mock up in Photoshop and press “<strong>Step Backward</strong>” (ctrl + z + alt) several times until you get the fully layered version once again. Make sure the guides are showing &#8211; select the feature section like below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp7.jpg" alt="sp7" title="Grab our Feature Area in Photohsop" width="576" height="454" class="alignnone size-full wp-image-1043" /></p><p>In your layers panel, make sure you hide all the layers that shouldn’t be shown. This includes all the background layers and text elements. The only layer that should remain is the large feature image and the borders and glow to the left. Select the feature area and hit crop (“image” > “crop”). Save this as “<strong>feature.png</strong>” inside our images folder. This will be our feature div background image:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp8.jpg" alt="sp8" title="Save as feature.png" width="576" height="413" class="alignnone size-full wp-image-1044" /></p><p>Now in our styles.css &#8211; add the following code:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/feature.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">394px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>Go back to your mockup and click “<strong>Step Backward</strong>” (“Edit” > “Step Backward”) to uncrop. Unhide the slogan layer and select it according to the guides. Crop once again and save this as “<strong>slogan.png</strong>”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp9.jpg" alt="sp9" title="Save as slogan.png" width="576" height="454" class="alignnone size-full wp-image-1045" /></p><p>Now add this code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#feature</span> p<span style="color: #cc00cc;">#slogan</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/slogan.png</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">192px</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;">-9999px</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: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</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;">#feature</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">320px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">48px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">28px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>The above code styles the two paragraph tags inside the feature div. The first one with a background image, and the next one as plain text. Now when search engines crawl our page &#8211; it still thinks both are plain text &#8211; which is a good thing.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp10.jpg" alt="sp10" title="Voila! Our HTML is coming along!" width="576" height="387" class="alignnone size-full wp-image-1046" /></p><p>I’ve also taken out the color property in our wrap div to see how our feature looks like. Another thing to remember is that since our feature sits in its own div &#8211; it will be easy to add a slideshow or something to that effect as replacement.</p><p>Now that our wrap, header and feature is in place, we’re ready to move to the next sections: <strong>Testimonials and Previous Work:</strong></p><h3>Testimonials and Previous Work Sections</h3><p>If the feature section is our hard hitter &#8211; a testimonials area is our “<strong>counter punch</strong>”. Testimonials are a sure fire way of telling our viewers: “<em>we’re good &#8211; read what others are saying about me!</em>”. Also another proven way of increasing business, it is also the reason why we’re putting testimonials right below our feature section. Ready to continue coding? Let’s keep going.</p><p>In our index.html, add the code for our testimonials. Place this directly below our feature div:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;column first&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;div class=&quot;column last&quot;&gt;
&lt;p&gt;&lt;!--your content here--&gt;&lt;/p&gt;&lt;strong&gt;&lt;!--author here--&gt;&lt;/strong&gt;
&lt;/div&gt;&lt;!--column--&gt;
&lt;/div&gt;&lt;!--testimonials--&gt;</pre></td></tr></table></div><p>Of course, you substitute real testimonials and authors in its place. Notice the “first” and “last” additional classes to the columns &#8211; we need this to fix our margins in our css. Next, go back to Photoshop and go backwards again so you get back to the original uncropped file. Select the Testimonials title all the way to the rightmost guide. Crop and save as “<strong>testimonials-title.jpg</strong>” inside our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp11.jpg" alt="sp11" title="Our Headings Background - Testimonials" width="576" height="454" class="alignnone size-full wp-image-1047" /></p><p>Inside styles.css, append the below code:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/testimonials-title.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</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;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</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;">260px</span><span style="color: #00AA00;">;</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;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:georgia</span><span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span>  arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</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;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">19px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.first</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#testimonials</span> <span style="color: #6666ff;">.column</span><span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>This code adds the background image that we just created to the main testimonials div. It also adds proper styling to the columns inside the div, and fixes to the margins so it remains inside our imaginary grid.</p><p><strong>The optional “more” tab</strong></p><p>The more tab is only necessary if you have more than 3 columns of testimonials that you would like to show. The point is just show 3 columns at first, and by clicking the “<strong>more</strong>” tab &#8211; more testimonial columns will slide below &#8211; most likely to be achieved by jQuery (I haven’t gotten there yet &#8211; remember &#8211; I’m writing this tutorial as I go!).</p><p>To add a more tab &#8211; add this code to your HMTL, right underneath the last column div:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-testimonials&quot;&gt;More  Testimonials&lt;/a&gt;
&lt;/div&gt;&lt;span id=&quot;more-1035&quot;&gt;&lt;/span&gt;</pre></td></tr></table></div><p>Note that we used a class for our div instead of an id. This is because this div can actually be reused in another section of our page.</p><p>Go back to your Photoshop file &#8211; click “<strong>Step Backwards</strong>” to the uncropped version &#8211; select the section that shows the “<strong>more testimonials</strong>” border and button according to your guides. Remember to hide the text layer over the button.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp12.jpg" alt="sp12" title="Our More Tab in the bottom of the section" width="576" height="454" class="alignnone size-full wp-image-1048" /></p><p>Crop and save this as “<strong>more-bg.jpg</strong>” inside the images folder. Add the code below to your .css file:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.more</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/more-bg.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">31px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<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;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.more</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-testimonials</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">16px</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></td></tr></table></div><p>For the “<strong>Previous Work</strong>” section &#8211; it’s pretty much the same process as testimonials. The difference is &#8211; we are actually using an unordered list instead of div columns. Add the following code inside your HTML:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;previous-work&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;last&quot;&gt;&lt;a  href=&quot;images/thumbnail.jpg&quot;&gt;&lt;img  src=&quot;images/thumbnail.jpg&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;more&quot;&gt;
&lt;a id=&quot;more-previous-work&quot;&gt;More Previous  Work&lt;/a&gt;
&lt;/div&gt;&lt;!--more--&gt;
&lt;/div&gt;&lt;!--previous-work--&gt;</pre></td></tr></table></div><p>The thumbnail sizes are going to be 200 pixels width by152 pixels height. My sample code contains dummy thumbnails along with temporary images for the bigger image. We are incorporating a light box effect in the final product so users do not actually leave the page when viewing your gallery. Notice the addition of the “<strong>more</strong>” tab &#8211; which is again, purely optional.</p><p>For the “<strong>Previous Work</strong>” title &#8211; you do the same exact process in Photoshop as you did previously in the Testimonials title. Save this image in the images folder &#8211; name it: “<strong>previous-work-title.jpg</strong>”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp13.jpg" alt="sp13" title="Our other Heading Image - Previous Work" width="576" height="454" class="alignnone size-full wp-image-1049" /></p><p>Now we add some styling to the list items, thumbnails and the entire div section:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/previous-work-title.jpg</span><span style="color: #00AA00;">&#41;</span>  <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">65px</span> <span style="color: #cc66cc;">0</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;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>  <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: #cc66cc;">0</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<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;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #933;">15px</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li<span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/thumb-bg.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">209px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">165px</span><span style="color: #00AA00;">;</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;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a<span style="color: #3333ff;">:hover  </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/thumb-bg-hover.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#previous-work</span> ul li a img <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a<span style="color: #cc00cc;">#more-previous-work</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>I also created a couple of thumbnail image backgrounds for the active and hover states. Again this is purely optional and I won’t go over in this tutorial.</p><p>Now refresh your page in your browser. You should have something like the image below. It is also good practice to start viewing your page in different browsers. This way &#8211; you can start fixing bugs this early in the development process. Next stop is the <strong>footer</strong>.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp14.jpg" alt="sp14" title="The fold and below the fold become unfolded" width="576" height="566" class="alignnone size-full wp-image-1050" /></p><h3>The Footer</h3><p>Let’s go back to our Photoshop file &#8211; you may have to go back in history a couple of times to get you to the uncropped, fully layered version. Another thing to remember is <strong>NOT</strong> to save your original mock up file. This file is to stay in its original form &#8211; we are just cropping, hiding layers as we go to get the parts we want. But in the whole, this mockup .psd file remains in its original state. Select the footer area &#8211; starting from the guide a few pixels above the dark brown area.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp15.jpg" alt="sp15" title="Our Footer in Photoshop" width="576" height="566" class="alignnone size-full wp-image-1051" /></p><p>Once selected &#8211; crop the selection &#8211; but don’t save as of yet; we’re going to save a couple of images from this selection &#8211; one is the footer wrap, the other is the actual footer background.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp16.jpg" alt="sp16" title="Grab a piece for our background" width="576" height="204" class="alignnone size-full wp-image-1052" /></p><p>Once cropped, select the first 20 pixels from the left and crop once again. Save this file as “<strong>footer-wrap.gif</strong>” inside our images folder. Now go back to the Photoshop file and step backwards a couple of times to bring us to entire cropped footer image. Hide the layer group named “<strong>form</strong>”, as well as all the text layers in the footer area.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp17.jpg" alt="sp17" title="Hide Layers and save as the main footer background" width="576" height="388" class="alignnone size-full wp-image-1053" /></p><p>Save this file as “<strong>footer.jpg</strong>” in the images folder. Unhide the text layer that says “Hire Me for Professional Work”, and hide all the background layers so you get full transparency. Select the text area using the rectangular marquee tool and crop. Save this file as “<strong>slogan2.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp18.jpg" alt="sp18" title="Our slogan as .png image" width="576" height="194" class="alignnone size-full wp-image-1054" /></p><p>Now hit “<strong>Step Backward</strong>” (ctrl + alt + z) a couple of times to get to the uncropped footer image and unhide the “<strong>form</strong>” group of layers. Make sure you hide all the layers inside the form &#8211; all we need is the rounded container that embodies the form. Select this area, crop and save this file as “<strong>form-bg.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp19.jpg" alt="sp19" title="Our Form background - save as form-bg.png" width="576" height="269" class="alignnone size-full wp-image-1055" /></p><p>Finally, unhide the button text, shape and glow. Create guides that surround the button image and select accordingly. Crop and save as “<strong>submit.png</strong>” in our images folder.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp20.jpg" alt="sp20" title="Thats one kick ass submit button!" width="576" height="192" class="alignnone size-full wp-image-1056" /></p><p>Now go back to our index.html, add the following code right underneath the entire wrap div.</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
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;footer-wrap&quot;&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;div id=&quot;left-container&quot;&gt;
&lt;p id=&quot;slogan2&quot;&gt;Hire Me for Professional  Work&lt;/p&gt;
&lt;p&gt;&lt;!--your footer slogan in this section&lt;/p&gt;
&lt;/div&gt;&lt;!--left-container--&gt;
&nbsp;
&lt;form id=&quot;contact-form&quot;&gt;
&nbsp;
&lt;div id=&quot;split-left&quot;&gt;
  &lt;label  for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br/&gt;
  &lt;input name=&quot;name&quot; id=&quot;name&quot;  type=&quot;text&quot; class=&quot;formbox&quot;/&gt;&lt;br /&gt;
  &lt;label  for=&quot;email&quot;&gt;Email:&lt;/label&gt;&lt;br /&gt;
  &lt;input name=&quot;email&quot; id=&quot;email&quot;  type=&quot;text&quot; class=&quot;formbox&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;!--split-left--&gt;
  &lt;label  for=&quot;comments&quot;&gt;Comments:&lt;/label&gt;&lt;br /&gt;
  &lt;textarea name=&quot;comments&quot;  id=&quot;comments&quot; type=&quot;textarea&quot; class=&quot;formbox&quot;  /&gt;&lt;/textarea&gt;
  &lt;input name=&quot;send&quot; id=&quot;send&quot;  type=&quot;submit&quot; value=&quot;&quot; class=&quot;send&quot;  /&gt;
&lt;/form&gt;
&nbsp;
&lt;/div&gt;&lt;!--footer--&gt;
&lt;/div&gt;&lt;!--footer-wrap--&gt;</pre></td></tr></table></div><p>The above code sets up all the content in the footer. This includes the two paragraphs on the left side and the contact form. Note that the form is still static. We will be converting this into a working form once we convert this to PHP.</p><p>Next up, is to style the contact form. Add the following code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer-wrap</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/footer-wrap.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</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;">940px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/footer.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">377px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> <span style="color: #cc00cc;">#left-container</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;">400px</span><span style="color: #00AA00;">;</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: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/form-bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">427px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">169px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</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;">40px</span> <span style="color: #cc66cc;">0</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;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">78px</span> <span style="color: #cc66cc;">0</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;">#split-left</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;">170px</span><span style="color: #00AA00;">;</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;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> label<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#9e876b</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#contact-form</span> <span style="color: #6666ff;">.formbox</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">7px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/submit.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">101px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">37px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</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;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
input<span style="color: #3333ff;">:hover</span><span style="color: #6666ff;">.send</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/submit2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p>The above code sets up our footer wrap to span the entire width of the page with its own background image repeating horizontally. Now you understand why we excluded this from the main wrap div? The rest of the code applies the styling to the footer and contact form &#8211; tied to the images we created in the previous steps.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp21.jpg" alt="sp21" title="With all the form elements in place - it looks like a form!" width="576" height="252" class="alignnone size-full wp-image-1057" /></p><p>Finally, we add the final touches to the two paragraph tags on the left side. Add this code to your styles.css:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer</span> p<span style="color: #cc00cc;">#slogan2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>images/slogan2.png<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">123px</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;">-9999px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span> p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</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;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>  <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: #cc66cc;">0</span> <span style="color: #cc00cc;">#000</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;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/sp22.jpg" alt="sp22" title="Our SEO aware slogan and mini slogan" width="576" height="252" class="alignnone size-full wp-image-1036" /></p><p>That concludes are HTML and CSS tutorial on our single page portfolio. Remember, we still have the scripting side to do &#8211; which is handled by PHP and jQuery, which we&#8217;ll cover in the next series. <strong><a href="http://fearlessflyer.com/main/wp-content/uploads/demo/one-page-portfolio/">Click Here to see the DEMO Version</a></strong> of what we just created. The <strong><a href="http://fearlessflyer.com/downloads/Single-Page-Portfolio-HTML.zip">source code is also available to download</a></strong> &#8211; which includes all the files covered in this tutorial.</p><div class="special"> This tutorial is part 2 of three parts: 1) <strong><a href="http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Add a Style Switcher to your WordPress Theme</title><link>http://fearlessflyer.com/2009/12/add-a-style-switcher-to-your-wordpress-theme/</link> <comments>http://fearlessflyer.com/2009/12/add-a-style-switcher-to-your-wordpress-theme/#comments</comments> <pubDate>Sat, 05 Dec 2009 22:29:17 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[WP Themes]]></category> <category><![CDATA[admin panel]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Options]]></category> <category><![CDATA[style switcher]]></category> <category><![CDATA[theme]]></category> <category><![CDATA[Wordpress]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=991</guid> <description><![CDATA[Whenever I download a WordPress theme there’s hardly ever a time that I leave it as is. Almost for sure &#8211; I will have to change some things to customize according to the site’s identity. For instance, maybe I’d want to match the heading styles to a company logo, or change the background colors to [...]]]></description> <content:encoded><![CDATA[<p>Whenever I download a WordPress theme there’s hardly ever a time that I leave it as is. Almost for sure &#8211; I will have to change some things to customize according to the site’s identity. For instance, maybe I’d want to match the heading styles to a company logo, or change the background colors to have the same schema or simply change the link styles to have a sharper look. Wouldn’t it be nice to have the ability to change all of this by switching style sheets from the theme options?</p><p>This tutorial will show you how to create a simple style switcher from your themes options panel. It will have a single drop down list with all the available styles to pick from. Once saved &#8211; your theme will switch to the selected style. Ready to get started &#8211; let’s begin:</p><h3>Part 1 – Set up functions.php</h3><p>First thing you need is a <strong>functions.php</strong> file. A functions file is an optional “plugin” type of file you can include in your theme directory folder.  One of its’ purpose is to setup administration options for your theme – which is exactly what we’re doing. Create a file and name it “<strong>functions.php</strong>” and paste the code below. Note that you need to change variables that define your theme name (<strong>$themename</strong>) and the short name (<strong>$shortname</strong>) to match your themes:</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="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #000088;">$themename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;My Sweet Theme&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$shortname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;mst&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Style Sheet&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;desc&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Enter the Style Sheet you would like to use for Sweet Ass Theme&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;_style_sheet&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;select&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;options&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;green&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;blue&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;yellow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">&quot;std&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p>The above code initializes your theme options structure. First it defines several variables, including a multi-dimensional array (which will become our drop down list containing the four selectable options that will dictate our style sheets). Next is to copy the code below. This code loops through each iteration of the array we declared previously. It assigns a type of form field, displays labels and applies the correct descriptions etc. It also includes several functions that saves the form data, resets information and displays status messages etc. It&#8217;s a wee bit technical &#8211; so its better if we simply copy and paste the code.</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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> mytheme_add_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$themename</span><span style="color: #339933;">,</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'save'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
update_option<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> update_option<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span>  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> delete_option<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: themes.php?page=functions.php&amp;saved=true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">die</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'reset'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
delete_option<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: themes.php?page=functions.php&amp;reset=true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">die</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_theme_page<span style="color: #009900;">&#40;</span><span style="color: #000088;">$themename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Options&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$themename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Options&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'edit_themes'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mytheme_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$themename</span><span style="color: #339933;">,</span> <span style="color: #000088;">$shortname</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'saved'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$themename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' settings saved.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'reset'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$themename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' settings reset.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;wrap&quot;&gt;
&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$themename</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Settings&lt;/h2&gt;
&nbsp;
&lt;form method=&quot;post&quot;&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;table width=&quot;100%&quot; border=&quot;0&quot; style=&quot;background-color:#eef5fb; padding:10px;&quot;&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;/table&gt;&lt;br /&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;table width=&quot;100%&quot; border=&quot;0&quot; style=&quot;background-color:#dceefc; padding:5px 10px;&quot;&gt;&lt;tr&gt;
&lt;td valign=&quot;top&quot; colspan=&quot;2&quot;&gt;&lt;h3 style=&quot;font-family:Georgia,'Times New Roman',Times,serif;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;!--custom--&gt;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;sub-title&quot;</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h3 style=&quot;font-family:Georgia,'Times New Roman',Times,serif; padding-left:8px;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt; 
&lt;!--end-of-custom--&gt;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'text'</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
&lt;td width=&quot;80%&quot;&gt;&lt;input style=&quot;width:400px;&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'textarea'</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
&lt;td width=&quot;80%&quot;&gt;&lt;textarea name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; style=&quot;width:400px; height:200px;&quot; type=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; cols=&quot;&quot; rows=&quot;&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/textarea&gt;&lt;/td&gt;
&nbsp;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'select'</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr&gt;
&lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
&lt;td width=&quot;80%&quot;&gt;&lt;select style=&quot;width:240px;&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'options'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$option</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;option<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$option</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$option</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$option</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;checkbox&quot;</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr&gt;
&lt;td width=&quot;20%&quot; rowspan=&quot;2&quot; valign=&quot;middle&quot;&gt;&lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/strong&gt;&lt;/td&gt;
&lt;td width=&quot;80%&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;checked=<span style="color: #000099; font-weight: bold;">\&quot;</span>checked<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;input type=&quot;checkbox&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;true&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$checked</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;margin-bottom:5px;border-bottom:1px dotted #000000;&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;p class=&quot;submit&quot;&gt;
&lt;input name=&quot;save&quot; type=&quot;submit&quot; value=&quot;Save changes&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;save&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;form method=&quot;post&quot;&gt;
&lt;p class=&quot;submit&quot;&gt;
&lt;input name=&quot;reset&quot; type=&quot;submit&quot; value=&quot;Reset&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;reset&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_add_admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p>Test out your theme options by going under the “<strong>Appearance</strong>” section &gt; “<strong>Your Theme Name Options</strong>” tab. You will see the drop down list with the selectors already in place. Once you hit “<strong>Save Changes</strong>” &#8211; it saves your data. While clicking “<strong>Reset</strong>” sets it back to the default selector. We also see nice status messages appear on top each time we update.</p><p><img class="alignnone size-full wp-image-998" title="Screenshot of the theme options page" src="http://fearlessflyer.com/main/wp-content/uploads/2009/12/style-sheet-switcher1.jpg" alt="style-sheet-switcher1" width="541" height="195" /></p><h3>Part 2 – Create the Style Sheets</h3><p>Create four .css files that correspond to the drop down list selections we defined in our functions.php. The names do not have to exactly match the selectors (but is wise to have some meaningful relation to the names). Save these four files in the root directory of your theme:</p><p><strong>style.css</strong> &#8211; this style sheet is for a black background page with white colored fonts.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS Document */</span>
body <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><strong>green.css</strong> &#8211; this style sheet is for a green background page with white colored fonts.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS Document */</span>
body <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#3bae09</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><strong>blue.css</strong> &#8211; this style sheet is for a blue background page with white colored fonts.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS Document */</span>
body <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#038aba</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><strong>yellow.css</strong> &#8211; this style sheet is for… you get the picture.</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS Document */</span>
body <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f6f658</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><h3>Part 3 – The Switch Statement</h3><p>Now that we have our options working in the back end, and we have our four style sheets sitting in the root folder waiting to be called, all we need now is a way to flip the style sheets in our header file.  We achieve this by using a standard switch statement. A <strong>switch statement</strong> in php is an alternative to the the “if…else” statement. It uses the case keyword which we use to match our selectors to execute a statement that calls the appropriate style sheet. In the default header.php file &#8211; look for the line of code below and delete it:</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</pre></td></tr></table></div><p>This is the standard call for the default style.css file which we no longer need. Next, paste the code below inside your <strong>header.php</strong> file:</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="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$options</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'std'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> get_settings<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>			
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mst_style_sheet</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		 <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>	
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;green&quot;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/green.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;blue&quot;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/blue.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;yellow&quot;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/yellow.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>	
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p>The above code is quite self explanatory. First it grabs whichever values we’ve stored in our theme options. Second &#8211; is the switch statement for our drop down list, followed by cases for each entry &#8211; with its unique statement calling the style sheets.</p><p>Now if you go back to your style switcher and select “<strong>blue</strong>” &#8211; your theme style should switch to blue &#8211; and so on and so forth.</p><p>You can have as many styles as you wish to integrate in your options. As well as the amount of customization in the actual .css files is completely up to you. You can download the source files from this <strong><a href="http://fearlessflyer.com/downloads/style-switcher.zip">link</a></strong> &#8211; simply add these files in your theme folder and change some values &#8211; and your theme will instantly have it’s own style switcher.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/12/add-a-style-switcher-to-your-wordpress-theme/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>Create a Single Page Portfolio from Scratch &#8211; Part 1: Photoshop Mockup</title><link>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/</link> <comments>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/#comments</comments> <pubDate>Wed, 11 Nov 2009 07:20:47 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[HTML and PSD]]></category> <category><![CDATA[Photoshop]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[php]]></category> <category><![CDATA[portfolio]]></category> <category><![CDATA[shiny]]></category> <category><![CDATA[Single column]]></category> <category><![CDATA[Single page]]></category> <category><![CDATA[Sleek]]></category> <category><![CDATA[Static]]></category> <category><![CDATA[Web 2.0]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=899</guid> <description><![CDATA[Ahhh &#8211; so many choices when it comes to what open source software to use: Joomla, WordPress, Drupal&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have [...]]]></description> <content:encoded><![CDATA[<p>Ahhh &#8211; so many choices when it comes to what open source software to use: <a href="http://www.joomla.org/">Joomla</a>, <a href="http://wordpress.org">WordPress</a>, <a href="http://drupal.org/">Drupal</a>&#8230;but aren’t they at times &#8211; a little overkill? For smaller web designers like myself, I still get the usual client who just wants a simple website to advertise their services. Most of the time they will have something existing &#8211; with cluttered content that isn’t even enough to fill a full page. This is where a single page portfolio comes handy. In this tutorial, we’re going to build a single page portfolio from scratch: a page with a feature section, testimonials, image gallery and a contact form.</p><div class="viewdemo"> <a href="http://demo.fearlessflyer.com/html/demo/one/">View the Demo:</a></div><div class="special"> This tutorial is the first of three parts: 1) the Photoshop Mock up, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/part1.jpg" alt="part1" title="This is the first part of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1119"  style="border:0;"/></p><h3>The Output</h3><p>Below is a preview of what we’re building. The aim is to have a mock up that is fully layered, so we can optimize for the purpose of SEO and page performance. Ready to get started &#8211; Let’s begin:</p><p><a href="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1-large.jpg"><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-1.jpg" alt="single-page-1" title="This is How the Page looks so far - Click to enlarge" width="576" height="923" class="alignnone size-full wp-image-902" /></a></p><h3>Part 1 &#8211; The Fold</h3><p>We’re going to design the page from the top to bottom. The fold is first part of a web page can see &#8211; without having to scroll downwards. In our case, this includes the header and the big red feature bar:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-0.jpg" alt="single-page-0" title="The fold is the first thing you see in a web page" width="576" height="248" class="alignnone size-full wp-image-901" /></p><p>If you aren’t familiar with 960.gs &#8211; it’s a CSS framework that follows the standard 960 pixels page width rule. Download the photoshop template and check out the guides &#8211; we are building the page following the 960 grid rules:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-2.jpg" alt="single-page-2" title="The 960 Photoshop Template showing the pink layers and guides to help you align elements" width="576" height="581" class="alignnone size-full wp-image-904" /></p><p>Create a new layer &#8211; this will be the fold layer. Select the full page width, with approximately 380 pixels in height. Fill it with a solid color &#8211; in my case I chose a bright red #730701:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-3.jpg" alt="single-page-3" title="The Fold Fill Layer" width="576" height="581" class="alignnone size-full wp-image-905" /></p><p>Create another layer for the header bar, select the full page width and 48 pixels in height. Fill this with another solid color &#8211; in my case, #bcbcbc for light grey.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-4.jpg" alt="single-page-4" title="The Header Fill Layer" width="576" height="581" class="alignnone size-full wp-image-906" /></p><p>Where the header bar and the fold meet, we want to add an “etched” effect. We achieve this by using 2 lines using the “line” tool. Create 2 horizontal lines at 1 pixel each (make sure you hold the “Shift” key) as you drag it across the page. Nudge one line so that they sit just on top of one another. The rule is to use a lighter shade for one line, and a darker for the other (it is important that you play with the colors, and zoom out and test if the etched look is achieved). Add a subtle gradient fill for the header bar as well.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-5.jpg" alt="single-page-5" title="Two Horizontal Lines create an Etched Effect" width="576" height="313" class="alignnone size-full wp-image-907" /></p><p>The next step is to add a large feature image. This sits on top of all the layers to give it that 3D effect. Place in at almost half the 960 pixel page width, overlapping some part of the header and pass below the fold. Include the effects as shown:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-6.jpg" alt="single-page-6" title="Large Overlapping Feature Images are So In!" width="576" height="308" class="alignnone size-full wp-image-908" /></p><p>Immediately to the left of the feature image, add your large slogan text. This is to be your attention grabbing statement, and is important to be the most prominent. I chose Rockwell at size 36 pixels, with -50 tracking. Also add the following text effects:</p><ul><li>Drop shadow &#8211; Normal blend mode &#8211; #000, 90 degrees angle, 1px distance, 0 spread and 1px in size</li><li>Inner Shadow  &#8211; Normal blend mode &#8211; #FFF, 90 degrees angle, 1px distance, 0 choke and 0px size</li><li>Gradient Overlay &#8211; use default settings, reduce opacity to 34% and 90 degrees in angle</li></ul><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-7.jpg" alt="single-page-7" title="Large Slogan Text with my Favorite font - Rockwell" width="576" height="581" class="alignnone size-full wp-image-909" /></p><p>Add a gradient effect to the background layer named the fold. The rule is to use a slightly lighter color than the existing background as one color, and the same background color as the secondary color. Fill by pressing the shift key and releasing simultaneously.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-8.jpg" alt="single-page-8" title="Add some gradient effects Baby!" width="576" height="418" class="alignnone size-full wp-image-910" /></p><p>Add another 2 horizontal lines right underneath the slogan text. *Use the rule as described in the previous line tools used in the header and the fold separation. Add a smaller set of text &#8211; I used Arial with 14 pixels in size, #FFFFFF color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-9.jpg" alt="single-page-9" title="Here goes that Etched Borders again" width="576" height="452" class="alignnone size-full wp-image-911" /></p><p>To complete the fold &#8211; we add a glow effect to the bottom area where the borders separate the large text and the small text. Select a small area (shown below), grab the brush tool, select white for the color, increase the brush radius (shown below) &#8211; reduce the opacity all the way to 12 percent and daub a quick light stroke.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-10.jpg" alt="single-page-10" title="Give it a little glow" width="576" height="425" class="alignnone size-full wp-image-912" /></p><h3>Part 2 &#8211; Below the Fold</h3><p>Below the fold technically includes everything under the fold. But for the sake of this tutorial &#8211; it includes all BUT the footer section. The reason is &#8211; this will be the only part that will need to grow. If there was additional content to be made &#8211; it will be inside this section. The fold and the footer remain static in height.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-11.jpg" alt="single-page-11" title="Below the fold is the area you see when you scroll downwards" width="576" height="476" class="alignnone size-full wp-image-913" /></p><p>We start by creating a new layer. With the selection tool, select everything below the red feature section below. Fill this selection with #f3f2ed using the paint bucket tool. *Note that the large image layer should be placed on top of all the other layers.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-12.jpg" alt="single-page-12" title="Layer should be beneath the large image layer!" width="576" height="581" class="alignnone size-full wp-image-914" /></p><p>We then create a new horizontal guide. This guide should be right below our feature image (allow a few pixels extra for the added shadow effect). This guide’s main purpose is to know where we will slice our divs (which I will cover once we start coding) and where our gradient ends. Grab the selection tool once more and start from where the red area ends &#8211; down to the new guide. Using the gradient tool, select #e1decf primary color and #f3f2ed and fill with a straight line (hold shift).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-13.jpg" alt="single-page-13" title="So subtle gradients are soo nice!" width="576" height="314" class="alignnone size-full wp-image-915" /></p><p>We then add that same “etched” look where the two layers meet. The same technique is used &#8211; create two lines with one darker and one lighter. In this case the upper line has #670600 fill and the second #faf9f3.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-14.jpg" alt="single-page-14" title="Again - etched borders!" width="576" height="203" class="alignnone size-full wp-image-916" /></p><p>Next step is to create the sub heading. With the type tool, choose the Rockwell font at 24 pixels in #292929 color and type the word “TESTIMONIALS”. Directly to the left of the text &#8211; I imported the “users_two_48” icon from <a href="http://wefunction.com/2008/07/function-free-icon-set/">WeFunction</a> and scaled the image down to 60 percent and desaturize (Ctrl + U, slide the saturation all the way to the left).  Add two horizontal 1 pixel lines (#e5e5e2 and #FFFFFF) directly underneath (by this point of the tutorial, I’m going to assume you have this technique down already).</p><p>*Tip &#8211; Create a group called “sub headings” and add all the above elements in it. We will be duplicating this sub heading in following sections.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-15.jpg" alt="single-page-15" title="WeFunction icons - desaturated please" width="576" height="430" class="alignnone size-full wp-image-917" /></p><p>Directly below the Testimonial subheading &#8211; we create 3 text boxes with some dummy text. I used Verdana at 14 pt, 20 pt leading. Make sure you allow enough padding and margin around each surrounding box. Align according to the grid. Note that this part of the design acts only as a marker. We will use actual text for these boxes.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-16.jpg" alt="single-page-16" title="Three boxes make up the testimonials section" width="575" height="479" class="alignnone size-full wp-image-918" /></p><p>Duplicate the two horizontal lines from the sub headings section. Move these 2 lines right below the 3 text boxes that you have created. Create a new layer, select 124 pixels (width) x 25 pixels (height) and fill with #FFFFFF with the paint bucket tool. Move this layer right below the two horizontal lines. Using the text tool, use 10 pt Verdana, color # 6b6b6b and type the words “more testimonials” &#8211; move this directly on top of the new layer we’ve just created. This acts as end marker for the testimonials section with a button that displays more testimonials.</p><p>*Tip &#8211; create a new group for the above elements and name it “end marker”.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-17.jpg" alt="single-page-17" title="More buttons for added user interaction" width="576" height="288" class="alignnone size-full wp-image-919" /></p><p>Next, we add a “Previous Work” section. Remember that we created a group called “sub headings” a little while back? Duplicate this group and name it “sub headings 2”. Using the down cursor in your keyboard, move the new group approximately 560 pixels downwards. Change the text to say “PREVIOUS WORK” and use another icon, scale it down and desaturate.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-18.jpg" alt="single-page-18" title="Another Heading with a desaturated icon" width="576" height="281" class="alignnone size-full wp-image-920" /></p><p>An image gallery will showcase our portfolio’s “Previous Work” section. Similar to the testimonials area, we are dropping some dummy thumbnails in our photoshop file, just for mock purposes. We are going to span 4 thumbnails across at 210 pixels each in width. Make sure the thumbnails align to the grid, taking 3 columns each with enough paddings in between each other. Add the following effects for each thumbnail: Drop Shadow (settings shown in below screenshot) and an inside stroke of 6 pixels and #FFFFFF fill color.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-19.jpg" alt="single-page-19" title="Photo gallery of your previous work" width="576" height="720" class="alignnone size-full wp-image-921" style="border:0;"/></p><p>To complete the “Below the Fold” section &#8211; we create an end marker for the “Previous Work” area. Duplicate the group “end marker” and name it “end marker 2”. Move this newly created group approximately 380 pixels downwards. Change the text in the button to say “more previous work”. Our next quest is the <strong>Footer</strong>. Keep going!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-20.jpg" alt="single-page-20" title="Again, a more button is added below" width="576" height="319" class="alignnone size-full wp-image-922" /></p><h3>Part 3 &#8211; The Footer</h3><p>And now we come to the final piece of the design process &#8211; the Footer. I enjoy designing footers because they represent completion; they’re also the most overlooked section of a page that I feel that it deserves the same attention as the other parts.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-21.jpg" alt="single-page-21" title="After user sees your work - they would want to get in touch with you!" width="576" height="206" class="alignnone size-full wp-image-923" /></p><p>The height of the footer is approximately 375 pixels. If you haven’t already done so &#8211; extend your canvas size to an additional 375 pixels &#8211; but be sure to click the anchor all the way to the top.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-22.jpg" alt="single-page-22" title="Canvas settings for your Footer" width="576" height="391" class="alignnone size-full wp-image-924" style="border:0;"/></p><p>Create 3 new horizontal guides: first is where the “Below the Fold” background ends, then approximately 35 pixels below, and third &#8211; another 30 pixels down (this is where the footer background layer starts). Make a selection from the first guide to the next one down, make sure you’re on the “Below the fold” background layer, and do a gradient fill: primary color #e3e0d2, secondary #f3f2ed. Next, create a new layer for the footer background and add a gradient fill: primary color is #361f01 and secondary #493215. Do 80 percent for the primary fill. Finally, create 3 horizontal lines with the line tool at 1 pixel each with the following fills (in the following order): #ffffff, #000000 and #624825. Line them according the last guide you’ve created (see below).</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-23.jpg" alt="single-page-23" title="Gradients and Horizontal Lines are good" width="576" height="581" class="alignnone size-full wp-image-925" /></p><p>Duplicate the text layer for the slogan (The Fold), change the content to say “Hire me for professional work”, drag downwards to the footer, and place on the left half of the footer area. Add another text area, use Verdana, 12px #ffffff, enter some dummy text, and place directly below the large text.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-24.jpg" alt="single-page-24" title="Slap the same text effect onto the footer slogan to match the header" width="576" height="225" class="alignnone size-full wp-image-926" /></p><p>On the right half of the footer, we’re placing a rounded rectangle for the background of the contact form. Using the Rounded Rectangle tool &#8211; create a rectangle, center between 6 columns in the grid. Add a drop shadow and stroke effect as shown below:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-25.jpg" alt="single-page-25" title="A rounded container for the form" width="576" height="880" class="alignnone size-full wp-image-927" style="border:0;" /></p><p>Create a new layer and make 3 rectangles inside the rounded rectangle we’ve just created. These will act as the form fields. Note that these are just as markers which will not really be used in the output. We’re using real form fields in the code. Fill these rectangles with #ffffff using the paint bucket tool.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-26.jpg" alt="single-page-26" title="Form fields are useful" width="576" height="352" class="alignnone size-full wp-image-928" /></p><p>What’s a contact form without a pretty submit button? Using the rounded rectangle tool &#8211; create a button and add an inner shadow (66 percent opacity) and a 1px inner stroke &#8211; #85827e. Add the text “Submit” on top of this button using “Rockwell” at 14px.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-27.jpg" alt="single-page-27" title="We need a submit button" width="576" height="161" class="alignnone size-full wp-image-929" /></p><p>Finally, remember I said the footer should have the same detail as the other parts of the page? We’re going to add a nice glow in the background which will highlight our large text and the contact form. Select the footer background with the selection tool. Next, pick a soft round brush at 500 pixels, select color #ffffff and decrease the opacity of the brush to 10 percent. Center the brush horizontally and halfway above the footer &#8211; click once and Voila &#8211; instant glow in the background!</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/11/single-page-28.jpg" alt="single-page-28" title="Finish up with a nice glow" width="576" height="529" class="alignnone size-full wp-image-930" /></p><p>And there you have it. We’ve just created a full page mockup in Photoshop. Next will be coding the HMTL and CSS &#8211; so stay tuned!</p><div class="special"> This tutorial is the first of three parts: 1) the Photoshop Mock up, 2) <strong><a href="http://fearlessflyer.com/2009/12/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="http://fearlessflyer.com/2010/04/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong></div><p><strong>You can download the .psd from this <a href="http://fearlessflyer.com/downloads/one-page-portfolio-psd.zip">link</a></strong></p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Get Kubrick On Crack!</title><link>http://fearlessflyer.com/2009/08/get-kubrick-on-crack/</link> <comments>http://fearlessflyer.com/2009/08/get-kubrick-on-crack/#comments</comments> <pubDate>Mon, 31 Aug 2009 02:55:55 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[Freebies]]></category> <category><![CDATA[General]]></category> <category><![CDATA[WP Themes]]></category> <category><![CDATA[Wordpress Themes]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[free]]></category> <category><![CDATA[Kubrick]]></category> <category><![CDATA[Kubrick On Crack]]></category> <category><![CDATA[Single Column Blog]]></category> <category><![CDATA[Themes]]></category> <category><![CDATA[Web 2.0]]></category> <category><![CDATA[Wordpress Premium theme]]></category><guid isPermaLink="false">http://fearlessflyer.com/?p=713</guid> <description><![CDATA[Is my title catchy enough? My latest addition to my collection of free stuff &#8211; a WordPress theme that is built for the traditional blogger. It is a single column theme with splashes of bright colors that I hope will fancy your senses. I call it Kubrick on Crack! with the intent of designing around [...]]]></description> <content:encoded><![CDATA[<p>Is my title catchy enough? My latest addition to my collection of free stuff &#8211; a WordPress theme that is built for the traditional blogger. It is a single column theme with splashes of bright colors that I hope will fancy your senses. I call it <strong>Kubrick on Crack!</strong> with the intent of designing around the default Kubrick theme; but with enough tweaks that it would seem that it is on Crack! Well, this is the end result.</p><div class="viewdemo"><a href="http://koc.fearlessflyer.com">View the Demo</a></div><p>It looks like the only thing it has in common with Kubrick is the rounded corners and the slim page width of 728 pixels. Anywho, you can take Kubrick on Crack! and install it in your WordPress site for free.</p><h3>Home Page with a Feature Post</h3><p>Unlike the original Kubrick &#8211; this theme automatically takes your latest post and converts it to a Feature post. It sits atop of a dark fading background with a custom image field that looks like its on top of a stash of photographs. It uses the custom field key: &#8220;<strong>image</strong>&#8220;. To learn how to use custom fields (which I strongly recommend) &#8211; <a href="http://codex.wordpress.org/Using_Custom_Fields">read it from the codex</a>. No image resizing is required &#8211; they&#8217;re all automatically cropped, thanks to the <a href="http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/">TimThumb script by Darren Hoyt</a>. But for best results &#8211; upload an image that is wider than 424 pixels and longer than 284 pixels in height.</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/08/koc2.jpg" alt="koc2" title="Full Preview of Kubrick on Crack" width="576" height="800" class="alignnone size-full wp-image-726" /></p><p>The search form magically appears in a fade in box. This script is &#8220;<a href="http://jquery.com/demo/thickbox/">Thickbox</a>&#8221; and provided by jQuery. The spectacular smoke art background is by <a href="http://applesactually.deviantart.com/">Applse Actually</a> of Deviantart.com.</p><h3>Theme Options</h3><p>Kubrick on Crack! comes with a control panel so you don&#8217;t have to touch the code in order to customize for your website. The options include the following:</p><p><img src="http://fearlessflyer.com/main/wp-content/uploads/2009/08/koc3.jpg" alt="koc3" title="Experimented with Theme Options - a bonus feature" width="576" height="800" class="alignnone size-full wp-image-714" /></p><p>1 &#8211; <strong> Header Logo</strong>, once your logo is uploaded, enter the url here. I recommend using a transparent .png to preserve the look.</p><p>2 &#8211; <strong>Twitter account</strong>, this will save to the link that is behind the twitter icon in the header.</p><p>3 &#8211; <strong>Custom Feed</strong>, this will save to the RSS icon in the header. If no value is provided &#8211; the default blog rss will be used.</p><p>4 &#8211; <strong>Google Ad Sense</strong>, this will create an ad space right below the single post page. (use the the 728 leatherboard style). To learn more about Adsense, click <a href="https://www.google.com/adsense/login/en_US/">here</a></p><p>5 &#8211; <strong>Google Analytics</strong>, this saves your Analytics code below the footer &#8211; which of course is invisible. To learn more about Analytics &#8211; click <a href="http://www.google.com/analytics/">here</a></p><p>You can see Kubrick On Crack! in action at my <a href="http://koc.fearlessflyer.com/">Demo</a> site. <strong>Download the theme from this <a href="http://fearlessflyer.com/downloads/kubrick-on-crack.zip">link</a>.</strong></p><p><strong>Update: the original PSD files can be now be dowloaded from this <a href="http://fearlessflyer.com/downloads/kubrick-on-crack-psd.zip">link</a></strong>. *There are 3 photoshop files in the zip &#8211; one for the main layout which contains all of the elements except two buttons &#8211; which are in the other psd files.</p><p>All I ask is for you to leave me a comment, <a href="http://twitter.com/home?status=Awesome WordPress Theme: Get Kubrick On Crack! http://bit.ly/3iO11R">Retweet</a> or <a href="http://digg.com/design/Get_Kubrick_On_Crack">Digg</a> this article, or follow me in <a href="http://twitter.com/mks6804">Twitter</a>.</p> ]]></content:encoded> <wfw:commentRss>http://fearlessflyer.com/2009/08/get-kubrick-on-crack/feed/</wfw:commentRss> <slash:comments>92</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: fearlessflyer.com @ 2010-09-07 01:57:43 -->