<?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; Photoshop tip trick</title>
	<atom:link href="http://pehaa.com/tag/photoshop-tip-trick/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>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>free photoshop and illustrator patterns</title>
		<link>http://pehaa.com/2009/02/free-photoshop-and-illustrator-patterns/</link>
		<comments>http://pehaa.com/2009/02/free-photoshop-and-illustrator-patterns/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 14:29:52 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[Photoshop tip trick]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=204</guid>
		<description><![CDATA[I played a bit with the flowers I used on my kokeshi dolls' kimonos. I added some spiral stems and stroked them with one of the built-in calligraphic brush (we are in Illustrator now). As a result: two sets of patterns for <a href='http://pehaa.com/wp-content/uploads/2009/02/paper_flowers_patternspat.zip'>Photoshop (a zipped.pat file)</a> and <a href='http://pehaa.com/wp-content/uploads/2009/02/paper_flower_patternsai.zip'>Illustrator (swatches library in a zipped .ai file)</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I played a bit with the flowers I used on <a href="http://pehaa.com/2009/02/free-vector-kokeshi-dolls/">my kokeshi dolls&#8217; kimonos</a>. I added some spiral stems and stroked them with one of the built-in calligraphic brush (we are in Illustrator now). As a result: two sets of patterns for <a href='http://pehaa.com/wp-content/uploads/2009/02/paper_flowers_patternspat.zip'>Photoshop (a zipped.pat file)</a> and <a href='http://pehaa.com/wp-content/uploads/2009/02/paper_flower_patternsai.zip'>Illustrator (swatches library in a zipped .ai file)</a>. I hope you  find them nice and/or useful. If so feel free to download (as always both for personal and commercial use).<br />
<img src="http://pehaa.com/wp-content/uploads/2009/02/flower_patterns.png" alt="flower_patterns" title="flower_patterns" width="487" height="385" class="aligncenter size-full wp-image-202" /></p>
<p><a name="patterns_install">How to install/load in patterns:</a></p>
<ul>
<li><strong>PS:</strong> Put the .pat file you&#8217;ve downloaded into the folder /Users/{username}/Library/Application Support/Adobe/Adobe Photoshop CS&#8230;/Presets/Patterns (on mac OS X) or C:\Program Files\Adobe\Photoshop\Presets\ (on Windows)  (the dots &#8230; are there since I don&#8217;t know your PS version).</li>
<li><strong>AI</strong>: either open the .ai file (my pattern swatches will be automatically loaded) or go to Swatches&gt;Other Library and  choose the path to the .ai file.</li>
</ul>
<p>Let me know what you think.</p>
<div class="download">
<h3><a href="http://pehaa.com/wp-content/uploads/2009/03/paper_flower_patternscs2ai.zip">Freebies by PeHaa: CS2+ Ai pattern swatches</a></h3>
<p><small>Paper Flowers patterns swatches.<br />
All made by me. Free for both personal and commercial use. If you host them, please link this site. </small></div>
<div class="shr-publisher-204"></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%2F2009%2F02%2Ffree-photoshop-and-illustrator-patterns%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2009%2F02%2Ffree-photoshop-and-illustrator-patterns%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/2009/02/free-photoshop-and-illustrator-patterns/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>photoshop: paste a layer into a mask</title>
		<link>http://pehaa.com/2009/02/photoshop-paste-a-layer-to-a-mask/</link>
		<comments>http://pehaa.com/2009/02/photoshop-paste-a-layer-to-a-mask/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 20:24:45 +0000</pubDate>
		<dc:creator>PeHaa</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Photoshop tip trick]]></category>

		<guid isPermaLink="false">http://pehaa.com/?p=54</guid>
		<description><![CDATA[It has not been the most productive day (so far at least). Still, I learned one thing I want to post about. Few times I wanted to do that and had no idea how to. Paste a layer(A) into a layer(B) mask. In 4 easy steps: 1. select the layer A and copy it to [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>It has not been the most productive day (so far at least). Still, I learned one thing I want to post about. Few times I wanted to do that and had no idea how to.</p>
<p><strong>Paste a layer(A) into a layer(B) mask.</strong> In 4 easy steps:</p>
<p>1. select the layer A and copy it to clipboard (Cmd/Ctrl+a, Cmd/Ctrl+c)</p>
<p>2. go to the layer B, make it active and click the Layer Mask</p>
<p>3. go to your Channels Panel, there is your mask in the bottom, set it active and visible, paste the clipboard content (Cmd/Ctrl+v) </p>
<p>4. make the mask channel invisible again and the RGB channel (top) active</p>
<p>And it&#8217;s done!</p>
<p>I played a bit with halftones today (Filter &gt; Pixelate). I followed the Photoshop Guys&#8217; and applied it in grayscale (all 4 channels parameters equal). I&#8217;m not too happy with what I got, but a post needs an image.<a href="http://pehaa.com/wp-content/uploads/2009/02/halftones.jpg"><img class="aligncenter size-full wp-image-53" title="halftones" src="http://pehaa.com/wp-content/uploads/2009/02/halftones.jpg" alt="halftones" width="450" height="478" /></a></p>
<div class="shr-publisher-54"></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%2F2009%2F02%2Fphotoshop-paste-a-layer-to-a-mask%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fpehaa.com%2F2009%2F02%2Fphotoshop-paste-a-layer-to-a-mask%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/2009/02/photoshop-paste-a-layer-to-a-mask/feed/</wfw:commentRss>
		<slash:comments>17</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! -->
