Saturday 29 June 2013

Responsive web design using CSS3 Media Queries

Portrait Tablet
@media (min-width: 481px) and (max-width: 768px){}



Landscape smart phone
@media (min-width: 321px) and (max-width: 480px){}


Portrait smart phone
@media (max-width: 320px){}

Friday 28 June 2013

Create An Apple Style Menu In CSS3 – Without Images

First, we’re just going to start off by creating a simple horizontal list with links that have padding and text effects. Also make sure to add the class active to our index link.
HTML

CSS
body {
background: #ddd;
margin: 30px;v
}
#menu {
float: left;
padding: 0;
margin: 0;
}
#menu ul {
padding: 0;
margin: 0;
float: left;
}
#menu li {
float: left;
list-style: none;
background: none;
}
#menu a { outline: none; }
#menu li a:link, #menu li a:visited {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
display: block;
color: #262626;
text-decoration: none;
text-transform: capitalize;
padding: 12px 28px;
}

In the next step, we’re going to add our gradient effect to our links and also add a text shadow for an embedded look.
To do this, we use the following code to encompass Firefox, Safari and what ever other browser that supports css3.
#menu li a:link, #menu li a:visited {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
display: block;
color: #262626;
padding: 12px 28px;
text-decoration: none;
text-transform: capitalize;
/* CSS3 Text Shadow */
text-shadow: 0px 1px 1px #fff;
/* CSS3 Background Gradient */
background-image: -moz-linear-gradient(top, #cacaca, #848484);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cacaca), to(#848484));
}

Now we’re going to add another new CSS3 attribute called border radius which rounds out the corners of our links on each end of the side. We do this by also using the first-child and last-child.
#menu li:first-child a {
/* Rounded Corners */
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
}
#menu li:last-child a {
/* Rounded Corners */
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
}
We’ll now add some final touches to our first part of the menu, some more shadowing and horizontal border gradients.
On the menu div, we’re going to add a box shadow and round out the corners so it matches our links.
#menu {
float: left;
padding: 0;
margin: 0;
/* Box Shadow */
box-shadow: 0 1px 0 #000;
-moz-box-shadow: 0 1px 0 #000;
-webkit-box-shadow: 0 1px 0 #000;
/* Rounded Corners */
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
/* Rounded Corners */
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
}
Now we’re going to add a 1px margin to the right of our li to create a space so the background of our ul will show through.
#menu li { float: left;
list-style: none;
background: none;
margin-right: 1px;
}
Now add the gradient to the ul background.
#menu ul {
border-top: #f3f3f3 1px solid;
padding: 0;
margin: 0;
float: left;
/* Background Gradient */
background-image: -moz-linear-gradient(top, #b4b4b4, #707070);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#b4b4b4), to(#707070));
}

Now we’ve got to add our hover event and our active state. Pretty simple, same code just different selector.
#menu li a:hover {
cursor: pointer;
color: #fff;
text-shadow: 0px -1px 1px #000;
/* Background Gradient */
background-image: -moz-linear-gradient(top, #929292, #545454);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#929292), to(#545454));
}

And for the active state..

