Showing posts with label effect. Show all posts
Showing posts with label effect. Show all posts

Dec 19, 2011

How To Show Latest Tweets Using PHP JQuery

Today I am sharing my newly PHP and JQuery coded snippet which is going to display your latest tweets in a fade in and fade out effect using Twitter timeline RSS feeds.



Here is the PHP function to get the tweets:

 
[php]
<?php
function latest_tweets(){
//global $post;
$doc = new DOMDocument();
$meta='webstutorial';
$feed = "http://twitter.com/statuses/user_timeline/$meta.rss";
$doc->load($feed);

$outer = '<ul id="tweets">';
$max_tweets = 15;
$i = 1;
foreach ($doc->getElementsByTagName('item') as $node) {
$tweet = $node->getElementsByTagName('title')->item(0)->nodeValue;
//if you want to remove the userid before the tweets then uncomment the next line.
//$tweet = substr($tweet, stripos($tweet, ':') + 1);
$tweet = preg_replace('@(https?://([-w.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?)@',
'<a href="$1">$1</a>', $tweet);
$tweet = preg_replace("/@([0-9a-zA-Z]+)/",
"<a href="http://twitter.com/$1">@$1</a>",
$tweet);

$outer .= "<li>". $tweet . "</li>n";


if($i++ >= $max_tweets) break;
}
$outer .= "</ul>n";
return "<div class='post'><p><b>Latest Tweets </b>".$outer."</div>";
}
echo latest_tweets();
?>
[/php]
 

In the above function we are fetching the RSS feed from the twitter timeline. Then we finally break it into segments and display it using the loop method.

Now we have to display the tweets with jquery effect.

So here is the jquery function to display the tweets in a fadeIn effect.

 
[js]
<script type="text/javascript">
function tweetRender( prospectID )
{
prospectID.delay() .fadeIn() .delay(2000).fadeOut(
function(){
if(prospectID.next().length > 0)
{tweetRender( prospectID.next() );}
else
{tweetRender( prospectID.siblings(':first'));}

}
);
}

$(function(){
$('#tweets li').hide();
tweetRender( $('#tweets li:first') );

});
</script>
[/js]
 

In this tutorial we are using basic PHP and JQuery to display the tweets. You can download it and check the Demo.

Dec 14, 2011

Photoshop CS5 Menu for Websites

This tutorial helps you to make or design a horizontal navigation bar with your desired color combinations. In this tutorial I have used the color combination Blue background with Gray buttons as it provides a decent and good gradient effect to observe.

 Our Tutorials Begins From Here:

This is a preview of the result that we are going to get after completing the tutorial.

Result Preview

Step 1: At first we are going to create a new document and fill some colors in it.

  • Open Photoshop go to ‘File’ click ‘New’ add your desired name and size like I choose a size of 600 by 250 pixels.

  • After creating the document fill the background color with your desired color (which I have choose blue).

  • To fill the desired color, go to Edit > Fill > Use (or just press Shift+F5). Select a color from the use tab as I choose “Blue” and click it in the background area.


You would get result like this,

Result of Step 1 Result

Step 2: Now we are going to make the background for the navigation bar inside which the buttons or tabs are placed.

  • To create a new layer, go to Layer > New > Layer (or press Ctrl+ Shift+ N).

  • Select the layer and select the Rounded Rectangle Tool (or press U twice).

  • Adjust the size of the rectangle by selecting the “Fixed Size” from the Geometric Options’ button in the Rectangle Panel appeared under Menu Panel.

  • Select the size you desire, like I choose 500 by 60 pixels.

  • You can adjust the radius of the corners too in the same panel.

  • After setting the sizes click at the desired area you want to draw the navigation bar.


You would get result like this,

  • Result of Step 2Select the navigation layer from the layers list and click on the button at the bottom which has a circle in a rectangular box showing “Add Mask Layer”.


This will divide the layer into mask objects so that you can fill a particular color into the navigation bar only without tempering the background layer.

  • Fill the navigation bar with a single color or add a gradient effect using linear effect with multiple colors.

  • Rasterizing the layer of the navigation layer you would get the single form layer to add other layer options to it.


After completing the above step you would get a result like this,

Result of Step 2 (Part 2)

Step 3: Now we are going to add some layer styles to the navigation bar on its background.

  • To open layer styles go to Layer > Layer Style (or select the layer, right click on it and select “Blending Options” in it) and select Outer Glow from it.

  • Make glowing changes accordingly to your desired design (or just follow the given below picture details).

  • To add some more layers select any options and add your desired changes to the navigation bar.


