<?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>Webstuffshare - Learn and share. The simplest harmony. &#187; 3D</title>
	<atom:link href="http://www.webstuffshare.com/tag/3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstuffshare.com</link>
	<description>Learn and share. The simplest harmony.</description>
	<lastBuildDate>Wed, 25 Jul 2012 15:00:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Portfolio Flipping Slider Using jQuery &amp; CSS3</title>
		<link>http://www.webstuffshare.com/2012/07/portfolio-flipping-slider-using-jquery-css3/</link>
		<comments>http://www.webstuffshare.com/2012/07/portfolio-flipping-slider-using-jquery-css3/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 15:53:13 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2637</guid>
		<description><![CDATA[There are many ways on displaying our portfolio, one of them is using grid style with slider effect for pagination. In this tutorial I&#8217;m going to share about how to [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2637.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>There are many ways on displaying our portfolio, one of them is using grid style with slider effect for pagination. In this tutorial I&#8217;m going to share about how to displaying our portfolio grid with flipping slider effect for pagination using jQuery &#038; CSS3 Transform.</p>
<p><span id="more-2637"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/FlippingSlider/index.html">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/FlippingSlider.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>Slider Behaviour</h3>
<p>The slider will change our portfolio images when it&#8217;s flipping, this flipping effect is triggered by user click on the pagination. So when user click a page each of our portfolio images will flipping 360 degree and when its animation near end the image will changed with new image.</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/07/Grid-Pagination1.jpg" alt="" title="Grid &amp; Pagination" width="409" height="279" class="aligncenter size-full wp-image-2651" /></p>
<p><br/><br />
We will create four flipping effects that will be used for animation, there are : horizontal left direction, horizontal right direction, vertical top direction and vertical bottom direction. These effects will be randomly choosen when displaying the image.</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/07/Animation-Direction1.jpg" alt="" title="Animation Direction" width="509" height="347" class="aligncenter size-full wp-image-2650" /></p>
<p><br/></p>
<h3>Markup &#038; Styling</h3>
<p>We will create a listing of images using unordered list and create a single <code>div</code> for wrapper, this wrapper will be used to display our portfolio image in grid style and will be generated using JavaScript so it will left blank. In this tutorial I&#8217;m using awesome image from dribbble posted by <a href="http://dribbble.com/troycummings">Troy Cummings</a>, <a href="http://dribbble.com/jrschmidt">J.R. Schmidt</a> and <a href="http://dribbble.com/dan-lehman">Dan Lehman</a>.</p>
<pre name="code" class="html">
<div id="portfolio"></div>
    
<ul id="portfolio-item">
  <li><img src="images/dumptruck_teaser.jpeg" alt="Dump Truck" /></li>
  <li><img src="images/rrwooo_rrwooo_teaser.jpeg" alt="Rrwooo" /></li>
  <li><img src="images/dozer_teaser.jpeg" alt="Dozer" /></li>
  <!-- to n image -->
</ul>
</pre>
<p>The wrapper markup will contains single div for image wrapper and also a single span for image title, following markup are example of the result after generated using JavaScript : </p>
<pre name="code" class="html">
<div id="portfolio">
  <div style="background:url(images/dumptruck_teaser.jpeg)"> <span>Dump Truck</span></div>
  <div style="background:url(images/rrwooo_rrwooo_teaser.jpeg)"> <span>Rrwooo</span></div>
  <!-- to n div -->
</div>
</pre>
<p>The portfolio image will be displayed with grid, we&#8217;ll also styling the span with transparent black background and div with <code>box-shadow</code> and <code>transform-style</code>. Since the portfolio listing doesn&#8217;t needed to display we&#8217;ll also set its <code>display</code> to <code>none</code>.</p>
<pre name="code" class="css">
  #portfolio-item {
    display: none;
  }
  
  #portfolio {
    margin: 2em 0 1em;
    transform-style: preserve-3d;
  }

  #portfolio div {
    display: inline-block;
    position: relative;
    vertical-align: top;
    margin: 1em;
    width: 200px;
    height: 150px;
    box-shadow: 0px 0px 25px rgba(0,0,0,.3);
  }
  
    #portfolio div span {
      text-align: left;
      position: absolute;
      color: #fff;
      background: rgba(0,0,0,0.6);
      width: 90px;
      padding: 5px 15px 7px;
      z-index: 1;
      left: -10px;
      bottom: 10px;
    }
</pre>
<p>The image we&#8217;ll set as background image for the div, so when flipping the image it&#8217;s not flipping the <code>img</code> but the <code>div</code> and change it&#8217;s <code>background-image</code> value with new one. <br/></p>
<p>We also will create a class that have CSS animation, this class will be injected to when flipping the <code>div</code>. The last class we will also create are the four effect classes.</p>
<pre name="code" class="css">
  .animated {
    transition: .9s ease-out;
  }
  
  .flipped-horizontal-right {
    transform: rotateY(360deg);
  }
  
  .flipped-horizontal-left {
    transform: rotateY(-360deg);
  }
  
  .flipped-vertical-top {
    transform: rotateX(360deg);
  }
  
  .flipped-vertical-bottom {
    transform: rotateX(-360deg);
  }
</pre>
<p>Here&#8217;s the expected result :</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/07/css-transform-result1.jpg" alt="" title="css transform result" width="509" height="238" class="aligncenter size-full wp-image-2649" /></p>
<h3>JavaScript</h3>
<p>First to go is iniatilizing some variables we need on flipping and change the image also populating image to display. On populating the image, we will walk through the portfolio listing and make them as background image for the <code>div</code>, when it&#8217;s done they will be appended to portfolio <code>div</code>.</p>
<pre name="code" class="javascript">
itemShow         = 8;
indexedItemShow  = itemShow - 1
itemList         = $('#portfolio-item');
itemWrapper      = $('#portfolio');
rotation         = ['flipped-vertical-bottom', 'flipped-vertical-top', 'flipped-horizontal-left', 'flipped-horizontal-right'];
navigation       = $('#navigation a');