a.active:link, a.active:active, a.active:visited {
color: #fff !important;
text-shadow: 0px -1px 1px #000!important;
background-image: -moz-linear-gradient(top, #444, #666)!important;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#444), to(#666))!important;
/* Box Shadow */
box-shadow: inset 0 0 10px #000;
-moz-box-shadow: inset 0 0 10px #000;
-webkit-box-shadow: inset 0 0 10px #000;
}
Note for the active state to work, for each page you have the menu you on say contact.html you need to attach the class active to the proper link in the menu bar.

Final Code



Final Result


Create a Gold Text Effect in Photoshop

First prepare your assets. Install the Pieces of Eight font onto your computer and open both . Finally open the "background-img.jpg" which is 600×400 px and will be your workspace.

Now we can start making our first text effect.Type your text somewhere in the center of the image. You can write any word, but in this tutorial I’ll use "all tutorial-zone".
We are ready to start with our text style. Go to Menu > Layer > Layer Style > Blending Options and use the settings below. You can also access Blending Options with two faster ways. First and the fastest way is to double click on the layer in your layers menu. Other way is to right click on the layer in your layers menu and choose Blending Options. When you are done with all the settings below, don’t forget to hit "OK" in the Blending Options window! This text layer will add the main gold text effects into the final result.













Now duplicate our "all tutorial-zone" text layer so the duplicated layer will be above the original one. First we clear the previous style on this duplicated layer by going to Menu > Layer > Layer Style > Clear Layer Style then we start a new one by going to Menu > Layer > Layer Style > Blending Options and using the settings below on our text. You can also use the quicker methods to access Blending Options from "Step 3" of this tutorial. When you are done with all the settings below, don’t forget to hit "OK" in the Blending Options window! This text layer will add the depth into the final result.
If you are happy with this result, you can be done with this tutorial, but in next steps I will add more flare to the final effect.









Now we will create lighting dots. We start with one and will duplicate as many as we will need. So for now, you can hide both text layers to have clear work space. Choose the "Ellipse Tool" and draw 4 circles around the same diameter, color and layer arrangement as on the picture below. You should also rename the layers to Circle 1, Circle 2, etc., as I will use it names in next steps.

When you are done creating the circles, use vertical and horizontal centers alignment.

Next step is to add “Gaussian Blur” to circles 1,2 and 3. Select the “Circle 1″ layer and go MENU > Filter > Blur > Gaussian Blur and use the Radius settings from the picture below. Repeat it for Circle 2 and 3, but with different Radius setting.

When you are done with blur, we will be doing some layer settings. Use the same layer settings as on the picture below.

Final step in creating lighting dot is to group all 4 circle layers and set the Opacity of the Circles folder to 60%.

This is the fun part of this tutorial. Make both text layers visible again and move the lighting dot on the edge of the text. Duplicate the whole "Circles" folder for more dots and spread it through the whole text. On the picture below you can see the positions I used in this tutorial, but it is up to you where you want it to have them. You can see on my example that there are places which shine more then others. It is simply made by multiplying two "Circle" folders.
Final Image...


Tuesday 25 June 2013

How to use Custom Web Safe Fonts From Google

Adding a custom font is easy: just add a special stylesheet link to your web page, then use the font in a CSS style. All fonts are open source high quality type faces that are cross browser accessible.
Link Stylesheet
Here you have to link the stylesheet which links to Google’s fonts on your HTML document.


Adding a Style :
You need to define a selector with the font to activate it.
body {
font-family: 'Font Name', serif;
}

Below is how they linked the stylesheet, defined the font in body, and wrote something inside the body using an h1 style.

Create a Lens Flare Effect in Photoshop

www.alltutorial-zone.com

Lens Flare Effect :

The lens flare filter can be really useful, but I used to be unaware of how to apply it non-destructively. I used to flatten my image, copy this flattened image as a new top layer, and then apply a lens flare effect.

However, in my opinion the most effective way to apply a lens flare non-destructively is by creating a new top layer, filled with black. Then simply change this layer’s blend mode to ‘screen’ to hide the black, and apply your lens flare as you normally would:



The image below shows your ‘lens flare’ layer at ‘normal’ blend mode:


The image below shows the ‘lens flare’ layer at ‘screen’ blend mode, hiding the black background, but letting the lens flare show through:



Photoshop Tool's Basics idea

I decided to start at the beginning. The very beginning. For those people who just “picked up” a copy of Photoshop and have no idea what to do with it. The keyboard shortcut is in ( ).

Rectangular Marquee Tool (M)
Use this tool to make selections on your image, in a rectangular shape. This changes the area of your image that is affected by other tools or actions to be within the defined shape. Holding the [Shift] key while dragging your selection, restricts the shape to a perfect square. Holding the [Alt] key while dragging sets the center of the rectangle to where your cursor started.

Move Tool (V)
Use this tool to, well, move things. Usually you use it to move a Layer around after it has been placed. Hold the [Shift] key to limit the movements to vertical/horizontal.

Polygon Lasso Tool (L)
Ok, this should be the Lasso Tool, but I use the Polygon Lasso a lot more often. Use this to draw selections in whatever shape you would like. To close the selection, either click on the beginning point (you’ll see the cursor change when you’re on it), or just double-click. When holding the [Ctrl] key, you’ll see the cursor change, and the next time you click, it will close your selection.

Magic Wand Tool (W)
Use this to select a color range. It will select the block of color, or transparency, based on wherever you click. In the Options Bar at the top, you can change the Tolerance to make your selections more/less precise.

Crop Tool (C)
The Crop Tool works similarly to the Rectangular Marquee tool (see above if you have no short-term memory). The difference is when you press the [Enter/Return] key, it crops your image to the size of the box. Any information that was on the outside of the box is now gone. Not permanently, you can still undo.

Slice Tool (K)
This is used mostly for building websites, or splitting up one image into smaller ones when saving out. It’s kind of an advanced tool, and since you’re in here for the basics, we’ll kind of skip over it. Kinda makes you mad I made you read all that for nothing, huh?

Healing Brush Tool (J)
This is a really useful tool. Mildly advanced. You can use this tool to repair scratches and specs and stuff like that on images. It works like the Brush tool (see below). You choose your cursor size, then holding the [Alt] key, you select a nice/clean area of your image. Let go of the [Alt] key and paint over the bad area. It basically copies the info from the first area to the second, in the form of the Brush tool. Only, at the end, it averages the information, so it blends.

Brush Tool (B)
This is one of the first tools ever. It’s what Photoshop is based off of. Well, not really, but it’s pretty basic. It paints one your image, in whatever color you have selected, and whatever size you have selected. There’s a lot of options for it, but this is basic, so you don’t get to learn them. Ha.

Clone Stamp Tool (S)
This is very similar to the Healing Brush Tool (see above). You use it the exact same way, except this tool doesn’t blend at the end. It’s a direct copy of the information from the first selected area to the second. When you learn to use both of these tools together in perfect harmony, you will be a Photoshop MASTA! Not really, it’s just less irritating.

History Brush Tool (H)
This tool works just like the Brush Tool (see above) except the information that it paints with is from the original state of your image. If you go Window>History, you can see the History Palette. The History Brush tool paints with the information from whatever History state is selected.

Eraser Tool (E)
This is the anti-Brush tool. It works like an eraser (duh) and erases whatever information wherever you click and drag it. If you’re on a Layer, it will erase the information transparent. If you are on the background layer, it erases with whatever secondary color you have selected.

Gradient Tool (G)
You can use this to make a gradiation of colors. Gradiation doesn’t appear to be a word, but it makes sense anyway. It creates a blending of your foreground color and background color when you click and drag it. Like a gradient.

Blur Tool (R)
The Blur tool is cool. It makes things blurry. Click and drag to make things blurry. The more you click and drag, the blurrier things get.

Dodge Tool (O)
This tool isn’t as crappy as the car brand. It’s actually used to lighten whatever area you use it on. As long as it is not absolute black. Absolute black won’t lighten.

Path Selection Tool (A)
You use this tool when working with paths. Since this is all about the basics, I won’t go into details. It’s related to the Pen Tool (see below) though.

Horizontal Type Tool (T)
It makes type. Or text. Or whatever you want to call it. You can click a single point, and start typing right away. Or you can click and drag to make a bounding box of where your text/type goes. There’s a lot of options for the Type Tool. Just play around, it’s fairly straight-forward.

Pen Tool (P)
I mentioned this tool above. It’s for creating paths, in which you would use the Path Selection Tool to select the path. Paths can be used in a few different ways, mostly to create clipping paths, or to create selections. You use the tool by clicking to add a point. If you click and drag, it will change the shape of your path, allowing you to bend and shape the path for accurate selections and such.

Rectangle Tool (U)
By default it draws a Shape Layer in the form of a rectangle. It fills the rectangle with whatever foreground color you have selected. It’s pretty complicated, don’t hurt yourself with this one.

Notes Tool (N)
Like post-it notes, but digital. You can use this tool to add small little note boxes to your image. These are useful if you’re very forgetful or if you’re sharing your Photoshop file with someone else. I’m pretty sure it only works with .PSD files.

Eyedropper Tool (I)
This tool works by changing your foreground color to whatever color you click on. Holding the [Alt] key will change your background color.

Hand Tool (T)
You can really make short work of your job with the Hand Tool. It’s for moving your entire image within a window. So if you’re zoomed in and your image area is larger than the window, you can use the Hand Tool to navigate around your image. Just click and drag. You can get to this tool at any time when using any other tool by pressing and holding the [Spacebar].

Zoom Tool (Z)
Pretty obvious what this tool does. It allows you to zoom into your image. Don’t be dumb, it doesn’t actually change the size of your image. Hold the [Alt] key to zoom out. Holding the [Shift] key will zoom all of the windows you have open at the same time. Double-click on the Zoom Tool in the palette to go back to 100% view.

BONUS!!
These are your color boxes. Foreground (in the front) and Background (in the back). Click on either one to bring up the color select dialog box.