Result of Step 3

Result of Step 3 (Part 2)

Step 4: Now we are going to make buttons in the navigation bar.

  • Create a new layer by following Step 2.

  • Select the rounded rectangle tool and set your desired size like 150 by 50 pixels and draw maximum no. of buttons which can be drawn.

  • Use the ‘Add Mask Layer’ and select the first layer add you’re desired layer option from the list in blending options.

  • You can add changes in color and change gradient effects by clicking the gradient tab in the “Gradient Overlay” tool and get the below result.


Result of Step 4You will get the result as,

Result of Step 4 (Part 2)

Step 5: Now we are going to add text to the buttons.

  • To add text to the buttons create a new document for every new button, it helps in adjusting the position of the text in the button later.

  • Select the desired font, size and style from the text bar under the Menu bar.

  • Select the color from the color window on the right side of the desktop.

  • Write your text in the button like “Home” and then adjust the position of the text using ‘Move’ tool.


Your result should look similar to this,

Result of Step 5

Step 6: Now in the last we are going to highlight the button to shown it is in selection or the mouse is on it.

  • Select any button to highlight it, so that we a mouse comes on it or when it is in selection then the color of the button change to shown it is distinguished from other.

  • Select the color from the color window for the button and fill the color in the button with the Fill (or Paint Bucket) tool.

  • Add some outer glow from the Blending option form Step 3 and center the glow on the highlighted button. You can use the following setting in the picture,


Result of Step 6After applying the above changes your final result should look like this,

This is the final result you would get after completing this tutorial.

Aug 6, 2011

How To Create A Fog Effect In Photoshop | Photoshop Fog Effect

The Fog Effect

Learn how to use Photoshop to add a cool fog effect to any photo. This tutorial will teach you just how to use several layers to create a realistic fog effect that appears thicker in the distance.

[caption id="attachment_480" align="alignnone" width="450" caption="Original Picture"][/caption]

[caption id="attachment_481" align="alignnone" width="450" caption="After"][/caption]

FIRST STEP:

Open a photo that you would like to add a fog effect to into Photoshop.



SECOND STEP:

In the Layers pallet, click on the New Adjustment Layer icon and select Solid Color. A window should appear where you can select a color. Select white as the color as click OK.





THIRD STEP:

A new layer called Color Fill 1</em> should appear. Reduce the opacity of this layer to 50%.



FOURTH STEP:

Select the Gradient tool from the toolbar. If you cannot find it, look for the Paint Bucket tool, click and hold on it, and a menu should appear where you can select the Gradient tool. Once you have the Gradient tool selected, the option bar should change to allow you to set the settings of the tool. Apply these settings:

Gradient: White to Black
Gradient Type: Linear
Mode: Normal
Opacity: 100%



FIFTH STEP:

Before we add a gradient, make sure that you have the layer mask selected. To do this, simply click on the thumbnail of the layer mask in the Layers pallet. Once the layer mask is selected, click on the horizon of your photo, press and hold the shift key, and drag a straight line to the bottom. By holding the shift key, the line that you draw will remain straight. The shift key also works for other Photoshop tools such as the Move Tool or Transform tool.



SIXTH STEP:

Press Ctrl+J or open the Layer menu and select Duplicate Layer to create a duplicate of the layer.



SEVENTH STEP:

Select the Eraser tool from the toolbar. The 'Eraser' settings should appear on the option bar where you can adjust the settings of the tool. Use a large brush size with a soft edge such as the one set in the image below.



EIGHT STEP:

First, make sure that you have the layer mask of the top layer selected. Erase the foreground area so that the fog appears stronger in the distance.





NINTH STEP:

Create a duplicate of the top layer by pressing Ctrl+J or opening the Layer menu and selecting Duplicate Layer. Change the opacity of this layer to 75%.



TENTH STEP:

Again, make sure that you have the layer mask of the top layer selected. Erase the foreground and background area so that the distance looks thick with fog.





ELEVENTH STEP:

In the Layers Pallet, click on the New Adjustment Layer icon and select Levels.



TWELFTH STEP:

The Levels tool should appear. This tool will let us adjust the thickness of the fog. To do this, drag the middle input slider towards the right to decrease the fog or towards the left to increase the fog. Click OK when you're done.





AND THAT'S A WRAP !! If You Like, You Can Also Use The Following Steps For Other Pictures Tooo ...

Aug 3, 2011

How To Add A Little Sunlight Effect To A Picture-Photoshop | Photoshop Add Sunlight Effect To An Image