for( var i = 0; i < itemShow; i++ ) {
  
  itemImage    = itemList.children('li:eq(' + i + ')').children('img');
  itemSrc      = itemImage.attr('src');
  itemAlt      = itemImage.attr('alt');
  item       = '<div style="background:url(' + itemSrc + ')"> <span>' + itemAlt + '</span></div>';
  itemWrapper.append(item);
}
</pre>
<p>When our navigation clicked it will rotate each <code>div</code> on our portfolio wrapper using effect we&#8217;ve initialize before and choosen randomly using <code>Math.random()</code>, to rotate them we&#8217;ll inject <code>animated</code> class name and selected effect.</p>
<pre name="code" class="javascript">
navigation.on('click', function(e) {
    
  e.preventDefault();

  navigation.removeClass('selected');
  $(this).addClass('selected');
    
  page = $(this).attr('data-page');

  for( var i = 0; i <= indexedItemShow; i++ ) {

    random     = Math.floor( Math.random() * ( 3 - 0 + 1 ) );
    animation  = rotation[random];
      
    item       = itemWrapper.children('div:eq(' + i + ')');

    item.addClass('animated ' + animation);
  
    /* to next code */
  }
});
</pre>
<p>When it's running it will also walk through to select the portfolio listing based on its index related to current selected page. On each selected portfolio listing it will grab it's image title (<code>alt</code> value) along with its <code>src</code> value, each of them will be change current each <code>div</code> value on our portfolio wrapper.</p>
<pre name="code" class="javascript">
window.setTimeout(function (index) {
  return function () {

    indexReal    = (page == 1) ? index : (index + (page - 1)) ;
    itemHost     = indexReal + (indexedItemShow * (page - 1));

    itemImage    = itemList.children('li:eq(' + itemHost + ')').children('img');
    itemSrc      = itemImage.attr('src');
    itemAlt      = itemImage.attr('alt');
    itemCurrent  = itemWrapper.children('div:eq(' + index + ')');

    itemCurrent.css('background', 'url(' + itemSrc + ')');
    itemCurrent.children('span').text(itemAlt);
    };
} (i), 500);
</pre>
<p>When the animation done we'll remove the <code>animated</code> and effect class name on each <code>div</code>.</p>
<pre name="code" class="javascript">
item.on('transitionend webkitTransitionEnd MSTransitionEnd oTransitionEnd', function() { 
  $(this).removeClass();
});
</pre>
<h3>Done</h3>
<p>We're done, as I described before that the flipping will take an action when user clicked the pagination. Try to visit the demo link above to see them live. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/07/portfolio-flipping-slider-using-jquery-css3/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Showcase Product Feature in 3D Style</title>
		<link>http://www.webstuffshare.com/2012/06/showcase-product-feature-in-3d-style/</link>
		<comments>http://www.webstuffshare.com/2012/06/showcase-product-feature-in-3d-style/#comments</comments>
		<pubDate>Sun, 24 Jun 2012 07:35:20 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Image Slider]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2625</guid>
		<description><![CDATA[Focus on showcasing our product features can be a good choice for attracting user on landing pages. By showcasing in 3D style also a good choice, in this tutorial I [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2625.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>Focus on showcasing our product features can be a good choice for attracting user on landing pages. By showcasing in 3D style also a good choice, in this tutorial I am going to share how to showcase our product feature in 3D style using CSS3 3D Transform and jQuery.</p>
<p><span id="more-2625"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/FeatureShowcase/index.html">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/FeatureShowcase.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>Showcase Behaviour</h3>
<p>The showcase will be displaying product image and tagline. The tagline will be positioned in the middle of product image, so there will be product image in two positions, left and right of the tagline. These images will be rotated in 3D around y-axis with angle of rotation -35 degree for the left image and 35 degree value for the right, the image will be rotated like following image :</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/06/3dtransform.jpg" alt="" title="3dtransform" width="409" height="279" class="aligncenter size-full wp-image-2626" /></p>
<p><br/><br />
Each product image will have two images and those images will be stacked each other also each of them will have infinite bouncing effect. The last effect will be rotation to the left and right on all of product image and tagline, this aim to show our rotated image its normal state before rotated.</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/06/3transform-stack.jpg" alt="" title="3transform stack" width="509" height="229" class="aligncenter size-full wp-image-2627" /></p>
<p><br/></p>
<h3>The Markup &#038; Styling</h3>
<p>The product image and tagline wrapped by a single div named <code>wrapper-item</code> while the product image itself wrapped by a div named <code>left</code> and <code>right</code>. All of them will wrapped also by a single div named <code>container</code>, this div will control our 3D perspective. In this tutorial I&#8217;m using some of <a href="http://themify.me/themes">themify themes</a> for the product image.</p>
<pre name="code" class="html">
<div id="container">
  <div class="wrapper-item">
    <div class="left">
      <img src="images/item/blogfolio.jpg" alt="Blogfolio" />
      <img src="images/item/folo.jpg" alt="Folo" />
    </div>
    <span class="text">Lot of awesome themes! <br/> Download the lovely one! </span>
    <div class="right">
      <img src="images/item/grido.jpg" alt="Grido" />
      <img src="images/item/itheme2.jpg" alt="Itheme2" />
    </div>
  </div>
  <!-- to n wrapper-item -->
</div>
</pre>
<p>The <code>container</code> div will have <code>2000px</code> perspective and our <code>wrapper-item</code> will have <code>preserve-3d</code>. For product image on the left we transform them into -35 degree angle and 35 degree for product image on the right. </p>
<pre name="code" class="css">
#container {
  margin: 0 auto;
  overflow: hidden;
  width: 1100px;
  max-width: 1100px;
  perspective: 2000px;
}

  .wrapper-item {
    position: relative;
    margin: 0 auto;
    width: 1000px;
    height: 400px;
    margin-bottom: 3em;
    transform-style: preserve-3d;
  }
  
  .left img, 
  .right img {
    position: absolute;
    border-radius: 4px;
    box-shadow: 0px 10px 25px rgba(0,0,0,.3);
  }
  
  .left img {
    transform: rotate3d(0,1,0,-35deg);
  }
  
  .right img {
    transform: rotate3d(0,1,0,35deg);
  }
</pre>
<p>Here is the result :</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/06/3dtransform-final.jpg" alt="" title="3dtransform final" width="509" height="335" class="aligncenter size-full wp-image-2628" /></p>
<p><br/></p>
<h3>Animation</h3>
<p>Each product image will have bouncing animation with infinite loop. To make it more attractive we add delay for each second image both on the left and right. We&#8217;ll create a keyframe named <code>bouncing-left</code> and <code>bouncing-right</code> and add them on the product image and also positioning them.</p>
<pre name="code" class="css">
.left img:nth-child(1) { 
  left: 4em; 
  top: 8em; 
  animation: bouncing-left 2s ease-in-out infinite alternate both;
}
  
.left img:nth-child(2) { 
  left: -2em; 
  top: 12em; 
  animation: bouncing-left 2s ease-in-out infinite alternate both;
  animation-delay: .5s;
}
  
.right img:nth-child(1) { 
  right: 4em; 
  top: 8em; 
  animation: bouncing-right 2s ease-in-out infinite alternate both;
}
  
.right img:nth-child(2) { 
  right: -2em; 
  top: 12em; 
  animation: bouncing-right 2s ease-in-out infinite alternate both;
  animation-delay: .5s;
}

@keyframes bouncing-left {
  0% { transform: translateY(-10px) rotate3d(0,1,0,-35deg); }
  100% { transform: translateY(10px) rotate3d(0,1,0,-35deg); }
}   

@keyframes bouncing-right {
  0% { transform: translateY(-10px) rotate3d(0,1,0,35deg); }
  100% { transform: translateY(10px) rotate3d(0,1,0,35deg); }
}  
</pre>
<p>We also add rotation animation on the <code>wrapper-item</code>, the rotation will rotate start from 0 degree to 35 degree then rotate to -35 degree and back to 0 degree. This animation will only move 3 times and delayed for 3 seconds on start. </p>
<pre name="code" class="css">
.wrapper-item {
  position: relative;
  margin: 0 auto;
  width: 1000px;
  height: 400px;
  margin-bottom: 3em;
  transform-style: preserve-3d;  
  transition: .5s ease-in-out;
  animation: rotating 10s ease-in-out 3 alternate both;
  animation-delay: 3s;
}

@keyframes rotating {
  0% { transform: rotate3d(0,1,0,0deg); }
  30% { transform: rotate3d(0,1,0,35deg); } 
  60% { transform: rotate3d(0,1,0,-35deg); } 
  100% { transform: rotate3d(0,1,0,0deg); }
}
</pre>
<p>Our product showcase will be like following image :</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/06/3dtransform-all-rotate.jpg" alt="" title="3dtransform all rotate" width="509" height="424" class="aligncenter size-full wp-image-2629" /></p>
<p><br/></p>
<h3>Navigation</h3>
<p>Since we have more than one product feature we need to create a navigation for displaying each product feature. The first product feature will be displayed on page load and other will be hidden, when navigation clicked the hidden one will be displayed with fade in effect. This will be done with JavaScript with jQuery help.</p>
<pre name="code" class="javascript">
$(document).ready(function() {
  
  //Show only first wrapper
  $( '.wrapper-item:not(:first-child)' ).hide();
  
  //Navigation on click
  $( '.nav' ).on( 'click' , function() {
    
    this_index = parseInt($(this).index()) + 1;
    
    $( '.nav' ).removeClass( 'selected' ).end().find( this ).addClass( 'selected' );

    $( '.wrapper-item' ).hide();
    $( '.wrapper-item:nth-child(' + this_index + ')' ).fadeIn( 'fast' );
    
  } );
});
</pre>
<p>The script above tell that if one of nav item clicked it will display the hidden product feature according to its index and hide others.</p>
<h3>Finish</h3>
<p>Our showcase for product feature is done, with CSS3 3D transform and animation we can enhance our showcase style like we done before. Please enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/06/showcase-product-feature-in-3d-style/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Creating Android Dock Using jQuery &amp; CSS3</title>
		<link>http://www.webstuffshare.com/2012/05/creating-android-dock-using-jquery-css3/</link>
		<comments>http://www.webstuffshare.com/2012/05/creating-android-dock-using-jquery-css3/#comments</comments>
		<pubDate>Sat, 05 May 2012 17:05:40 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2561</guid>
		<description><![CDATA[When playing the Galaxy Tab I love the fanciness of its Android&#8217;s dock. The application icon will pop out consecutively when arrow image on the dock clicked and not just [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2561.png&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>When playing the Galaxy Tab I love the fanciness of its Android&#8217;s dock. The application icon will pop out consecutively when arrow image on the dock clicked and not just the icon beautifully animated the dock itself also rotating vertically with 3D style. In this tutorial we&#8217;re going to create them using jQuery and CSS3.</p>
<p><span id="more-2561"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/AndroidDock/index.html">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/AndroidDock.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>Our Dock Behaviour</h3>
<p>As I described before, when user click the arrow image on the dock the icon will consecutively pop out from bottom, it&#8217;s hidden behind the dock itself. Along with animation of the icon pop out, the dock also rotating vertically from top to bottom direction with 3D style. So it will looks like the dock push the icon up.</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/05/animation-1.jpg" alt="" title="animation-1" width="509" height="441" class="aligncenter size-full wp-image-2562" /></p>
<p>When user click the arrow image once more it dock will looks like pull down the icon to the bottom, the icon will animated pop in and the dock will rotating from bottom to top direction.</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/05/animation-2.jpg" alt="" title="animation-2" width="509" height="397" class="aligncenter size-full wp-image-2563" /></p>
<p><br/></p>
<h3>The Technique</h3>
<p>All of the technique we will use have been used on previous tutorial. For 3D rotating like cube we will use the technique on <a href="http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/">&#8220;Creating &#8220;Next Level&#8221; Search Form Using jQuery &#038; CSS3&#8243;</a> post while the consecutive movement of the icon we will use the technique on <a href="http://www.webstuffshare.com/2012/03/creating-consecutive-slide-using-jquery/">&#8220;Creating Consecutive Slide Using jQuery&#8221;</a> post. If you missed both of them, please do me a favor by reading them before continue reading this post.</p>
<p><br/></p>
<h3>The Markup &#038; Styling</h3>
<p>The dock and the icon wrapped by a div called <strong>dock-wrapper</strong>, it will take on the 3D perspective and the dock position. The dock will consist two div called <strong>dock-front</strong> and <strong>dock-top</strong>, both of them will act like a cube. The last element is a single div called <strong>item</strong>, it will wrap all icon that will pop out later. In this post I am using icon from some application that available on <a href="http://play.google.com">Google Play</a>. </p>
<pre name="code" class="html">
<div id="dock-wrapper">
  <div class="dock">
    <div class="dock-front">
	   <img src="images/arrow-up.png" alt="Arrow Up" id="arrow-up" />
    </div>
    <div class="dock-top">
      <img src="images/arrow-down.png" alt="Arrow Down" id="arrow-down" />
    </div>
  </div>
  <div class="item">
	  <span><img src="images/launcher-pro.png" width="60" /></span>
	  <span><img src="images/2do.png" width="60" /></span>
	  <!-- to n icon  -->
  </div>
</div>
</pre>
<p>First to go is styling the dock, we will set the perspective on the <strong>dock-wrapper</strong> and set the position to the bottom of the page. Set <strong>dock-front</strong> and <strong>dock-top</strong> transformation and the background. We&#8217;ll also add a little animation when user hovering the arrow. Last, we prepare class called <strong>.dock-show</strong> that will be injected to <strong>.dock</strong> using JavaScript to force the animation on it.</p>
<pre name="code" class="css">
#dock-wrapper {
  bottom: 0;
  width: 100%;
  height: 60px;
  position: fixed;
  perspective: 3000px;
}
  
  .dock {
    height: 70px;
    transform-style: preserve-3d;
    transition: transform 1s;
  }
  
  .dock-show {
    transform: translateZ(-25px) rotateX(-95deg);
  }
  
  .dock-front, .dock-top {
     position: absolute;
     display: block;
     width: 100%;
     height: 40px;
     padding: 10px 0;
     box-shadow: 0px -3px 6px rgba(0,0,0,0.3);
  }
  
  .dock-front {
     background-image: linear-gradient(to bottom, #434345, #161616);
     transform: translateZ(30px);
  }
  
  .dock-top {
	  background-image: linear-gradient(to bottom, #505052, #161616);
     transform: rotateX(90deg) translateZ(29px);
  }
    
  #arrow-up, #arrow-down {
    cursor: pointer;
    transition: all .2s;
  }
    
    #arrow-up:hover {
    	margin-top: -.2em;
    }
    
    #arrow-down:hover {
    	margin-top: .2em;
    }
</pre>
<p>After styling dock done, now we&#8217;ll stying the icon. The icon will hidden behind the dock and each icon will have absolute position to make us ease moving them when pop out by playing its top position. </p>
<pre name="code" class="css">
.item {
  position: absolute;
  width: 526px;
  left: 50%;
  margin-left: -263px;
}	
   
  .item span {
    position: absolute;
    z-index: -1;
    cursor: pointer;
  }
    
  .item span:first-child  { left: 0; }
  .item span:nth-child(2) { left: 90px; }
  .item span:nth-child(3) { left: 180px; }
  .item span:nth-child(4) { left: 270px; }
  .item span:nth-child(5) { left: 360px; }
  .item span:nth-child(6) { left: 450px; }
</pre>
<p>Final result of our dock :</p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/05/animation-3.jpg" alt="" title="animation-3" width="509" height="196" class="aligncenter size-full wp-image-2564" /></p>
<p><br/></p>
<h3>The JavaScript</h3>
<p>When user click the arrow we will inject <strong>.dock-show</strong> class name to <strong>.dock</strong> to make the animation working. After injecting we will moving each icon position to top above the dock, making it visible to the user.</p>
<pre name="code" class="javascript">
item         = $('.item img');
itemReverse  = item.get().reverse();
  
$('#arrow-up').on('click', function() {
  
  $('.dock').addClass('dock-show');
  
  $.each(item, function() {
    
    var i  = $(this).index();
    var delay = i * 100;

    window.setTimeout(function (index) {
      return function () {
        item.eq(index).stop().animate({ 'top' : '-7.8em' });
      };
    } (i), delay);
  });
});
</pre>
<p>When user click the arrow once more after the icon appear, we will hide the icon along with rotating the dock.</p>
<pre name="code" class="javascript">
$('#arrow-down').on('click', function() {
  
  $('.dock').removeClass('dock-show');
  
  $.each(itemReverse, function() {
    
    var i  = $(this).index();
    var delay = i * 100;

    window.setTimeout(function (index) {
      return function () {
        $(itemReverse).eq(index).stop().animate({ 'top' : '0' });
      };
    } (i), delay);
  });
});
</pre>
<p>Last step add animation for the icon when user hover it, playing its top position.</p>
<pre name="code" class="javascript">
$('.item img').hover(function() {
  $(this).stop().animate({ 'top' : '-8.4em' }, 'fast');
}, function() {
  $(this).stop().animate({ 'top' : '-7.8em' }, 'fast');
});
</pre>
<h3>We&#8217;re Done</h3>
<p>The dock is finished but you can enhance the dock more by add tooltip when user hover the icon. That&#8217;s it hope you enjoy this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/05/creating-android-dock-using-jquery-css3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Showing Product Information With CSS3 3D Transform</title>
		<link>http://www.webstuffshare.com/2012/04/showing-product-information-with-css3-3d-transform/</link>
		<comments>http://www.webstuffshare.com/2012/04/showing-product-information-with-css3-3d-transform/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 08:58:36 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Gallery]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2551</guid>
		<description><![CDATA[There are many ways on showing product information, for example when hover the product image, the product information is sliding above or even using pop up. In this tutorial I&#8217;m [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2551.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>There are many ways on showing product information, for example when hover the product image, the product information is sliding above or even using pop up. In this tutorial I&#8217;m going to share how to show our product information with cube style using CSS3 3D Transform.</p>
<p><span id="more-2551"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/CubeInformation/index.html">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/CubeInformation.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>The Result</h3>
<p>Before talking about the technique following image is the result we want to achieve, the product image is visible while the product information is hidden. When user hovering the item both of them will rotate vertically to up direction making the product information visible and the image hidden, looks like a rotating cube. </p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/04/css3d.jpg" alt="" title="css3d" width="509" height="584" class="aligncenter size-full wp-image-2554" /></p>
<p><br/></p>
<h3>The Technique</h3>
<p>The technique we will use for creating the cube is from previous technique we&#8217;ve done before (see : <a href="http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/">Creating “Next Level” Search Form Using jQuery &#038; CSS3</a>) There are two elements, front side and bottom side, front is product image and product information is bottom side. The bottom side is hidden by rotating its X axis to -90 degree and playing the translateZ value to make its position below the front. </p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/04/layer.jpg" alt="" title="layer" width="509" height="290" class="aligncenter size-full wp-image-2553" /></p>
<p>There are two elements wrapping them, first named <strong>wrapper</strong> for setting the perspective this aims to define how far the element placed relatively from user view, the smaller value the element will placed closer. Second element named <strong>item</strong> also wrapped by <strong>wrapper</strong> is wrapping the image and information, this element when having an hover event will rotate its X axis to 95 degree to show the information and hide the image. </p>
<p><br/></p>
<h3>The Markup &#038; Styling</h3>
<p>I&#8217;m using all images from <a href="http://apps.shopify.com/">Shopify App Store</a> for product image. Each product will have two wrapper elements and a single information element as described before, here is the markup : </p>
<pre name="code" class="html">
<div class="wrapper">
  <div class="item">
    <img src="images/contact.png" />
    <span class="information">
      <strong>Contact Form</strong> The easiest way to add a contact form to your shop.
    </span>
  </div>
</div>

<!-- to n wrapper -->
</pre>
<p>Each <strong>wrapper</strong> will have inline-block display and perspective value to 4000px, <strong>item</strong> will have preserve-3d on transform-style value to make its children preserve its 3D position and also having transition property to make the change when hovering animated.</p>
<pre name="code" class="css">
.wrapper {
  display: inline-block;
  width: 310px;
  height: 100px;
  vertical-align: top;
  margin: 1em 1.5em 2em 0;
  cursor: pointer;
  position: relative;
  font-family: Tahoma, Arial;
  perspective: 4000px;
}

.item {
  height: 100px;
  transform-style: preserve-3d;
  transition: transform .6s;
}
</pre>
<p>Product image and product information will have transition, both of them will change its border-radius and box-shadow value when user hovering, this aim to make the transition more elegant.  </p>
<pre name="code" class="css">
.item img {
  display: block;
  position: absolute;
  top: 0;
  border-radius: 3px;
  box-shadow: 0px 3px 8px rgba(0,0,0,0.3);
  transform: translateZ(50px);
  transition: all .6s;
  
}

.item .information {
  display: block;
  position: absolute;
  top: 0;
  height: 80px;
  width: 290px;
  text-align: left;
  border-radius: 15px;
  padding: 10px;
  font-size: 12px;
  text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
  box-shadow: none;
  background: linear-gradient(to bottom,rgba(236,241,244,1) 0%,rgba(190,202,217,1) 100%);
  transform: rotateX(-90deg) translateZ(50px);
  transition: all .6s;
  
}
</pre>
<p>And the last is when user hover our product, it will rotate the <strong>item</strong> element and change image and information&#8217;s border-radius and box-shadow. </p>
<pre name="code" class="css">
.item:hover {
  transform: translateZ(-50px) rotateX(95deg);
}

  .item:hover img {
    box-shadow: none;
    border-radius: 15px;
  }
  
  .item:hover .information {
    box-shadow: 0px 3px 8px rgba(0,0,0,0.3);
    border-radius: 3px;
  }
</pre>
<p>The result : </p>
<p align="center"><img src="http://www.webstuffshare.com/wp-content/uploads/2012/04/shopify.jpg" alt="" title="shopify" width="509" height="144" class="aligncenter size-full wp-image-2552" /></p>
<h3>Finish</h3>
<p>We&#8217;re done, the cube transition should work on browser that support 3D transform. I also add script detection using modernizr to check browser capability. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/04/showing-product-information-with-css3-3d-transform/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>How to Create a Walking Navigation</title>
		<link>http://www.webstuffshare.com/2012/02/how-to-create-a-walking-navigation/</link>
		<comments>http://www.webstuffshare.com/2012/02/how-to-create-a-walking-navigation/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 07:29:46 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2394</guid>
		<description><![CDATA[On a single page website with fixed position navigation, it will be nice to tell user on what section they are reading at. In this tutorial I am going to [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2394.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>On a single page website with fixed position navigation, it will be nice to tell user on what section they are reading at. In this tutorial I am going to share how to create a walking navigation, on the other words, auto focus navigation based on user scrolling, by taking advantage of both jQuery and CSS animation. </p>
<p><span id="more-2394"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/WalkingNavigation/index3.html">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/WalkingNavigation.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>The Trick</h3>
<p>We can estimate which section the users are reading at by checking their current scroll position and get closest section from it. This mean we have to separate each section by element that we can identify as a different section. To make us ease on creating an auto focus on the navigation related to the section user reading at, we can put the same identity on section and navigation, respectively.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/1.jpg" alt="" title="1" width="509" height="992" class="aligncenter size-full wp-image-2395" /></p>
<h3>Building The Page</h3>
<p>The single page we want to create consists of navigation and section. Each of them has five items, home, about, blog, contact, credits. Home on navigation related to home on section, so on. Each item on navigation identified using href attribut which is the same value as section that identified by id attribute. </p>
<pre name="code" class="html">
<div id="header-wrapper">
	<div class="wrapper">
		<span class="title">Walking Navigation</span>
		<ul class="navigation">
			<li><a href="#home">Home</a></li>
			<li><a href="#about">About</a></li>
			<li><a href="#blog">Blog</a></li>
			<li><a href="#contact">Contact</a></li>
			<li><a href="#credits">Credits</a></li>
		</ul>
	</div>
</div>
<div id="content-wrapper">
	<div id="home" class="section">
		content
	</div>
	<div id="about" class="section">
		content
	</div>
	<div id="blog" class="section">
		content
	</div>
	<div id="contact">
		content
	</div>
	<div id="credits" class="section">
		content
	</div>
</div>
</pre>
<pre name="code" class="css">
#header-wrapper {
	display: block;
	position: fixed;
	width: 100%;
	height: 60px;
	color: #fff;
	background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#cbcbcb));
	background-image: -webkit-linear-gradient(top, #fefefe, #cbcbcb);
	background-image:    -moz-linear-gradient(top, #fefefe, #cbcbcb); 
   background-image:     -ms-linear-gradient(top, #fefefe, #cbcbcb); 
   background-image:      -o-linear-gradient(top, #fefefe, #cbcbcb); 
   background-image:         linear-gradient(to bottom, #fefefe, #cbcbcb);
	box-shadow: rgba(214,214,214,0.6) 0px 6px 0px;
	color: #444;
	text-shadow: rgba(255,255,255,0.5) 1px 1px 0px;
}

#content-wrapper {
	display: block;
	padding-top: 5em;
	color: #414141;
	line-height: 2em;
	text-shadow: #fff 1px 1px 0px;
	font-size: 15px;
}

	#home, #about, #blog, #tweet, #contact {
		display: block;
	}

.wrapper, #content-wrapper {
	margin: 0 auto;
	width: 960px;
	text-align: left;
}

	.navigation {
		font-size: 13px;
		text-transform: uppercase;
		display: inline-block;
		margin: 0;
		list-style-type: none;
		vertical-align: top;
	}
	
		.navigation li {
			display: inline-block;
			width: 70px;
			height: 16px;
			padding: 22px 0;
			text-align: center;
			cursor: pointer;
		}
			
		.navigation li:hover, .selected-nav {
			background-image: -webkit-gradient(linear, left top, left bottom, from(#7bbbf7), to(#338cdf));
			background-image: -webkit-linear-gradient(top, #7bbbf7, #338cdf);
			background-image:    -moz-linear-gradient(top, #7bbbf7, #338cdf); 
   		background-image:     -ms-linear-gradient(top, #7bbbf7, #338cdf); 
   		background-image:      -o-linear-gradient(top, #7bbbf7, #338cdf); 
   		background-image:         linear-gradient(to bottom, #7bbbf7, #338cdf);
			border-bottom: 6px solid #1f6db6;
		}
			
			.navigation li a {
				position: relative;
				z-index: 1px;
				color: #444;
				text-decoration: none;
			}
			
			.navigation li:hover a, .selected-nav a, .selected-nav2 a, .top a {
				color: #fff !important;
				text-shadow: #335f87 1px 1px 0px;
			}
	
</pre>
<p>Notice that the header-wrapper has position fixed, this aim to make the navigation always follow user scroll through the page. <br/></p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/3.jpg" alt="" title="3" width="509" height="501" class="aligncenter size-full wp-image-2397" /><br />
 <br/></p>
<h3>Simple Style</h3>
<p>.scroll() is a jQuery API to read user&#8217;s scroll on an element, in this context we will bind them to the window element. After reading the scroll we check its current position relative to the top of the page (scrollPosition) , checking through each navigation&#8217;s item and check the section which is closest to the scrollPosition. If the section found add customized style to make it look like selected. </p>
<pre name="code" class="javascript">
//Bootstraping variable
headerWrapper	= parseInt($('#header-wrapper').height());
offsetTolerance	= 40;
	
//Detecting user's scroll
$(window).scroll(function() {
	
	//Check scroll position
	scrollPosition	= parseInt($(this).scrollTop());
	
	//Move trough each menu and check its position with scroll position then add selected-nav class
	$('.navigation a').each(function() {

		thisHref		= $(this).attr('href');
		thisTruePosition	= parseInt($(thisHref).offset().top);
		thisPosition 	= thisTruePosition - headerWrapper - offsetTolerance;
		
		if(scrollPosition >= thisPosition) {
		
		$('.selected-nav').removeClass('selected-nav');
		$('.navigation a[href='+ thisHref +']').parent('li').addClass('selected-nav');
		
		}
	});
});

</pre>
<p>If the last section is too close to the bottom of the page we can&#8217;t read the section using previous technique, to make it works we have to check we&#8217;re at the bottom of the page by subtract document height with window height then compare with scrollPosition, if it equal or scrollPosition more than bottomPage then we&#8217;re at the bottom of the page</p>
<pre name="code" class="javascript">
//If we're at the bottom of the page, move pointer to the last section
bottomPage	= parseInt($(document).height()) - parseInt($(window).height());
	
if(scrollPosition == bottomPage || scrollPosition >= bottomPage) {
	
	$('.selected-nav').removeClass('selected-nav');
	$('.navigation a:last').parent('li').addClass('selected-nav');
}
</pre>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/5.jpg" alt="" title="5" width="509" height="623" class="aligncenter size-full wp-image-2399" /><br />
 <br/><br />
Check out the <a href="http://www.webstuffshare.com/demo/WalkingNavigation/index.html">demo 1</a> for this code.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/2.jpg" alt="" title="2" width="509" height="779" class="aligncenter size-full wp-image-2396" /></p>
<p> <br/></p>
<h3>Sliding Style</h3>
<p>Another slick way to tell the user is by sliding a pointer through the navigation. From previous code we need to add an image element acting as pointer. This pointer will be move to the left or to the right pointing current section.</p>
<pre name="code" class="javascript">
	//Bootstraping variable
	headerWrapper		= parseInt($('#header-wrapper').height());
	offsetTolerance	= 40;
	pointer				= $('.pointer');
	firstNav				= $('.navigation a:first').parent('li');
	defaultPointer		= firstNav.offset().left;
	
	//Move pointer to the first menu
	pointer.css('left', defaultPointer);
	firstNav.addClass('selected-nav2');
	
	//Detecting user's scroll
	$(window).scroll(function() {
	
		//Check scroll position
		scrollPosition	= parseInt($(this).scrollTop());
		
		//Move trough each menu and check its position with scroll position then move the pointer
		$('.navigation a').each(function() {

			thisHref				= $(this).attr('href');
			thisTruePosition	= parseInt($(thisHref).offset().top);
			thisPosition 		= thisTruePosition - headerWrapper - offsetTolerance;
			thisNav				= $('.navigation a[href='+ thisHref +']').parent('li');
			currentPosition	= parseInt(thisNav.offset().left);
			
			if(scrollPosition >= thisPosition) {
			
				$('.selected-nav2').removeClass('selected-nav2');
				pointer.stop().animate({'left': currentPosition});
				thisNav.addClass('selected-nav2');
			}
			
		});
		
		//If we're at the bottom of the page, move pointer to the last section
		bottomPage			= parseInt($(document).height()) - parseInt($(window).height());
		lastNav				= $('.navigation a:last').parent('li');
		currentPosition	= lastNav.offset().left;
		
		if(scrollPosition == bottomPage || scrollPosition >= bottomPage) {
			
			$('.selected-nav2').removeClass('selected-nav2');
			pointer.stop().animate({'left': currentPosition});
			lastNav.addClass('selected-nav2');
		}
		
	});
</pre>
<p>The difference with previous code is we are playing on the pointer rather than only styling the navigation. We check through each navigation&#8217;s item and get selected item&#8217;s left position relative to the window (currentPosition), finally slide the pointer to the currentPosition by adjusting its left. Check out the <a href="http://www.webstuffshare.com/demo/WalkingNavigation/index2.html">demo 2</a> for this code.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/4.jpg" alt="" title="4" width="462" height="326" class="aligncenter size-full wp-image-2398" /><br />
 <br/></p>
<h3>Cube Style</h3>
<p>If you read my <a href="http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/">previous post</a> you have to be familiar with this style. On this style focusing the navigation is using cube rotation, up to down direction. Just like <a href="http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/">previous post</a>, we have to modify each navigation&#8217;s item by adding front side and top side. Front side is the default style and top side is selected style.</p>
<pre name="code" class="html">
<ul class="navigation">
	<li class="cube">
		<div class="cube-wrapper">
		<span class="top"> <a href="#home">Home</a> </span>
		<span class="front"> <a href="#home">Home</a> </span>
		</div>
	</li>
</lul>
</pre>
<pre name="code" class="css">
		.cube {
			-webkit-perspective : 1200px;
			-moz-perspective : 1200px;
			-ms-perspective : 1200px;
			perspective : 1200px;
			padding: 0 !important;
		}
		
		.cube:hover a {
			background: 0;
			color: 0;
			text-shadow: 0;
		}
		
			.cube-wrapper-show {
				-webkit-transform-style: preserve-3d;
				-moz-transform-style: preserve-3d;
				-ms-transform-style: preserve-3d;
				transform-style: preserve-3d;
				-webkit-animation: showMenu 0.5s ease-in-out;
				-moz-animation: showMenu 0.5s ease-in-out;
				-ms-animation: showMenu 0.5s ease-in-out;
				height: 60px;		
			}
			
			.cube-wrapper-hide {
				-webkit-transform-style: preserve-3d;
				-moz-transform-style: preserve-3d;
				-ms-transform-style: preserve-3d;
				transform-style: preserve-3d;
				-webkit-animation: hideMenu 0.5s ease-in-out;
				-moz-animation: hideMenu 0.5s ease-in-out;
				-ms-animation: hideMenu 0.5s ease-in-out;
				height: 60px;		
			}
			
				.top, .front {
					display: block;
					width: 70px;
					height: 16px;
					padding: 22px 0;
					vertical-align: middle;
					position: absolute;
				}
			
				.front {
					background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#cbcbcb));
					background-image: -webkit-linear-gradient(top, #fefefe, #cbcbcb);
					background-image:    -moz-linear-gradient(top, #fefefe, #cbcbcb); 
   				background-image:     -ms-linear-gradient(top, #fefefe, #cbcbcb); 
   				background-image:      -o-linear-gradient(top, #fefefe, #cbcbcb); 
   				background-image:         linear-gradient(to bottom, #fefefe, #cbcbcb);
				}
				
				.front-before-rotate {
					box-shadow: rgba(214,214,214,0.6) 0px 6px 0px;
					-webkit-transform:  translateZ(25px);
					-moz-transform:  translateZ(25px);
					-ms-transform:  translateZ(25px);
					transform:  translateZ(25px);
				}
			
				.top {
					background-image: -webkit-gradient(linear, left top, left bottom, from(#7bbbf7), to(#338cdf));
					background-image: -webkit-linear-gradient(top, #7bbbf7, #338cdf);
					background-image:    -moz-linear-gradient(top, #7bbbf7, #338cdf); 
   				background-image:     -ms-linear-gradient(top, #7bbbf7, #338cdf); 
   				background-image:      -o-linear-gradient(top, #7bbbf7, #338cdf); 
   				background-image:         linear-gradient(to bottom, #7bbbf7, #338cdf);
					border-bottom: 6px solid #1f6db6;	
					-webkit-transform: rotate3d(1,0,0,90deg) 
											 translateZ(30px);
					-moz-transform: rotate3d(1,0,0,90deg) 
											 translateZ(30px);
					-ms-transform: rotate3d(1,0,0,90deg) 
											 translateZ(30px);
					transform: rotate3d(1,0,0,90deg) 
											 translateZ(30px);
				}
				
				.hide-front {
					display: none;
				}

				.show-front {
					display: block;
				}

				.show-top {
					display: block;
				}
				
				.showed-top {
					display: block;
					-webkit-transform: rotate3d(1,0,0,0deg);
					-moz-transform: rotate3d(1,0,0,0deg);
					-ms-transform: rotate3d(1,0,0,0deg);
					transform: rotate3d(1,0,0,0deg);
				}

				.hidden-top {
					-webkit-transform:	rotate3d(1,0,0,90deg) 
												translateZ(30px);
					-moz-transform:	rotate3d(1,0,0,90deg) 
												translateZ(30px);
					-ms-transform:	rotate3d(1,0,0,90deg) 
												translateZ(30px);
					transform:	rotate3d(1,0,0,90deg) 
												translateZ(30px);
				}

@-webkit-keyframes showMenu {
	0% { -webkit-transform: rotate3d(1,0,0,0); }
	100% { -webkit-transform: rotate3d(1,0,0,-90deg); }
}

		
@-webkit-keyframes hideMenu {
	0% { -webkit-transform: rotate3d(1,0,0,-90deg); }
	100% { -webkit-transform: rotate3d(1,0,0,0); }
}

@-moz-keyframes showMenu {
	0% { -moz-transform: rotate3d(1,0,0,0); }
	100% { -moz-transform: rotate3d(1,0,0,-90deg); }
}

		
@-moz-keyframes hideMenu {
	0% { -moz-transform: rotate3d(1,0,0,-90deg); }
	100% { -moz-transform: rotate3d(1,0,0,0); }
}

@-ms-keyframes showMenu {
	0% { -ms-transform: rotate3d(1,0,0,0); }
	100% { -ms-transform: rotate3d(1,0,0,-90deg); }
}

		
@-ms-keyframes hideMenu {
	0% { -ms-transform: rotate3d(1,0,0,-90deg); }
	100% { -ms-transform: rotate3d(1,0,0,0); }
}
</pre>
<p>After checking through each navigation&#8217;s item, we add cube-wrapper-show class that trigger the CSS animation to rotate the cube-wrapper and hide other items by adding cube-wrapper-hide. When the animation done we push the displayed side to be displayed (<a href="http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/">see the reason</a>). </p>
<pre name="code" class="javascript">
	//Bootstrapping variable
	headerWrapper		= parseInt($('#header-wrapper').height());
	offsetTolerance	= 40;
	allNavigation		= $('.section');
	arrayNavigation	= new Array;
	bottomPage			= parseInt($(document).height()) - parseInt($(window).height());

	//Get all menu based on section
	allNavigation.each(function() {
		
		thisNav					= $(this).attr('id');
		thisHref					= $('a[href=#'+thisNav+']').attr('href');
		thisTruePosition		= parseInt($(thisHref).offset().top);
		thisPosition		 	= thisTruePosition - headerWrapper - offsetTolerance;
		
		arrayNavigation.push(thisPosition);
		
	});
	
	//Detecting user's scroll
	$(window).scroll(function() {
		
		//Check scroll position and get displayed section
		scrollPosition	= parseInt($(this).scrollTop());
		thisPosition	= 0;
		
		for(var i=0; i < arrayNavigation.length; i++){
		
			if(scrollPosition >= arrayNavigation[i]) {
				thisPosition =  i;
			}
		}
		
		//If we're at the bottom of the page, select last section
		if(scrollPosition == bottomPage || scrollPosition >= bottomPage) {
			thisPosition = parseInt(arrayNavigation.length) - 1;
		}
		
		//Preparing menu to be displayed
		currentElem			= $('.cube:eq('+thisPosition+')');
		currentCube			= currentElem.children('.cube-wrapper');
		currentFront		= currentCube.children('.front');
		currentTop			= currentCube.children('.top');
		
		//Get last displayed menu
		showedElem			= $('.cube:lt('+thisPosition+'), .cube:gt('+thisPosition+')');
		showedCube			= showedElem.children('.cube-wrapper');
		showedFront			= showedCube.children('.front');
				
		if(!currentCube.hasClass('cube-wrapper-show')) {
			
			//Hide other displayed menu
			showedCube.each(function() {
				
				if($(this).hasClass('cube-wrapper-show')) {
						
					$(this).children('.front').removeClass('hide-front');
					$(this).removeClass('cube-wrapper-show').addClass('cube-wrapper-hide');
					$(this).children('.top').removeClass().addClass('top');
				}
			
			});	
			
			//Show selected menu
			currentFront.addClass('front-before-rotate');
			currentCube.addClass('cube-wrapper-show');
			
			//Clean up after animation end
			if($.browser.webkit) {
			
				currentCube.bind('webkitAnimationEnd', function() {
				
					//Clean up last displayed menu
					showedCube.removeClass().addClass('cube-wrapper');
					showedFront.removeClass('front-before-rotate');
				
					//Force menu to be displayed
					currentTop.addClass('showed-top');
					currentFront.addClass('hide-front');
						
					$(this).unbind();
					
				});

			} else {
				
				setTimeout(function(){
					
					showedCube.removeClass().addClass('cube-wrapper');
					showedFront.removeClass('front-before-rotate');
				
					//Force menu to be displayed
					currentTop.addClass('showed-top');
					currentFront.addClass('hide-front');
					
				}, 500);
			}				
		}
	});	
</pre>
<p>Check out the <a href="http://www.webstuffshare.com/demo/WalkingNavigation/index3.html">demo 3</a> for this code.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/6.jpg" alt="" title="6" width="509" height="373" class="aligncenter size-full wp-image-2400" /><br />
 <br/></p>
<h3>We&#8217;re Done</h3>
<p>Ton of single page website with their unique menu spread out there, all of them can inspire us the navigation design and behavior, maybe you have one? Share yours or your thought!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/02/how-to-create-a-walking-navigation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Creating &#8220;Next Level&#8221; Search Form Using jQuery &amp; CSS3</title>
		<link>http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/</link>
		<comments>http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 16:24:24 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Buttons]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=2350</guid>
		<description><![CDATA[Lately we found ton of new style search form crafted beautifully using CSS3 and JavaScript. Apple&#8217;s for example, widen the input field when it receive focus from user. The question [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/2350.jpg&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>Lately we found ton of new style search form crafted beautifully using CSS3 and JavaScript. <a href="http://livepage.apple.com" target="_blank">Apple&#8217;s</a> for example, widen the input field when it receive focus from user. The question is &#8220;how far we can go for styling search form?&#8221;, in this tutorial we are going to move search form to the next level using jQuery &#038; CSS3. </p>
<p><span id="more-2350"></span></p>
<div class="button-show-implementation"><a href="http://webstuffshare.com/demo/NextLevelSearch/">Show Implementation</a></div>
<div class="button-download-source"><a href="http://www.webstuffshare.com/download/NextLevelSearch.zip">Download Source</a></div>
<div class="cleaner"></div>
<h3>Simple Style</h3>
<p>First to go we will create a simple animated search form that show only search button with search image on it. When the button receives a click, the input field will widen while the search image will move to left filling the left blank space before input text.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/simple-style2.jpg" alt="" title="simple style" class="aligncenter size-full wp-image-2352" /><br />
</br></p>
<p>Based on the picture above, the HTML element will consists of 4 elements, a div for elements wrapper, an input text, an input button for search button and an image search. All of them will be stacked each other where the div wrapper is at the very bottom of the stack and image search at the very top. Here&#8217;s the HTML and CSS :</p>
<pre name="code" class="html">
<div class="wrapper-simple">
	<input type="text" value="Type and enter..." />
	<input type="submit" value="" />
	<img src="images/search-icon-big.png" />
</div>
</pre>
<pre name="code" class="css">
.wrapper-simple {
	text-align: center;
	margin: 0 auto;
	display: block;
	width: 60px;
	height: 45px;
	padding: 10px 5px;
	background: -webkit-gradient(linear, left top, left bottom, from(#f5fafe), to(#e2edf4));
	border-radius: 5px;
	box-shadow: inset rgba(255, 254, 255, 1) 0 0.1em 2px,
					#9bb6c9 0 1px 2px;
	position: relative;
}

.wrapper-simple input[type=submit] {
	margin-top: .2em;
	z-index: 2;
	position: relative;
	vertical-align: top;
	height: 43px;
	min-width: 55px;
	border-radius: 3px;
	border: 1px solid #aa7818;
	background: -webkit-gradient(linear, left top, left bottom, from(#ffb700), to(#ff8c00));
	box-shadow: inset rgba(255, 255, 255, .5) 0 0.1em 0.1em;
	cursor: pointer;
}

	.wrapper-simple input[type=submit]:active {
		box-shadow: inset rgba(0,0,0,.4) 0 1px 1px;
	}
	
	.wrapper-simple input[type=submit]:hover {
		background: -webkit-gradient(linear, left top, left bottom, from(#ffcb48), to(#ff9c23));
	}

.wrapper-simple input[type=text] {
	font-family: Arial;
	font-weight: bold;
	color: #1a3d51;
	background: #d8e6ef;
	border-radius:2px;
	padding: 10px 10px 15px 10px;
	width: 250px;
	border: 0;
	font-size: 16px;
	text-shadow: rgba(255, 255, 255, 0.7) 1px 1px 1px;
	box-shadow: inset rgba(0,0,0,.4) 0 1px 1px;
	position: absolute;
	width: 1px;
	z-index: 2;
	padding-left: 2em;
	margin-left: .2em;
}

.wrapper-simple img {
	position: absolute;
	top: 1.5em;
	left: 1.5em;
	z-index: 4;
}

</pre>
<p>Now we will read the click event on search button and animate the form using jQuery.</p>
<pre name="code" class="javascript">
$('.wrapper-simple input[type=submit]').toggle(function(){
	
	$('.wrapper-simple').animate({'width':'300px'})
	  .end().find('.wrapper-simple input[type=text]').animate({'width': '250px'})
	  .end().find('.wrapper-simple img').animate({'marginLeft': '-5px'})
	  .end().find(this).animate({'marginLeft':'22em'}).attr('value', 'CANCEL');
	
}, function() {
	
	$('.wrapper-simple').animate({'width':'60px'})
	  .end().find('.wrapper-simple input[type=text]').animate({'width': '1px'})
	  .end().find('.wrapper-simple img').animate({'marginLeft': '0'})
	  .end().find(this).animate({'marginLeft':'0'}).attr('value', '');
	
});
</pre>
<p>The script toggling user&#8217;s click. First click will widen the div wrapper and input text, move the search button to the edge of input text and move image search to fill the left blank space before input text. Second click will revert to normal.<br/><br/></p>
<h3>Cube Style</h3>
<p>After making simple animated search form, actually we aren&#8217;t moving too far.  So we will make another experiment, how about show the search form rotating like a cube? Well, CSS3 properties like transform, perspective and animation seems very helpful. <strong>The thing that we must give more attention that the following code and demo currently work only on Safari 5+ and Firefox 11.0 (Mac)</strong>. </p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/cube-style2.jpg" alt="" title="cube style" class="aligncenter size-full wp-image-2354" /><br />
<br/></p>
<p>Making a cube is a bit tricky, for vertical rotate and one direction (up to down) we can create a cube by making 2 div, first div as a front side of the cube and the second div as a top side. The top side div must be rotated so it will be like coming from the top when the cube rotating.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/layer2.jpg" alt="" title="layer" class="aligncenter size-full wp-image-2355" /><br />
<br/></p>
<p>The structure of elements will be :</p>
<pre name="code" class="html">
<div class="wrapper1">
	<div class="content-wrapper1">
		<div class="search-button1">
			<span><img src="images/search-icon.png" /></span>
		</div>
		<div class="search-box1">
			<input type="text" value="Type your keyword..." />
			<img src="images/close.png" />
		</div>
	</div>
</div>
</pre>
<p>wrapper1 acting as wrapper for all elements inside, content-wrapper1 also as a wrapper that will be rotated, search button-1 as top side and search-box1 as front side. The styling  :</p>
<pre name="code" class="css">
.wrapper1 {
	display: block;
	width: 300px;
	margin: 0 auto;
	-webkit-perspective : 1200px;
}

	.search-button1 span {
		display: block;
		margin: 0 auto;
		background: #643904;
		border-radius: 30px;
		width: 30px;
		height: 30px;
		box-shadow: rgba(255,255,255,.3) 0 1px 0px;
	}
	
		.search-button1 span img {
			vertical-align: middle;
			padding-top: 7px;
		}

	.search-button1:hover {
		background: -webkit-gradient(linear, left top, left bottom, from(#ffcb48), to(#ff9c23));
	}

	.search-button1:active {
		margin-top: 0.2em;
		box-shadow: inset rgba(255, 254, 255, 0.2) 0 0.3em .3em, 
						#8e620e 0 0.3em 0, 
						rgba(0, 0, 0, 0.2) 0 0.5em 3px;	
	}
	
.search-box1 {
	margin-top: -.6em;
	display: none;
	position: absolute;
	width: 300px;
	height: 50px;
	padding: 10px 6px;
	background: -webkit-gradient(linear, left top, left bottom, from(#f5fafe), to(#e2edf4));
	border: 1px solid #9bb6c9;
	border-bottom: 1px solid rgba(255,255,255,0.2);
	border-radius: 5px;
	box-shadow: inset rgba(255, 254, 255, 0.2) 0 0.3em .3em, 
					#899faf 0 .5em 0px, 
					rgba(0, 0, 0, 0.2) 0 .9em 3px;


	-webkit-transform:	rotate3d(1,0,0,90deg) 
								translateZ(20px);
}

	.search-box1 input {
		font-family: Arial;
		font-weight: bold;
		color: #1a3d51;
		background: #d8e6ef;
		border-radius:2px;
		padding: 10px 10px 15px 10px;
		width: 250px;
		border: 0;
		font-size: 16px;
		text-shadow: rgba(255, 255, 255, 0.7) 1px 1px 1px;
		box-shadow: inset rgba(0,0,0,.4) 0 1px 1px;
	}
		
		.search-box1 input:focus {
			outline: none;
		}
	
	.search-box1 img {
		opacity: .5;
		position: absolute;
		margin: .6em 0 0 -2em;
		cursor: pointer;
		-webkit-transition: 0.5s linear;
	}
	
		.search-box1 img:hover {
			opacity: 1;
		}

.hide-search-button {
	display: none;
}

.show-search-button {
	display: block;
}

.show-search-box {
	display: block;
}

.showed-search-box {
	display: block;
	-webkit-transform: rotate3d(1,0,0,0deg);
}

.hidden-search-box {
	-webkit-transform:	rotate3d(1,0,0,90deg) 
								translateZ(25px);
}

.switch-show {
	height: 50px;
	-webkit-transform-style: preserve-3d;
	-webkit-animation: showBox 0.5s ease-in-out;
}

.switch-hide {
	height: 50px;
	-webkit-transform-style: preserve-3d;
	-webkit-animation: hideBox 0.5s ease-in-out;
}

.switch-show {
	height: 50px;
	-webkit-transform-style: preserve-3d;
	-webkit-animation: showBox 0.5s ease-in-out;
}

.switch-hide {
	height: 50px;
	-webkit-transform-style: preserve-3d;
	-webkit-animation: hideBox 0.5s ease-in-out;
}
		
@-webkit-keyframes showBox{
	0% { -webkit-transform: rotate3d(1,0,0,0); }
	100% { -webkit-transform: rotate3d(1,0,0,-90deg); }
}

		
@-webkit-keyframes hideBox{
	0% { -webkit-transform: rotate3d(1,0,0,-90deg); }
	100% { -webkit-transform: rotate3d(1,0,0,0); }
}

</pre>
<p>We&#8217;re a half set up, now we will read the click event from the user and rotate the cube.</p>
<pre name="code" class="javascript">
$('.search-button1').click(function() {
	
	$('.content-wrapper1').addClass('switch-show');
	$('.search-box1').addClass('show-search-box');
		
	setTimeout(function(){
			
		$('.content-wrapper1').removeClass('switch-show');
		$('.search-button1').removeClass('show-search-button').addClass('hide-search-button');
		$('.search-box1').addClass('showed-search-box');
		
	},480);
});

$('.search-box1 img').click(function() {
	
	$('.search-button1').removeClass('hide-search-button');
	$('.search-box1').addClass('hidden-search-box');
	$('.content-wrapper1').addClass('switch-hide');
	
		
	setTimeout(function(){

		$('.content-wrapper1').removeClass('switch-hide');
		$('.search-button1').removeClass('show-search-button');
		$('.search-box1').removeClass('show-search-box showed-search-box hidden-search-box');
		
	},480);
		
});
</pre>
<p>The script above act as an animation delegator, all animation handled by CSS. Since the CSS animation we describe before only works once and revert to the normal state, we force the current showed side to visible and other side to hidden until the animation works before revert back, this is do the trick. <br/><br/></p>
<h3>Cube Style With Animate</h3>
<p>At some point we might animate the front side before rotate the cube. Then we reduce the front side&#8217;s width and widen it before rotate.</p>
<p><img src="http://www.webstuffshare.com/wp-content/uploads/2012/02/cube-style-animate2.jpg" alt="" title="cube style animate" class="aligncenter size-full wp-image-2353" /><br />
<br/></p>
<pre name="code" class="javascript">
$('.search-button2').click(function() {
	
	$('.arrow').hide();
	
	$(this).stop().animate({'width':'300px'}, 500, function() {
		
		$('.content-wrapper2').addClass('switch-show');
		$('.search-box2').addClass('show-search-box');
		
		setTimeout(function(){

			$('.content-wrapper2').removeClass('switch-show');
			$('.search-button2').removeClass('show-search-button').addClass('hide-search-button');
			$('.search-box2').addClass('showed-search-box');
		
		},480);
		
	});
});

$('.search-box2 img').click(function() {
	
	
	$('.search-button2').removeClass('hide-search-button');
	$('.search-box2').addClass('hidden-search-box');
	$('.content-wrapper2').addClass('switch-hide');
	
	$('.search-button2').addClass('show-search-button').stop().delay(500).animate({'width':'50px'}, 500, function() {
		
		$('.content-wrapper2').removeClass('switch-hide');
		$('.search-button2').removeClass('show-search-button');
		$('.search-box2').removeClass('show-search-box showed-search-box hidden-search-box');
		
		$('.arrow').show();
		
	});
});
</pre>
<p>We use jQuery&#8217;s <strong>animate()</strong> function to widen the front side&#8217;s width and reduce it back when user close the form. <br/><br/></p>
<h3>Conclusion</h3>
<p>CSS3 and jQuery combination help us improve current web user interface into unlimited state, depend on our imagination. Did I missed something? I&#8217;d love to hear.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2012/02/creating-next-level-search-form-using-jquery-css3/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>CU3ER</title>
		<link>http://www.webstuffshare.com/2009/12/cu3er/</link>
		<comments>http://www.webstuffshare.com/2009/12/cu3er/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 02:06:50 +0000</pubDate>
		<dc:creator>Hidayat Sagita</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Free Stuff]]></category>
		<category><![CDATA[Gallery]]></category>

		<guid isPermaLink="false">http://www.webstuffshare.com/?p=541</guid>
		<description><![CDATA[On the previous post we have talked about TransM.js as an image slider written in JavaScript. Now is the time for flash. CU3ER \kju:bər\ is an image slider based on [...]]]></description>
				<content:encoded><![CDATA[<p><img src='http://www.webstuffshare.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/541.png&amp;w=200&amp;h=150&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p>On the previous post we have talked about <a title="Go to previous post" href="http://www.webstuffshare.com/2009/12/transm-js/" target="_blank">TransM.js</a> as an image slider written in JavaScript. Now is the time for flash. <a title="Go to CU3ER homepage" href="http://www.progressivered.com/cu3er/" target="_blank">CU3ER</a> \kju:bər\ is an image slider based on flash which is made for creating 3D transition of slides you want to show.</p>
<p>The features provided including spin, slice, shade, add control function and describe content on every transition. You can try CU3ER <a title="Go try CU3ER" href="http://www.progressivered.com/cu3er/" target="_blank">here</a> or download it <a title="Go to CU3ER download page" href="http://www.progressivered.com/cu3er/download/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webstuffshare.com/2009/12/cu3er/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.webstuffshare.com @ 2013-05-23 06:37:33 -->