<?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>PeHaa Blog &#187; PeHaa</title>
	<atom:link href="http://pehaa.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://pehaa.com</link>
	<description>mad about art and digital</description>
	<lastBuildDate>Wed, 18 Apr 2012 11:58:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Shopping in Paris &#8211; free vector</title>
		<link>http://pehaa.com/2012/04/shopping-in-paris-free-vector/</link>
		<comments>http://pehaa.com/2012/04/shopping-in-paris-free-vector/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 11:58:23 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[girl]]></category>
		<category><![CDATA[human]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[Paris]]></category>
		<category><![CDATA[shopping]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2689</guid>
		<description><![CDATA[Still in the "shopping" theme (see my previous post) this time I prepared a simply illustration: a beautiful girl doing her shopping with Paris roofs and Eiffel Tower in the background.  Created in Adobe Illustrator CS5 back saved to CS4 version.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Still in the &#8220;shopping&#8221; theme <a href="http://pehaa.com/2012/04/free-vector-shopping-paper-bag/" title="Free vector shopping paper bag">(see my previous post)</a> this time I prepared a simply illustration: a beautiful girl doing her shopping with Paris roofs and Eiffel Tower in the background.  Created in Adobe Illustrator CS5 back saved to CS4 version.<br />
What do you think ? &#8211; it&#8217;s my first time with human body (I mean in vector ;)) so I&#8217;d really appreciate your feedback. </p>
<p>It&#8217;s free for personal and commercial use. Enjoy your shopping. </p>
<p><img src="http://pehaa.com/wp-content/uploads/2012/04/shopping.jpg" alt="Shopping in Paris" title="Shopping in Paris"/></p>
<p>If you host this file please don&#8217;t forget to add a link to this site.<br />
And if you like/use it please bookmark and share. Thank you. </p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/04/shopping.ai.zip">Download  the source files</a></h3>
<p><a href="http://pehaa.com/wp-content/uploads/2012/04/shopping.ai.zip">Paper Shopping Bag, CS4+ ai.</a>
</p>
<p><small>&nbsp;</small></div>
<div class="shr-publisher-2689"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F04%2Fshopping-in-paris-free-vector%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F04%2Fshopping-in-paris-free-vector%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/04/shopping-in-paris-free-vector/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free vector shopping paper bag</title>
		<link>http://pehaa.com/2012/04/free-vector-shopping-paper-bag/</link>
		<comments>http://pehaa.com/2012/04/free-vector-shopping-paper-bag/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 19:22:44 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2677</guid>
		<description><![CDATA[Recently I needed a paper bag to illustrate "shopping". I decided to create one myself - and now I'm ready to share it with my visitors. Free for commercial use. Enjoy your shopping.
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Recently I needed a paper bag to illustrate a &#8220;shopping&#8221; theme. I decided to create one myself &#8211; and now I&#8217;m ready to share it with you, my visitors. It was created in Adobe Illustrator CS5 back saved to CS4 version.</p>
<p>It&#8217;s free for commercial use. Enjoy your shopping.</p>
<p><img src="http://pehaa.com/wp-content/uploads/2012/04/SHOPPINGBAGcs4.jpg" alt="Shopping Paper Bag in vector format"/></p>
<p>If you host this file please don&#8217;t forget to add a link to this site.<br />
And if you like/use it please bookmark and share. Thank you. </p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/04/SHOPPINGBAGcs4.ai.zip">Download  the source files</a></h3>
<p><a href="http://pehaa.com/wp-content/uploads/2012/04/SHOPPINGBAGcs4.ai.zip">Paper Shopping Bag, CS4+ ai.</a><br />
<small>.zip 0.(MB</small></p>
</div>
<div class="shr-publisher-2677"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F04%2Ffree-vector-shopping-paper-bag%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F04%2Ffree-vector-shopping-paper-bag%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/04/free-vector-shopping-paper-bag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Vector chef &#8211; illustrate your cuisine</title>
		<link>http://pehaa.com/2012/03/free-vector-chef-illustrate-your-cuisine/</link>
		<comments>http://pehaa.com/2012/03/free-vector-chef-illustrate-your-cuisine/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 07:21:21 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2663</guid>
		<description><![CDATA[A simple vector illustration of a restaurant chef handling a pancake pan. With a slight retro flavor.
Enjoy - it's free for personal and commercial use. ]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>A simple vector illustration of a restaurant chef handling a pancake pan. With a slight retro flavor.<br />
Enjoy &#8211; it&#8217;s free for personal and commercial use. </p>
<p><img src="http://pehaa.com/wp-content/uploads/2012/03/vector_COOK.png" alt="Vector chef with a pancake pan"/></p>
<p>If you host this file please don&#8217;t forget to add a link to this site.<br />
And if you like/use it please bookmark and share. Thank you. </p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/03/COOK.ai.zip">Download  the source files</a></h3>
<p><a href="http://pehaa.com/wp-content/uploads/2012/03/COOK.ai.zip">Vector chef, CS3+ ai.</a><br />
<small>.zip 0.4MB</small></p>
</div>
<div class="shr-publisher-2663"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F03%2Ffree-vector-chef-illustrate-your-cuisine%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F03%2Ffree-vector-chef-illustrate-your-cuisine%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/03/free-vector-chef-illustrate-your-cuisine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vintage free vector TV-set</title>
		<link>http://pehaa.com/2012/02/vintage-free-vector-tv-set/</link>
		<comments>http://pehaa.com/2012/02/vintage-free-vector-tv-set/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 22:46:51 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2642</guid>
		<description><![CDATA[This time I share with you a retro TV set in vector format. 
You may use it for your personal and commercial projects. Feel free. However if you host this file please don't forget to add a link to this site. ]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><img src="http://pehaa.com/wp-content/uploads/2012/02/tv600.jpg" alt="Vintage free vector TV"/></p>
<p>This time I share with you a retro TV set in vector format. It&#8217;s been created in Adobe Illustrator CS5 and back saved to CS4+.<br />
You may use it for your personal and commercial projects. Feel free. However if you host this file please don&#8217;t forget to add a link to this site. </p>
<p>You&#8217;ll see a live example of how this vector was used <a href="http://vcard.pehaa.com" title="PeHaa's (T)V-card ">in my experimental virtual card. </a> </p>
<p>If you like/use it please bookmark and share. Thank you. </p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/02/retro_tv.ai.zip">Download  the source files</a></h3>
<p>Vintage vector TV, CS4+ ai.<br />
<small>.zip 5MB</small></p>
</div>
<div class="shr-publisher-2642"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fvintage-free-vector-tv-set%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fvintage-free-vector-tv-set%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/02/vintage-free-vector-tv-set/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create your portfolio gallery using html5 canvas &#8211; tutorial</title>
		<link>http://pehaa.com/2012/02/create-your-portfolio-gallery-using-html5-canvas-tutorial/</link>
		<comments>http://pehaa.com/2012/02/create-your-portfolio-gallery-using-html5-canvas-tutorial/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 20:04:22 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2604</guid>
		<description><![CDATA[In this tutorial we will build a photo gallery and enhance it with html5 canvas and css3 transitions. See the demo and try the hover effect. The grayscale "copies" of our images are created with canvas and we use pure css3 for the smooth change. 
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a class="twitter-share-button" href="http://twitter.com/share" data-count="horizontal" data-via="PeHaa">Tweet</a></p>
<p><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
<p>In this tutorial we will build a photo gallery and enhance it with html5 canvas and css3 transitions. See <a href="http://pehaa.com/wp-content/uploads/2012/02/tut_pinkonhead/index.html">the demo</a> and try the hover effect. The grayscale &#8220;copies&#8221; of the images are created with canvas and we use pure css3 for the smooth changes. </p>
<p><a href="http://pehaa.com/wp-content/uploads/2012/02/tut_pinkonhead/index.html" target="_blank"><img src="http://pehaa.com/wp-content/uploads/2012/02/preview1.jpg" alt="Photo gallery with html5 canvas" /></a></p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/02/tut_gallery.zip">Download  the source files</a></h3>
<p>Portfolio gallery with canvas<br />
<small>.zip 0.25MB</small></p>
</div>
<h2>Step 1 : Html markup</h2>
<p>Let&#8217;s start with a simple markup, each portfolio entry being an element of an unordered list.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;meta charset=&quot;UTF-8&quot; /&gt;
	&lt;title&gt;Gallery :: Tutorial by PeHaa &lt;/title&gt;
	&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;wrap&quot;&gt;
		&lt;h1&gt;Gallery&lt;/h1&gt;
		&lt;ul id=&quot;gallery&quot;&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/flo1.jpg&quot;&gt;&lt;div&gt;Spring flowers 1&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/lights2.jpg&quot;&gt;&lt;div&gt;City lights 1&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/flo3.jpg&quot;&gt;&lt;div&gt;Spring flowers 2&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/lights1.jpg&quot;&gt;&lt;div&gt;City lights 2&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/flo2.jpg&quot;&gt;&lt;div&gt;Spring flowers 3&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;img src=&quot;images/lights3.jpg&quot;&gt;&lt;div&gt;City lights 3&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
		&lt;p&gt;Photos by &lt;a href=&quot;http://pinkonhead.com&quot;&gt;Pinkonhead&lt;/a&gt;&lt;/p&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Step 2: Basic styles</h2>
<p>We start our stylesheet with a basic reset.</p>
<pre class="brush: css; title: ; notranslate">
html, body, div, span, h1, h2,  p, a,  ul, li, img
{margin: 0; padding: 0;
border: 0; outline: 0;
font-size: 100%;background: transparent;}
ul {list-style: none;}
:focus {outline: 0;}
a {text-decoration:none;}
</pre>
<p>We will use 300px x 300px images. The main containing element <code>#wrap</code> is centered up (margin: 0 auto) and given the  width of  1020px (=340 x 3).<br />
The list items are given float : left and are positioned relatively. The image title is wrapped in a div element that slides up on hover. To achieve a smooth effect we apply a css3 transition.<br />
(Note that for the simplicity of this tutorial I don&#8217;t use any vendor prefixes. Therefore, you&#8217;ll find them in the source file to download).</p>
<pre class="brush: css; title: ; notranslate">
#wrap {
  width: 1020px;
  margin: 0 auto;
}
li {
  float:left;
  position:relative;
  display:inline-block;
  width:300px;
  height:300px;
  margin:10px;
  padding:10px;
  background:#fff;
  box-shadow:0 0 5px rgba(0,0,0,.35);
}
li div {
  position:absolute;
  height:0;
  width:280px;
  background:rgba(0,0,0,.45);
  overflow:hidden;
  bottom:10px;
  left:10px;
  padding: 0 10px;
  line-height:50px;
  color:#fff;
  transition:height 1s;
}
li:hover div {
  height:50px;
}
</pre>
<p>Click on the image to below to see the result at the current stage.</p>
<p><a href="http://pehaa.com/wp-content/uploads/2012/02/tut_pinkonhead/index0.html" target="_blank"><img src="http://pehaa.com/wp-content/uploads/2012/02/preview2.jpg" alt="Photo gallery with canvas" /></a></p>
<h2>Step 3: Canvas</a></h2>
<p>Now, we will make use of the html5 <a href="https://developer.mozilla.org/en/Canvas_tutorial" target="_blank">canvas</a> element to draw the grayscale versions of our images. Below you&#8217;ll find a <code>createCanvas</code> custom function that creates a canvas element, takes a copy of an image, performs the conversion and draws it to the canvas and finally inserts the canvas to the DOM where desired.  With <code>.each()</code> method the <code>createCanvas</code> function is iterated across all images within the <code>#gallery</code> list.</p>
<pre class="brush: jscript; title: ; notranslate">
$(window).load(function() {

	  $('#gallery img').each(function() {

	    createCanvas(this);
	  });

	  function createCanvas(image) {

	    var canvas = document.createElement('canvas');
	    if (canvas.getContext) {
	      var ctx = canvas.getContext(&quot;2d&quot;);

// specify canvas size
	      canvas.width = image.width;
	      canvas.height = image.height;

// Once we have a reference to the source image object we can use
// the drawImage(reference, x, y) method to render it to the canvas.
//x, y are the coordinates on the target canvas where the image should be placed.
	      ctx.drawImage(image, 0, 0);

// Taking the image data and storing it in the imageData array.
//You can read the pixel data on a canvas using the getImageData() method.
// Image data includes the colour of the pixel (decimal, rgb values) and alpha value.
// Each color component is represented by an integer between 0 and 255.
//imageData.data contains height x width x 4 bytes of data, with index values ranging from 0 to (height x width x 4)-1.
	      var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height),
	          pixelData = imageData.data;

// Loop through all the pixels in the imageData array, and modify
// the red, green, and blue color values.
	      for (var y = 0; y &lt; canvas.height; y++) {
	        for (var x = 0; x &lt; canvas.width; x++) {

// You can access the color values of the (x,y) pixel as follows :
	          var i = (y * 4 * canvas.width) + (x * 4);

// Get the RGB values.
	          var red = pixelData[i];
	          var green = pixelData[i + 1];
	          var blue = pixelData[i + 2];

// Convert to grayscale. One of the formulas of conversion (e.g. you could try a simple average (red+green+blue)/3)
	          var grayScale = (red * 0.3) + (green * 0.59) + (blue * .11);

	          pixelData[i] = grayScale;
	          pixelData[i + 1] = grayScale;
	          pixelData[i + 2] = grayScale;
	        }
	      }

// Putting the modified imageData back on the canvas.
	      ctx.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);

// Inserting the canvas in the DOM, before the image:
	      image.parentNode.insertBefore(canvas, image);
	    }
	  }
	});
</pre>
<h2>Step 4: Styling the canvas </a></h2>
<p>If you look into the generated code source you&#8217;ll find </p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul id=&quot;gallery&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;canvas width=&quot;300&quot; height=&quot;300&quot;&gt;&lt;/canvas&gt;&lt;img src=&quot;images/flo1.jpg&quot;&gt;&lt;div&gt;Spring flowers 1&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;canvas width=&quot;300&quot; height=&quot;300&quot;&gt;&lt;/canvas&gt;&lt;img src=&quot;images/lights2.jpg&quot;&gt;&lt;div&gt;City lights 1&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;...&lt;/li&gt;
	...
&lt;/ul&gt;
</pre>
<p>Let&#8217;s add some styling to define the <code>canvas</code> behavior in normal and hover state:</p>
<pre class="brush: css; title: ; notranslate">
canvas {
  opacity:1;
  position:absolute;
  top:10px;
  left:10px;
  transition:opacity 1s .2s;
}
li:hover canvas {
  opacity:0;
}
</pre>
<p>And that&#8217;s it ! This example will not work in Internet Explorer versions below 9. You could provide an alternative solution using grayscale filter and adding some jQuery to recreate the transition effect on hover &#8211; but this part is not covered in this tutorial. </p>
<p>The beautiful photos featured here were taken by <a href="http://pinkonhead.com">Pinkonhead</a>, and are shared as <a href="http://pinkonhead.com/category/freebies/photos/" target="_blank">freebies on her blog</a>. Enjoy.</p>
<div class="shr-publisher-2604"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fcreate-your-portfolio-gallery-using-html5-canvas-tutorial%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fcreate-your-portfolio-gallery-using-html5-canvas-tutorial%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/02/create-your-portfolio-gallery-using-html5-canvas-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create a fancy responsive image-on-hover effect</title>
		<link>http://pehaa.com/2012/02/create-a-fancy-responsive-image-on-hover-effect/</link>
		<comments>http://pehaa.com/2012/02/create-a-fancy-responsive-image-on-hover-effect/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 20:37:26 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2511</guid>
		<description><![CDATA[In this tutorial we will create a fancy image on hover effect. We'll use pure css3 and provide a jQuery solution for the browsers that do not support opacity and transitions. We will also take care that it works responsively. ]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a class="twitter-share-button" href="http://twitter.com/share" data-count="horizontal" data-via="PeHaa">Tweet</a></p>
<p><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
<p>In this tutorial we will create a fancy image-on-hover effect. We&#8217;ll use pure css3 and provide a jQuery solution for the browsers that do not support opacity and transitions. We will also take care that it works responsively.</p>
<p><a href="http://pehaa.com/wp-content/uploads/2012/02/tutorial/image3.html" target="_blank"><img src="http://pehaa.com/wp-content/uploads/2012/02/preview.jpg" alt="Two version of an image" /></a></p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2012/02/image.zip">Download  the source files</a></h3>
<p>Fancy responsive image-on-hover effect<br />
<small>.zip 0.2MB</small></p>
</div>
<h2>Step 1 : Photoshop</h2>
<p>We have to prepare two versions of the image : the image we want to see on hover and its desaturated copy. Mine are 845px x 515px.</p>
<p><img src="http://pehaa.com/wp-content/uploads/2012/02/tut_images.jpg" alt="Two version of an image" /></p>
<h2>Step 2 : Let&#8217;s start with the html markup</h2>
<pre class="brush: xml; title: ; notranslate">
..
&lt;div id=&quot;wrap&quot;&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;div&gt;
          &lt;img src=&quot;img/tut1_desaturated.jpg&quot;/&gt;
          &lt;span class=&quot;shadow&quot;&gt;&lt;/span&gt;
          &lt;img class=&quot;onhover&quot; src=&quot;img/tut1_color.jpg&quot;/&gt;
      &lt;/div&gt;
   &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
<h2>Step 3: Basic styles</h2>
<p>We start our stylesheet with a basic reset.</p>
<pre class="brush: css; title: ; notranslate">
html, body, div, span, h1, h2,  p, a,  ul, li, img
{margin: 0; padding: 0;
border: 0; outline: 0;
font-size: 100%;background: transparent;}
ul {list-style: none;}
</pre>
<p>The main containing element <code>#wrap</code> is centered up and given the specific width 865 px = 845px (image size) + 2x10px (borders size).<br />
The div that contains the images is given position:relative (to properly position the two versions of the image) and overflow hidden (we will size up and rotate our images and we want to hide the exceeding parts).</p>
<pre class="brush: css; title: ; notranslate">
#wrap { width: 865px; margin: 0 auto;}
ul {margin-top:50px; }
li div {width:845px; height:515px; overflow:hidden; position:relative;
border:10px solid white; box-shadow: 0 2px 5px  rgba(0,0,0,.4);}
</pre>
<h2>Step 4: Grayscale to color transition <a href="http://pehaa.com/wp-content/uploads/2012/02/tutorial/image1.html" target="_blank">(see demo)</a></h2>
<p>The img element is positioned relatively, the colored version (<code>.onhover</code>) is given 0 opacity and absolute position. When the containing div is being hovered over the opacity of <code>.onhover</code> element changes to 1. To make the transition smooth we apply the transition property to <code>img</code>. (For simplicity I decided to omit all vendor prefixes).</p>
<pre class="brush: css; title: ; notranslate">
img {position:relative; top:0;left:0;
transition:all 1.5s .5s; }
img.onhover {opacity:0;position:absolute;}
li div:hover img.onhover {opacity:1;}
</pre>
<p>To deepen the effect of transition between the normal and hover state we will add a fading out inner shadow (<code>span.shadow</code>):</p>
<pre class="brush: css; title: ; notranslate">
.shadow {position:absolute; top:0; left:0; opacity:1; background:transparent;
width:100%; height:100%;
box-shadow: inset 0 0 60px 20px rgba(37,27,23,.5);
transition:opacity 1.5s .5s;}
li div:hover .shadow {opacity:0;}
</pre>
<h2>Step 5: Let&#8217;s add scaling and rotation <a href="http://pehaa.com/wp-content/uploads/2012/02/tutorial/image2.html" target="_blank">(see demo)</a></h2>
<p>We just have to add the transform property, specify the transform origin as well as the transform parameters in hover state.</p>
<pre class="brush: css; title: ; notranslate">
img {position:relative; top:0;left:0;
transition:all 1.5s .5s;
transform: rotate(-4deg) scale(1.2);
transform-origin:50% 50%;}

li div:hover img {transform: scale(1) rotate(0);}
</pre>
<h2>Step 6: And what if we want it responsive ? <a href="http://pehaa.com/wp-content/uploads/2012/02/tutorial/image3.html" target="_blank">(see demo)</a></h2>
<p>First let&#8217;s modify a little bit the style of <code>#wrap</code> and the <code>li div</code> to keep them flexible. In the latter case we just no longer specify the height and width of the element.</p>
<pre class="brush: css; title: ; notranslate">
#wrap { max-width: 865px; margin: 0 auto; width:95%;}
li div { overflow:hidden; position:relative;
border:10px solid white; box-shadow: 0 2px 5px rgba(0,0,0,.4);}
</pre>
<p>We have also to modify the styling of the img element &#8211; we add three new properties to the img element. </p>
<pre class="brush: css; title: ; notranslate">
img {max-width:auto; vertical-align:bottom; width:100%;}
</pre>
<h2>Step 7: jQuery solution</h2>
<p>We will add a jQuery solutions for IE. </p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--[if lt IE 9]&gt;&lt;script&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
	$(document).ready(function() {
           $('.onhover').hide();
$('li div').hover(function(){
$(this).find('.onhover').fadeIn(1000);
},function(){
$(this).find('.onhover').fadeOut(1000);
})
})
&lt;/script&gt;&lt;![endif]--&gt;
</pre>
<p>You can also go further and recreate the full transition with jQuery animate function.</p>
<p>And that&#8217;s it. I hope you got inspired by this example &#8211; it&#8217;s your turn to play with css transitions. Enjoy !</p>
<div class="shr-publisher-2511"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fcreate-a-fancy-responsive-image-on-hover-effect%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2012%2F02%2Fcreate-a-fancy-responsive-image-on-hover-effect%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2012/02/create-a-fancy-responsive-image-on-hover-effect/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Intriguing animate-on-scroll effect &#8211; jQuery tutorial</title>
		<link>http://pehaa.com/2011/08/intriguing-animate-on-scroll-effect-jquery-tutorial/</link>
		<comments>http://pehaa.com/2011/08/intriguing-animate-on-scroll-effect-jquery-tutorial/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 19:29:42 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Photoshop tip trick]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2429</guid>
		<description><![CDATA[I suppose that I was not the only one to become speechless in front of the <a href="http://nizoapp.com">Nizo for iPhone</a> website.
In this tutorial we try to recreate the intriguing scrolling effect.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a class="twitter-share-button" href="http://twitter.com/share" data-count="horizontal" data-via="PeHaa">Tweet</a></p>
<p><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
<p>I suppose that I was not the only one to become speechless in front of the <a href="http://nizoapp.com" target="_blank">Nizo for iPhone</a> website.<br />
In this tutorial we try to recreate the intriguing scrolling effect. We&#8217;ll go for simplicity : 5 objects to animate and linear movement, no easing. The basis that opens the door for further elaboration. </p>
<p>Click here to see <a href="http://pehaa.com/wp-content/uploads/2011/08/myherbgarden/index.html" target="_blank">the demo</a>.<br />
<a href="http://pehaa.com/wp-content/uploads/2011/08/myherbgarden/index.html" target="_blank"><img alt="My herb garden preview"  src="http://pehaa.com/wp-content/uploads/2011/08/previewhg.jpg" title="My herb garden" class="aligncenter" width="600" height="auto" /></a></p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2011/08/myherbgarden.zip">Download  the source files</a></h3>
<p>My herb garden<br />
<small>.zip 0.4MB</small></p>
</div>
<p>We&#8217;ll start with the html structure :</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot; /&gt;
&lt;title&gt;My herb garden&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrap_out&quot;&gt;
  &lt;div id='wrap'&gt;
    &lt;header&gt;
      &lt;h1&gt;My &lt;em&gt;herb&lt;/em&gt; garden&lt;/h1&gt;
      &lt;p&gt;Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum id ligula porta felis euismod semper.&lt;/p&gt;
    &lt;/header&gt;
    &lt;div id=&quot;separation&quot;&gt;
      &lt;div&gt;Scroll &lt;em&gt;down&lt;/em&gt;&lt;/div&gt;
      &lt;img src=&quot;images/herbes.jpg&quot; width=&quot;592&quot; height=&quot;350&quot; alt=&quot;Herbes&quot;&gt; &lt;/div&gt;
    &lt;section&gt;
      &lt;div  id=&quot;coriander&quot; class=&quot;element&quot;&gt;
        &lt;div&gt;coriander&lt;/div&gt;
        &lt;img src=&quot;images/coriander1.jpg&quot; width=&quot;286&quot; height=&quot;232&quot; alt=&quot;Coriander&quot;&gt;
        &lt;p&gt;Cras mattis consectetur purus sit amet fermentum. Cras mattis consectetur purus sit amet fermentum. Cras mattis consectetur purus sit amet fermentum.&lt;/p&gt;
      &lt;/div&gt;
      &lt;div  id=&quot;rosemary&quot; class=&quot;element&quot;&gt;...&lt;/div&gt;
      &lt;div  id=&quot;lemonbalm&quot; class=&quot;element&quot;&gt;...&lt;/div&gt;
      &lt;div  id=&quot;chives&quot; class=&quot;element&quot;&gt;...&lt;/div&gt;
      &lt;div  id=&quot;basil&quot; class=&quot;element&quot;&gt;...&lt;/div&gt;
    &lt;/section&gt;
    &lt;footer&gt; &lt;a href=&quot;http://pehaa.com&quot;&gt; by &lt;em&gt;PeHaa&lt;/em&gt; 2011&lt;/a&gt; &lt;/footer&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The document is composed of 4 elements <code>header</code>, <code>#separation</code>, <code>section</code> and <code>footer</code>, contained within two divs : <code>#wrap_out</code> and <code>#wrap</code>.<br />
The stylesheet begins with a simple css reset and the @font-face declaration</p>
<pre class="brush: css; title: ; notranslate">
body, div, h1, h2, form, fieldset, input, textarea, footer, p, img {
	margin: 0; padding: 0; border: 0; outline: none;
}
a { text-decoration:none; color: #fff;}

 @font-face {
 font-family: 'DeibiRegular';
 src: url('deibi-webfont.eot');
 src: url('deibi-webfont.eot?#iefix') format('embedded-opentype'),  url('deibi-webfont.woff') format('woff'),  url('deibi-webfont.ttf') format('truetype'),  url('deibi-webfont.svg#DeibiRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}
</pre>
<p>Right now, the important point is to set <code>width : 100%</code> and <code>overflow-x: hidden</code> for the <code>#wrap_out</code>. The <code>#wrap</code> element centers the content of the page.<br />
<code>section</code>  is positioned relatively and the animated herbs (<code>class="element"</code>) are positioned absolutely.<br />
Let&#8217;s continue with our stylesheet : </p>
<pre class="brush: css; title: ; notranslate">
body {
	font-family:'DeibiRegular', Helvetica, Arial, sans-serif;
	background:#f2f2f2 url('images/bg.jpg');
	color: #fff; width:100%;
}
#wrap_out {width:100%; overflow-x:hidden;}
#wrap {width: 960px; margin: 0 auto; z-index:1;position:relative;}

header {display:block;z-index:2 position:relative;}
header p {display:block; font-size:30px; padding: 70px 60px 0px;}
h1 {text-align:center;font-size:130px; margin-top: 30px; text-shadow: 0 0 60px #889473;}
h1 em {color: #f5f187;font-style: normal;}

#separation {margin: 0 auto;width: 592px;z-index:-1;position:relative;}

section {position:relative; margin-top: 120px;display:block}

.element { position:absolute; display:block;}
.element#coriander {top:0px; left:30px; width: 286px; height: 272px;}
.element#rosemary {top:40px; left: 335px; width: 370px; height: 183px;}
.element#chives {top : 0px; right:30px; width: 197px; height: 514px;}
.element#lemonbalm {left: 30px; top:280px; width:265px; height: 233px;}
.element#basil {right: 255px; top:250px; width:368px; height: 263px;}

footer {margin-bottom: 10px;text-align:center;font-size: 30px; display:block}
</pre>
<p>The idea is to encourage the visitor to scroll down by positioning the <code>#separation</code> element at the bottom of the page. We want the <code>#separation</code> to stay there when the window is resized but to move up when we start to scroll down. A possible way to do that is to make the height of the  <code>header</code> element dependent on the height of the window browser :</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function () {
    var myHeight;

    function init() {
        myHeight = $(window).height();
        $('header').css('height', myHeight - 300);
    }
    init();
    $(window).resize(function () {
        init();

    });
})
</pre>
<p>To animate the <code>.element</code> we&#8217;ll go simple and use a linear function to move it from its initial position to its target position. We assign four parameters (its initial and final coordinates) to each element :</p>
<pre class="brush: jscript; title: ; notranslate">
$('.element').each(function(i) {
			var myElement =$(this);

				switch (i)
				{ case 0 :
					myElement.data('params', {top0 : -1300, x0 : -2600, top1: $(this).css('top'), x1: $(this).css('left')});
					break;
				case 1 :
					myElement.data('params', {top0 : 0, x0 : -930, top1: $(this).css('top'), x1: $(this).css('left')});
					break;
				case 2 :
					myElement.data('params', {top0 : 280, x0 : -1030, top1: $(this).css('top'), x1: $(this).css('left')});
					break;
				 case 3 :
					myElement.data('params', {top0 : -1200, x0 : -2330, top1: $(this).css('top'), x1: $(this).css('right')});
					break;
				case 4 :
					myElement.data('params', {top0 : 250, x0 : -530, top1: $(this).css('top'), x1: $(this).css('right')});
					break;
				}
			});
</pre>
<p>What happens when we scroll ? The top property of each element and the left (for coriander, rosemary and lemon bald) or right (for chives and basil) changes as a function of the scroll position :</p>
<pre class="brush: jscript; title: ; notranslate">
$(window).scroll(function () {
var s_max = myHeight / 2 + 500;
    function move(p0, p1, s) {
        return Math.min((-p0 + p1) / s_max * s + p0, p1);
    }

    var scrollTop = parseInt($(window).scrollTop());
    $('.element').each(function (i) {

        var myX = move($(this).data('params').x0, parseInt($(this).data('params').x1), scrollTop),
            myY = move($(this).data('params').top0, parseInt($(this).data('params').top1), scrollTop);

if (i &lt; 3) {
            $(this).stop().css({
                left: myX + 'px',
                top: myY + 'px'
            })
        } else {
            $(this).stop().css({
                right: myX + 'px',
                top: myY + 'px'
            })
        }
    })
})
</pre>
<p><code>move</code>  is a function of the scroll value and has two parameters : initial (p0) and final (p1) position of an element.<br />
Before we start scrolling, s = 0, move is equeal to p0. When scroll reaches s_max, the value of move is p1. The min operator prevents further movement.<br />
As I said this is one of the simplest possible solutions.<br />
What is s_max ? I wanted the animation to finish once the elements are verticaly centered in the middle of the window (I&#8217;m not pixel perfect here).<br />
Where is that point ? Imagine that we don&#8217;t animate our elements and that they are in their final positions. Notice that we have to scroll down 500px (see the scheme below), to see the top of the second row of our herbs. If we scroll down a half height of a window more we will see them in the middle.<br />
<img alt="My herb garden preview"  src="http://pehaa.com/wp-content/uploads/2011/08/scheme.jpg" title="My herb garden scheme " class="aligncenter" width="552" height="837" /><br />
We want to be sure that the page is high enough so that the elements could reach their final positions. To assure that we will make the property height of <code>section</code> dependent on the height of the browser window, in this case we need to scroll <code>$(window).height/2 + 500</code>. We have 240px above the section (120px + 120px). The minimum height of <code>section</code> is then <code>$(window).height/2 + 260</code>. We add a line to the <code>init</code> function </p>
<pre class="brush: jscript; title: ; notranslate">
function init() {
    myHeight = $(window).height();
    $('header').css('height', myHeight - 300);
    $('section').css('min-height', Math.max(myHeight / 2 + 260, 600));
}
</pre>
<p>It was tested in Safari, Firefox, Chrome, Opera, IE7 and IE8. It works in the last two if you don&#8217;t forget to add</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if IE]&gt;
	&lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
<p>I hope you find it useful. Please bookmark and share.<br />
Let me know what you think &#8211; I&#8217;m looking forward to your comments. Thanks.</p>
<div class="shr-publisher-2429"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F08%2Fintriguing-animate-on-scroll-effect-jquery-tutorial%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F08%2Fintriguing-animate-on-scroll-effect-jquery-tutorial%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2011/08/intriguing-animate-on-scroll-effect-jquery-tutorial/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>postcard from Paris &#8211; css3 keyframes animations in use</title>
		<link>http://pehaa.com/2011/08/postcard-from-paris-css3-keyframes-animations-in-use/</link>
		<comments>http://pehaa.com/2011/08/postcard-from-paris-css3-keyframes-animations-in-use/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 14:27:47 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2372</guid>
		<description><![CDATA[I decided to explore the area of css3 keyframes animations. We are going to create a sort of virtual postcard. Greetings from Paris !]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a class="twitter-share-button" href="http://twitter.com/share" data-count="horizontal" data-via="PeHaa">Tweet</a></p>
<p><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
<p>I decided to explore the area of css3 keyframes animations. The idea was simple &#8211;  to create a sort of virtual postcard. I live in Paris so obviously I send you my greetings from Paris :). <strong><a href="http://pehaa.com/wp-content/uploads/2011/08/demo/cartedeParis1.html" target="_blank">Click here or on the image to view the animation demo.</a></strong><br />
<a href="http://pehaa.com/wp-content/uploads/2011/08/demo/cartedeParis1.html" target="_blank"><img alt="Postcard from Paris css3 reframes animation preview " style="border: 15px solid #fff; -webkit-box-shadow: 0 0 20px #bababa; -moz-box-shadow: 0 0 20px #bababa; box-shadow: 0 0 20px #bababa; -webkit-border-radius:10px; -moz-border-radius:10px; border-radius: 10px; "src="http://pehaa.com/wp-content/uploads/2011/08/preview.jpg" title="Postcard from Paris preview " class="aligncenter" width="570" height="855" /></a></p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2011/08/PostcardFromParis.zip">Download  the source files</a></h3>
<p>(.psd file included)<br />Postcard from Paris<br />
<small>.zip 1.9MB</small></p>
</div>
<p>The css3 animations are supported by : Chrome 2+, Safari 4+, Firefox 5+, iOS Safari 3.2+ and<br />
Android 2.1+ (source <a href="http://coding.smashingmagazine.com/2011/05/17/an-introduction-to-css3-keyframe-animations/" target="_blank">Smashing Magazine</a>).<br />
We are going to animate 3 elements : the clouds (there are three layers of clouds), the rotating phare light and the Eiffel Tower sparkling. </p>
<p>The html structure is very simple :</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;title&gt;Greetings from Paris&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   &lt;div id=&quot;wrap&quot;&gt;
      &lt;h1&gt;Bonne Nuit &lt;em&gt;PARIS !&lt;/em&gt;&lt;/h1&gt;
      &lt;div id=&quot;phare&quot;&gt;&lt;/div&gt;
      &lt;div id=&quot;eiffel&quot;&gt;&lt;/div&gt;
      &lt;div id=&quot;eiffel_wrap&quot;&gt;
         &lt;div id=&quot;sparkling1&quot;&gt;&lt;/div&gt;
         &lt;div id=&quot;sparkling2&quot;&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div id=&quot;roofs&quot;&gt;&lt;/div&gt;
      &lt;footer&gt;by PeHaa, Paris 2011&lt;/footer&gt;
   &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>We will use the following images (I will discuss the sparkling effect a little bit later)<br />
<img alt="used images" src="http://pehaa.com/wp-content/uploads/2011/08/images.png" title="Used images" class="aligncenter" width="555" height="784" /><br />
Let&#8217;s start to complete the css stylesheet :<br />
<img alt="ccs part 1" src="http://pehaa.com/wp-content/uploads/2011/08/css1.png" title="ccs part 1" class="aligncenter" width="600" height="888" /></p>
<h2>Animating clouds</h2>
<p>To animate the three layers of clouds independently we use the following keyframes. (Notice that each time I use the <code>-webkit-</code> and <code>-moz-</code> prefixes).</p>
<pre class="brush: css; title: ; notranslate">
/* will be applied to #wrap that has 3 backgrounds layers */

	@-webkit-keyframes wind  {
	         0% {background-position: 0px 200px,0px 350px, left top;}
			50% {background-position:  500px 40px,600px 450px, left top;}
			100% {background-position: 1000px 200px,1200px 350px, left top}
	}

	@-moz-keyframes wind  {
	         0% {background-position: 0px 200px,0px 350px, left top;}
			50% {background-position:  500px 40px,600px 450px, left top;}
			100% {background-position: 1000px 200px,1200px 350px, left top}
	}

/* will be applied to #roofs that has 2 backgrounds layers */

	@-webkit-keyframes wind1 {
	         0% {background-position: 100px 250px, left bottom;}
			50% {background-position:  650px 150px, left bottom;}
			100% {background-position: 1300px 250px, left bottom}
	}

	@-moz-keyframes wind1 {
	         0% {background-position: 100px 250px, left bottom;}
			50% {background-position:  650px 150px, left bottom;}
			100% {background-position: 1300px 250px, left bottom}
	}
</pre>
<p>This way we have defined the property of <code>background-position</code> for the beginning, middle and end of our animation. Next we add :</p>
<pre class="brush: css; title: ; notranslate">
#wrap {-webkit-animation: wind 80s linear infinite;
       -moz-animation: wind 80s linear infinite;}
#roofs {-webkit-animation: wind 80s linear infinite;
       -moz-animation: wind 80s linear infinite; }
</pre>
<p>to associate the animations with the proper elements and to define the duration, timing-function and iteration count, respectively (I use the <a href="http://www.w3.org/TR/css3-animations/#the-animation-shorthand-property-" target="_blank">shorthand notation</a>). </p>
<h2>Animating phare light</h2>
<p>This time we are going to simultaneously animate the <code>opacity</code> and rotate the phare light with the rotation origin in its top center point  (as in the image above). </p>
<pre class="brush: css; title: ; notranslate">
	@-webkit-keyframes phare {
	         0% { -webkit-transform:rotate(0deg); opacity:0}
		50% { -webkit-transform:rotate(180deg); opacity:1}
	        100% { -webkit-transform:rotate(360deg); opacity:0;}
	}
        #phare {-webkit-transform-origin: center top;
	        -webkit-animation: phare 15s linear infinite;}
</pre>
<p>(here and further, repeat the same with <code>-moz-</code> prefixes).</p>
<h2>Adding sparkles</h2>
<p>We will use two different images with sparkling effect<br />
<img alt="Sparkling" src="http://pehaa.com/wp-content/uploads/2011/08/sparkling.png" title="Sparkling" class="aligncenter" width="601" height="516" /><br />
Below is the styling :</p>
<pre class="brush: css; title: ; notranslate">
#eiffel_wrap { position:absolute; width:240px;
              height:462px; right:10px; top: 180px; opacity:0;}
#sparkling1 { position:absolute; background: url('images/sparkling1.png') no-repeat;
              width:240px; height:462px; opacity:0;}
#sparkling2 { position:absolute; background: url('images/sparkling2.png') no-repeat;
              width:240px; height:462px;  opacity:0;}
</pre>
<p>We will animate the <code>#eiffel_wrap</code>, <code>#sparkling1</code> and <code>#sparkling2</code>.</p>
<pre class="brush: css; title: ; notranslate">
@-webkit-keyframes sparkling {
		0% {opacity:0;}
		50%{opacity:1;}
		100% {opacity:0;}
	}
</pre>
<p>The idea is to use the sparkling animation to turn out and in the <code>#sparkling1</code> and <code>#sparkling2</code> elements within the 0.4s cycle, with the first in/out when the second is out/in. To achieve that we will delay the sparkling animation of 0.2s on  <code>#sparkling1</code>.</p>
<pre class="brush: css; title: ; notranslate">&gt;
#sparkling1 {-webkit-animation: sparkling .4s .2s  infinite;}
#sparkling2 {-webkit-animation: sparkling .4s  infinite;}
</pre>
<p>In Paris this beautiful evening spectacle may be seen for several minutes every full hour. We will use the <code>#eiffel_wrap</code> element and <code>eiffel_wrap</code> animation to recreate this effect (not literarily though &#8211; I will not make you wait an hour long).</p>
<pre class="brush: css; title: ; notranslate">
#eiffel_wrap { -webkit-animation: eiffel_wrap 30s 1s  infinite;}
@-webkit-keyframes eiffel_wrap {
		    0% {opacity:1;-webkit-animation-timing-function: steps(1);}
			40%{opacity:0;}
			100% {opacity:0;}
			}
</pre>
<p>With <code>-webkit-animation-timing-function: steps(1);</code> the transition is instantaneous with no fading out effect.</p>
<p>And here we are.<br />
I hope you found this tutorial useful and got inspired. Please share and bookmark if you like it.<br />
As always I&#8217;m looking forward to your comments and&hellip; see you in Paris !</p>
<div class="shr-publisher-2372"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F08%2Fpostcard-from-paris-css3-keyframes-animations-in-use%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F08%2Fpostcard-from-paris-css3-keyframes-animations-in-use%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2011/08/postcard-from-paris-css3-keyframes-animations-in-use/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>create a unique contact form with css3 transitions</title>
		<link>http://pehaa.com/2011/07/create-a-unique-contact-form-with-css3-transitions/</link>
		<comments>http://pehaa.com/2011/07/create-a-unique-contact-form-with-css3-transitions/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 22:52:47 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2243</guid>
		<description><![CDATA[Inspired by the contact form on <a href="http://clearspanmedia.com/" target="_blank"> Clear Span Media website</a> I decided to recreate an effect of a letter sliding out from an envelope on mouse hover.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Inspired by the contact form on <a href="http://clearspanmedia.com/" target="_blank"> Clear Span Media website</a> I decided to recreate an effect of a letter sliding out from an envelope on  mouse hover. You may see the <a href="http://pehaa.com/wp-content/uploads/2011/07/contactform/contactform.html" target="_blank">demo here.</a><br />
<img class="aligncenter" title="contact scheme " src="http://pehaa.com/wp-content/uploads/2011/07/preview.jpg" alt="contact form preview" /></p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2011/07/contactform.zip">Download  the source files</a></h3>
<p>Contact form<br />
<small>.zip 330 kB</small></p>
</div>
<p> It works in browsers supporting css3 transitions. In IE the envelope is not visible, I certainly could have played a bit more with jQuery to reproduce a similar effect, but it&#8217;s not a part of this tutorial.<br />
Let&#8217;s start with the html structure:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;title&gt;Contact Form&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;wrap&quot;&gt;
		&lt;h1&gt;Send a message&lt;/h1&gt;
		&lt;div id='form_wrap'&gt;
			&lt;form&gt;
				&lt;p&gt;Hello Joe,&lt;/p&gt;
				&lt;label for=&quot;email&quot;&gt;Your Message : &lt;/label&gt;
				&lt;textarea  name=&quot;message&quot; value=&quot;Your Message&quot; id=&quot;message&quot; &gt;&lt;/textarea&gt;
				&lt;p&gt;Best,&lt;/p&gt;
				&lt;label for=&quot;name&quot;&gt;Name: &lt;/label&gt;
				&lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;&quot; id=&quot;name&quot; /&gt;
				&lt;label for=&quot;email&quot;&gt;Email: &lt;/label&gt;
				&lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;&quot; id=&quot;email&quot; /&gt;
				&lt;input type=&quot;submit&quot; name =&quot;submit&quot; value=&quot;Now, I send, thanks!&quot; /&gt;
			&lt;/form&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The idea is as follows (I tried to illustrate it in the scheme below): the  <code>#form_wrap</code> is positioned relatively (top:0), with the envelope fixed to its bottom. The <code>form</code> is positioned relatively, with top:200px. The overlay is set to hidden for both  <code>form</code> and <code>#form_wrap</code>. When mouse enters the <code>#form_wrap</code> its height and the height of <code>form</code> increase both of 350px, at the same time the top property of the <code>#form_wrap</code> changes to top:-200px.<br />
<img class="aligncenter" title="contact scheme " src="http://pehaa.com/wp-content/uploads/2011/07/contact_scheme.png" alt="contact scheme" /><br />
We will need an envelope  cut into two parts, the top part, visible over the letter (after.png) and the bottom part (before.png) partially covered by the letter. You&#8217;re welcome to use the .ai file <a href="http://pehaa.com/2011/07/free-vector-envelopes/">available here</a>.<br />
<img class="aligncenter" title="contact scheme " src="http://pehaa.com/wp-content/uploads/2011/07/tuto_envelopes.jpg" alt="envelopes" width="600" height="463" /> Let&#8217;s start to complete the stylesheet:<br />
<img class="aligncenter" title="contact scheme " src="http://pehaa.com/wp-content/uploads/2011/07/css1.png" alt="contact scheme" width="600" height="1005" />Next, we&#8217;ll add some styling to the <code>form</code> elements:</p>
<pre class="brush: css; title: ; notranslate">
label {
			margin: 11px 20px 0 0;
 			font-size: 16px; color: #b3aba1;
			text-transform: uppercase;
			text-shadow: 0px 1px 0px #fff;
		}

input[type=text], textarea {
		font: 14px normal normal uppercase helvetica, arial, sans-serif;
		color: #7c7873;background:none;
		width: 380px; height: 36px; padding: 0px 10px; margin: 0 0 10px 0;
		border:1px solid #f8f5f1;
		-moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;
		-moz-box-shadow: inset 0px 0px 1px #726959;
                -webkit-box-shadow:  inset 0px 0px 1px #b3a895;
                box-shadow:  inset 0px 0px 1px #b3a895;
		}	

textarea { height: 80px; padding-top:14px;}

textarea:focus, input[type=text]:focus {background:rgba(255,255,255,.35);}

#form_wrap input[type=submit] {
		position:relative;font-family: 'YanoneKaffeesatzRegular';
		font-size:24px; color: #7c7873;text-shadow:0 1px 0 #fff;
		width:100%; text-align:center; opacity:0;
		background:none;
		cursor: pointer;
		-moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;
		}

#form_wrap:hover input[type=submit] {z-index:1;opacity:1;}

#form_wrap:hover input:hover[type=submit] {color:#435c70;}
</pre>
<p>So far we haven&#8217;t used the transition,  <a href="http://pehaa.com/wp-content/uploads/2011/07/contactform/contactform0.html" target="_blank">click here</a> to see where we are.</p>
<p>We will add the same transition to <code>form</code> and <code>#form_wrap</code>. The four parameters correspond to the transition property, duration, timing function and its delay.</p>
<pre class="brush: css; title: ; notranslate">
  -webkit-transition: all 1s ease-in-out .3s;
  -moz-transition: all 1s ease-in-out .3s;
  -o-transition: all 1s ease-in-out .3s;
  transition: all 1s ease-in-out .3s;
</pre>
<p>Then we&#8217;ll add another transition to the <code>input[type=submit]</code> element. The first set of settings corresponds to the behavior when mouse leaves the <code>#form_wrap</code>, the second when it hovers the <code>#form_wrap</code>. I wanted to make sure that the submit element does not appear until the form and #form_wrap transition is finished. On the other hand it starts to disappear immediately when mouse leaves #form_wrap.</p>
<pre class="brush: css; title: ; notranslate">

	#form_wrap input[type=submit] {
		-webkit-transition: opacity 0.6s ease-in-out 0s;
		-moz-transition: opacity .6s ease-in-out 0s;
		-o-transition: opacity .6s ease-in-out 0s;
		transition: opacity .6s ease-in-out 0s;
		}

	#form_wrap:hover input[type=submit] {
		-webkit-transition: opacity .5s ease-in-out 1.3s;
		-moz-transition: opacity .5s ease-in-out 1.3s;
		-o-transition: opacity .5s ease-in-out 1.3s;
                transition: opacity .5s ease-in-out 1.3s;
		}
</pre>
<p>It&#8217;s almost ready, I will just add some jQuery so as it works in IE. The transition is similar, but not exactly the same:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--[if IE]&gt;&lt;script&gt;
	$(document).ready(function() {
            $(&quot;#form_wrap&quot;).addClass('hide');
            $(&quot;#form_wrap&quot;).prepend( '&lt;div id=&quot;before&quot;&gt;&lt;/div&gt;').append( '&lt;div id=&quot;after&quot;&lt;/div&gt;');
            $(&quot;#form_wrap&quot;).hover(function(){
	         $(this).stop(true, false).animate({
	              height : '836px',
	              top : '-200px'
	         }, 2000);
            $('form').stop(true, false).animate({
		height : '580px'
		}, 2000, function(){
                         $('#form_wrap input[type=submit]').css({'z-index' : '1', 'opacity' : '1'})} ) }, function() {
		$('#form_wrap input[type=submit]').stop(true, true).css({ 'opacity' : '0'})
	        $(this).stop(true, false).animate({
			height : '446px',
			top : '0px'

		}, 2000);
		$('form').stop(true, false).animate({
				height : '200px'}, 2000)
		})
})
&lt;/script&gt;&lt;![endif]--&gt;
</pre>
<p>You just need to add in the stylesheet <code> #form_wrap.hide:after, #form_wrap.hide:before {display:none;}</code>  and </p>
<pre class="brush: css; title: ; notranslate">
#before {position:absolute;
		  bottom:128px;left:0px;
		  background:url('images/before.png');
		  width:530px;height: 316px;}

#after {position:absolute;
		bottom:0px;left:0;
		background:url('images/after.png');
		width:530px;height: 260px; }
</pre>
<p>Looking forward to your comments, if you find this tutorial useful, please share and bookmark. </p>
<div class="shr-publisher-2243"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F07%2Fcreate-a-unique-contact-form-with-css3-transitions%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F07%2Fcreate-a-unique-contact-form-with-css3-transitions%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2011/07/create-a-unique-contact-form-with-css3-transitions/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>free vector envelopes</title>
		<link>http://pehaa.com/2011/07/free-vector-envelopes/</link>
		<comments>http://pehaa.com/2011/07/free-vector-envelopes/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 17:07:34 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[stationary]]></category>
		<category><![CDATA[vector]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=2234</guid>
		<description><![CDATA[This time I share with you a set of vector envelopes created in Illustrator. Don&#8217;t hesitate to change the colors as you like. Easiest way: go to Edit > Edit Colors > Recolor artwork. Click on the little preset icon and choose preserve Black, White and Grays. Then use Edit or Assign and play with [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><img alt="free vector envelopes by pehaa 1" src="http://pehaa.com/wp-content/uploads/2011/07/envelopes.jpg" title="ice cream pattern " class="aligncenter" width="600" height="600" /></p>
<p>This time I share with you a set of vector envelopes created in Illustrator. Don&#8217;t hesitate to change the colors as you like. Easiest way: go to Edit > Edit Colors > Recolor artwork. Click on the little preset icon and choose preserve Black, White and Grays. Then use Edit or Assign and play with the colors. </p>
<p>These are free for both your personal and commercial projects. My suggestion &#8211; you might use them to create an original contact form (stay in touch, I&#8217;ll show you my idea about that very soon).</p>
<p><a href="http://pehaa.com/wp-content/uploads/2011/07/envelopes.ai.zip">
<div class="download">
<h3>Vector envelopes &#8211; CS2+ .ai file </h3>
<p><small>4 x 2 in set, pat.zip, 11.5 MB.<br />
All made by me. Free for both personal and commercial use. If you host them, please link this site. </small></p>
</div>
<p></a></p>
<p>Please share and bookmark, your comments are more than welcome. Enjoy!</p>
<div class="shr-publisher-2234"></div><!-- Start Shareaholic LikeButtonSetBottom --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F07%2Ffree-vector-envelopes%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2011%2F07%2Ffree-vector-envelopes%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://pehaa.com/2011/07/free-vector-envelopes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