In this tutorial I will be showing you how to turn a rainy day into a stunning dramatic scene with sunlight falling through the clouds. The best part of this technique is that the beams are created from the actual imagery so they look very realistic. Lets get started...

Before:
This is the Picture we'll be using


before / original image


After:
And this is what we are creating


after pic



FIRST STEP:

Duplicate the Background photo layer by dragging it to the New Layer Icon at the bottom of the layers palette. Name it 'Light Beam Base'.

With that layer selected hit CMD + M (or CTRL+M on PC) to apply a curve to it. Apply a harsh curve to it so that we have maximum contrast in the clouds with small areas that go completely white. I'm focusing on the area on the top third of the frame slightly to the left. These white areas are going to be where our beams of light come out of the clouds.



Now apply a 2 pixel gaussian blur to that layer ( Filter > Blur > Gaussian Blur ).




SECOND STEP:

Turn off the Light Beam Base layer and select the Background layer. Select the Polygonal Lasso tool (L). Set the Feather to 50 in the Properties bar at the top of the screen.



Draw a loose selection around the area of the sky where the beams will come from by clicking various points. Here is the selection I made as viewed in Quick Mask mode:



Make a new Curves Adjustment Layer just above the Background layer. The selection is automatically applied as a layer mask. Apply a similar curve to the one we did before, but this time we want to limit it so the shadow areas are not affected. Name the layer 'Light Source'.








THIRD STEP:

Turn on and select the 'Light Beam Base' layer. In the toolbar select the Single Row Marquee tool. Zoom in on one of the white areas of the clouds and click once in the middle of it. This selects a single row of pixels across the image.



Zoom out so you can see the whole image. Select the regular Marquee tool. While holding alt/option drag from the left of the image right up to the left side of the white area to deselect those pixels. Do the same on the right side. You shoud end up with a selection of a single row of pixels just across the white area like so:



With the 'Light Beam Base' layer selected hit CMD + J. This throws your selected pixels on a new layer. Name that layer 'Beam 1'.




FOURTH STEP:

Turn off the 'Light Beam Base' layer. Select the 'Beam 1' layer. Hit CMD+T to Free Transform the layer. Grab the bottom center handle and stretch is all the way down to about where the boat sits. Now while holding CMD drag the same handle to the right so it sits just under the boat. Now while holding CMD+SHIFT drag the bottom left and right handles outward until you get a shape that you like.



Note that the Free Transform preview might look a little wierd because Photoshop is dealing with a single row of pixels. This technique is called 'Pixel Stretching'. When you apply the transform it will look right.




FIFTH STEP:

Set the 'Beam 1' layer's blending mode to Screen on the layer palette.

Hit CMD+M to apply a curve to the layer. Darken the layer way down until the beams of light start to show up.



Add a layer mask by clicking on the Add Layer Mask button at the bottom of the layer palette. Select the mask by clicking on it in the layer palette then hit CMD+M to apply a curve to it. Bring the highlight point down to 50%. Hit OK.



Select the Polygonal Lasso tool (L) and set the Feather to 15 this time. Select the center of the beam all the way through. Here is what my selection looked like as a quickmask.



Select the 'Beam 1' mask and hit CMD+M to apply a curve. This time bring the shadow point up to 50%. This will make the center of the beam brighter than the edges.




SIXTH STEP:

With the mask still selected, hit G for the Gradient tool. Click on the gradient preview in the top left of the screen and set it to the black to white gradient if it isnt already set. Set the gradient mode to Multiply on the Properties Bar.

Drag from the top of the beam to the bottom. Before you click anything else go to Edit > Fade Gradient. Fade it down to about 50%. This creates a falloff on the beam but we use the Fade function so it doesn't completely disappear at the bottom.




SEVENTH STEP:

Select the Background layer. Select the Eliptical Marquee tool. Click and drag directly on the boat, while holding down the mouse button hold ALT and make a narrow ellipse at the base of the beam.

Hit Q to enter Quick Mask mode. Go Filter > Blur > Gaussian Blur and use 5 as the radius. Go Filter > Blur > Motion Blur and make the angle 0 and the distance 150. Hit Q to exit Quick Mask.



Make a curves adjustment layer just above the Background layer. Lighten up the water a bit until it looks like the beam is hitting the water.






EIGHT STEP:

I just want to add a little contrast to the image as a whole. To do that, put a curve at the top of the layers palette and just add some contrast.



Repeat steps 3 through 7 as many times as you would like using other white spots in the clouds but be sure to mind the angles at which the beams come down. They should look like they all come from the same light source.