Wednesday, February 26, 2014

Why Being a Web Designer Who Codes Is Way Cooler

Is it important that web designers need to know how to code?What are the advantages of the web designer who codes?  The term "web designer" is a subjective matter. Many believe this person is responsible for doing web layouts in Photoshop while others think of him or her as the one who does the HTML markup.

In the field of web development, there are arguments and opinions whether a web designer should know how to code or this person should just focus on his/her craft by creating quality web design layouts.

Everyone has his or her opinion about it and there are probably a million different scenarios and experiences that might make each theory or opinion true.

When I first started in web design, I really don't know how to code. I was clueless about HTML or CSS. All I knew was to create web page layouts and align elements in Photoshop. Then one day, it hit me: I realized my curiosity had grown stronger as I had seen a lot of articles and blog posts written about how to really get into the code. I began wondering how these geek guys do these beautiful websites.

webdeisgner-vs-webdeveloper

So I jumped in front of my computer and searched for good tutorials to get started on how to code. To my disappointment, most of the articles I found only offered the basic knowledge such as how to use H1, H2, anchor tags and so on. Then one year later, I found one guy who trained me and turned me into at least a newbie web designer and the rest is history.

This is my own experience; yours might be similar or entirely different. But, admit it, what you don't know is bound to hold you back from learning.

Yes! You heard it right. I know my statement might cause more than a few good and bad reactions. Some of you might look at me now frustrated and angry. Before you pass your judgement, I encourage you to read this and understand as I talk about why I think that web designers should learn how to code.

What's holding web designers back in learning how to code?

Before we dig into the reasons why web designers should learn how to code, let's check first what are the reasons why some web designers just want to focus on designing. Below are the main reasons that hinder a web designer from learning to code.

1. They enjoy graphics more than codesSome web designers tend to focus on their artwork and illustrations and have more passion on the creative aspect of the website. They love to create stunning web layouts by choosing the right fonts, color, images and icons, but don't want to deal with the coding aspect to make their graphics alive and real.

2. No time to spend for learning. Several web designers find it difficult to learn coding while others can't keep up with a fast pace of development. They think that if they spend time to learn coding, they might be left behind when trending design concepts are being talked about. They believe will not be able to improve their creative skills.

3. They think it's hard. Some web designers think that they would suck at it that's why they became afraid to try. Learning to code is a process just like a flower takes time to bloom.

Why web designers should learn how to code

Now that we know what hinders a web designer from learning to code, let's now jump on why a web designer should learn coding.

1. Flexible roles for each project. If a designer knows how to code, he can easily change roles with a web developer. Developers can be web designers too and if a web designer knows how to code, he can also work on the coding aspect too. Since the two can switch roles, both are making the process more flexible and efficient.

2. Fast and efficient delivery of projects. It would make a lot faster to finish a project if a web designer knows how to code it. For instance, when a web designer creates a mock-up in Photoshop, he can easily cut the images and code the markup. The web developer then can focus more on the complex issues.

3. Efficient technical communicationIf a designer knows how to code, he can easily interact with the web developer and talk about codes. In that case, the designer will be able to help the developer with minor bugs and updates on the codes of the site.This will make the team more efficient, saving more time, thus, delivering the projects on time.

4. It's not a rocket science- it can be learned. When I started learning how to code, I was thinking that I was not born for it but later, I found it exciting and enjoying. Learning to code is really not easy but it's also not that hard. Everyone can learn it.

5. The key to the next levelWhen you're learning how to code, you begin to think logically. This would lead you to learn more coding languages and techniques since you already have an experience on how to code. Eventually, you may learn the skills the web developer has.

Curiosity: Key to Learning

Based on my experience, it all started when I got curious on how to code. Being curious made me search and look for tutorials that led me to learning. I love what Walt Disney once said: "When you're curious, you find lots of interesting things to do." Exactly true!

The power of curiosity makes everything more enjoyable to learn. Start being curious before it's too late.


courtesy: http://www.1stwebdesigner.com/inspiration/web-designer-who-codes/

Thursday, February 20, 2014

100+ Infographic Vector Elements


  • Vector free Info-graphics including charts, maps, graphics, icons, timelines, layers and other data visual graphics. Infographics is about data visualization. It is a way to show your numbers in term of graphics, charts and other visual drawings. It is usually used in statistics, business plans, feasibility studies, web analytic and more.

Wednesday, February 19, 2014

Beginners Guide to Working with jQuery Animation

In this tutorial, we are going explore the basics of jQuery animations for you to get prepared for advanced designs. Animations is the core functionality behind the interactive elements in web design.

The design of a website plays a major role in attracting visitors on a consistent basis. Interactive designs get more attention compared to the plain old static designs.

Technology is improving at a rapid pace to cater the advanced modern web designs. As a result, CSS3 offers the animations without the help of JavaScript. Even though CSS3 and HTML5 are improving in leaps and bounds, jQuery seems to be the popular choice for creating interactive designs.

Let's get started!

Practical Usage of jQuery Animations

jQuery has been used widely for designing interactive elements such as sliders, menus, scrollers and so on. Before we start the animation aspects, I suggest you to have a look at the following practical implementations, which illustrates the power of jQuery animations.

As a beginner, you can't  just jump into the types of designs illustrated in the preceding section. So here we are going to cover the basics of jQuery animations from the beginner's perspective.

Introduction to Basic Animations with jQuery

Most designers have the knowledge of working with basic jQuery or JavaScript codes. Changing the visibility of an element is a common task that is included in almost every website design. We can just hide/show the element using CSS display or visibility attributes. jQuery simplifies the process by introducing two functions called hide and show. Consider the following code for showing and hiding an HTML element.

1 $("#panel").show();
2  
3 $("#panel").hide();

With the preceding code, the element appears and disappears in a very limited time range. Use the following jsFiddle link to see a demo of the preceding code in action.

http://jsfiddle.net/nimeshrmr/bMmFS/

Ideally, we should smoothen the process of hiding and showing elements using animations to provide better user experience. jQuery provides two built-in techniques for showing and hiding elements with simple animation effect.

  • Fading – Integrates a fading motion into HTML elements by changing the element's opacity.
  • Sliding – Integrates a sliding motion into HTML elements by changing the element's height.

Let's see how to use the above techniques to show and hide the elements with an animated effect.

jQuery encapsulates the complexity of animations by providing built-in methods to cater various tasks in web design.

Fading

Fading is mainly provided by the functions called fadeIn and fadeOut. Opacity of the element is increased by the fadeIn function and decreased by the fadeOut function. We can also pass the time interval for fading as shown in the following code.

1 $("#panel").fadeIn("slow");
2  
3 $("#panel").fadeOut("fast");

We have the option of choosing slow or fast as the predefined values for the time interval . Also,we can pass the number in milliseconds to define the duration of animation. Here is the jsFiddle demo for working with fadeIn and fadeOut functions.

http://jsfiddle.net/nimeshrmr/zcRzL/

Sliding

Sliding functions change the height of the element instead of opacity for animating elements. Functions and syntaxes work exactly similar to fading, where slideUp is used for hiding and slideDown is used for showing elements. Following code previews the basic usage of sliding functions.

1 $("#panel").slideDown("slow");
2  
3 $("#panel").slideUp("fast");

Duration parameter also works similar to the usage of fading functions. Here, you can see the actual beginning of the animations by moving the element. Consider the following URL for a demo usage of sliding functions.

http://jsfiddle.net/nimeshrmr/nDz6J/

Getting Started with jQuery Animate Function

Most beginners will think that building animations is a quite complex task. Definitely it's difficult if you are doing it from scratch. jQuery encapsulates all the complexity by providing a single standalone function, which handles any type of animation. Basically, the animations will be created by altering the values of the CSS attributes. Once you get used to the jQuery animate function, building complex animations will become a simple task. Let's get started by looking at the basic syntax of animate function.

1 $( "#panel" ).animate({
2  
3   // CSS Properties and values
4  
5 }, 5000, "linear"function() {
6  
7   // Completion Handler
8  
9 });

Preceding code illustrates the syntax for using the animate function. The first parameter contains all the CSS properties and values. The next optional parameter defines the duration of the animation. The third parameter defines the easing( animation type) and the final parameter defines an anonymous function for handling animation completion. Having looked at the basic usage, we can move into creating something practical with jQuery animations.

Animating Image Parts

In this section, we are going to look at how we can display an image by animating image parts. First, we have to split an image into smaller images. You can use the technique provided in my tutorial on Create Jigsaw Puzzle Using jQuery and PHP for splitting images.

Here, is the image that we are going to use for animation.

animations1

Inside the source codes, you will find 12 images generated by splitting the preceding image. Each image will have the dimensions of 150px x 150px. Sub images are divided into 2 rows of 6 blocks. Then all the 6 blocks of each row will be positioned in the right hand corner of the page using the following code.

1 <div id="img_panel">
2  
3     <div class="img_item"><img src="1.jpg" /></div>
4  
5     <div class="img_item"><img src="2.jpg" /></div>
6  
7     <div class="img_item"><img src="3.jpg" /></div>
8  
9     <div class="img_item"><img src="4.jpg" /></div>
10  
11     <div class="img_item"><img src="5.jpg" /></div>
12  
13     <div class="img_item"><img src="6.jpg" /></div>
14  
15     <div class="img_item2"><img src="7.jpg" /></div>
16  
17     <div class="img_item2"><img src="8.jpg" /></div>
18  
19     <div class="img_item2"><img src="9.jpg" /></div>
20  
21     <div class="img_item2"><img src="10.jpg" /></div>
22  
23     <div class="img_item2"><img src="11.jpg" /></div>
24  
25     <div class="img_item2"><img src="12.jpg" /></div>
26  
27 </div>

Here, we have separated 12 images into 2 columns using two CSS classes called img_item andimg_item2. Now let's look at the CSS code for positioning images.

1 .img_item{
2  
3    positionabsolute;
4  
5    right0px;
6  
7    opacity:0;
8  
9    top :0;
10  
11 }
12  
13 .img_item2{
14  
15    positionabsolute;
16  
17    right0px;
18  
19    opacity:0;
20  
21    top:150px;
22  
23 }

According to the above code, all the images of each row will be hidden and positioned on top of each other using absolute positioning. Now we can look at the jQuery code for generating the image through animations.

1 $(document).ready(function(){
2  
3    var left = 0;
4  
5  $(".img_item").each(function(i,val){
6  
7            $(this).animate({
8  
9                left: left,
10  
11                opacity: 1
12  
13            }, 1500 );
14  
15            left += 150;
16  
17    });
18  
19    left = 0;
20  
21  $(".img_item2").each(function(i,val){
22  
23            $(this).animate({
24  
25                left: left,
26  
27                opacity: 1
28  
29            }, 1500 );
30  
31            left += 150;
32  
33        });
34  
35     });

First, we have two selection statements for filtering img_item and img_item2 class items. Then we execute the animate function on the individual elements to convert opacity to 1 and left positioning relative to the preceding image part. Basically, all the image parts will start the animation at the same time providing an output similar to the following image.

animate3

We can use similar effects inside sliders, splash screens, image galleries. Here is the demo of the preceding implementation.

Now you know the basics of working with animate function. Let's dig deeper into the animation aspects by looking at advanced configurations.

Designing Sequential Animations

In the preceding scenario, all the elements started animating immediately on page load. But sometimes we want sequential animations, where animation of each element starts after the completion of preceding element. So here we are going to load the same image using sequential animations. Let's start by defining the HTML code.

1 <div id="img_panel">
2  
3     <div class="img_item"><img src="1.jpg" /></div>
4  
5     <div class="img_item"><img src="2.jpg" /></div>
6  
7     <div class="img_item"><img src="3.jpg" /></div>
8  
9     <div class="img_item"><img src="4.jpg" /></div>
10  
11     <div class="img_item"><img src="5.jpg" /></div>
12  
13     <div class="img_item"><img src="6.jpg" /></div>
14  
15     <div class="img_item"><img src="7.jpg" /></div>
16  
17     <div class="img_item"><img src="8.jpg" /></div>
18  
19     <div class="img_item"><img src="9.jpg" /></div>
20  
21     <div class="img_item"><img src="10.jpg" /></div>
22  
23     <div class="img_item"><img src="11.jpg" /></div>
24  
25     <div class="img_item"><img src="12.jpg" /></div>
26  
27 </div>

The only change from the previous code is the use of single CSS class instead of two classes for rows. This implementation will generate the rows from jQuery code instead of hard coding using CSS classes. The CSS code for this implementation will be same as the code used for the previous example. Now let's look at the jQuery code for sequential animation.

1 $(document).ready(function(){
2  
3    var left = 0;
4  
5    var items = $(".img_item");
6  
7    animateImg(items,0,0,0);
8  
9 });

Once the page is loaded, we get all the image elements using img_item class. Then we pass the items into a function called animateImg for processing animations. The following code provides the implementation ofanimateImg function.

1 var indexNum = 1;
2  
3  var animateImg = function(items,left,height,indexNum){
4  
5  if(items.length >= indexNum){
6  
7            var item = items.get(indexNum);
8  
9            $(item).animate({
10  
11                left: left,
12  
13                top : height,
14  
15                opacity: 1
16  
17            }, 1500 ,function() {
18  
19                left += 150;
20  
21                indexNum++;
22  
23                if(indexNum  % 6 == 0){
24  
25                    left = 0;
26  
27                    height += 150;
28  
29                }
30  
31  animateImg(items,left,height,indexNum);
32  
33            });
34  
35        }
36  
37     };

The animateImg function uses four parameters for providing its functionality. The first parameter defines the collection of image items. The second and third parameters define the left and top values of the screen. Initially these 2 values will be set to 0 to start the image from the top left corner of the screen. The fourth parameter is the index number of image for separating them into rows.

First, we check whether we have reached the end of the items array by using an if condition. Then we get the image at the given index number from the items array. Then we call the animate function with a duration of 1500 milliseconds. Next, we increase the index number to get the next element from items array.

In this scenario, we have 2 rows with 6 images each. So we take the module of the index number to check whether we have reached an end of a row. If so, we increase the top value of the image to dynamically create rows. Finally, we call the animateImg function in a recursive manner to traverse through all the elements and generate the complete animation. The following image previews the sequential animation for this scenario.

animate2

Here you can find the demo for the preceding scenario.

As you can see, we have used the animation complete function to execute the animation on the next element. So each animation will start after the preceding one is completed. We can achieve similar functionality with queue functionality of the animate function.

Chaining Animations

Up to this point, we created single animations on each element. In complex scenarios, we need to chain multiple animations on a single element. So let's modify the preceding example to chain animations.

1 var animateImg = function(items,left,height,indexNum){
2  
3  if(items.length >= indexNum){
4  
5            var item = items.get(indexNum);
6  
7            $(item).animate({
8  
9                left: left,
10  
11                top : height,
12  
13                opacity: 1
14  
15            }, 1500 ,function() {
16  
17                left += 150;
18  
19                indexNum++;
20  
21                if(indexNum  % 6 == 0){
22  
23                    left = 0;
24  
25                    height += 150;
26  
27                }
28  
29                console.log(items);
30  
31  animateImg(items,left,height,indexNum);
32  
33            }).animate({ left:left+150}, 1500);
34  
35        }
36  
37     };

We can chain animations on elements by calling the animate function multiple times using the dot notation. In the preceding code, we have started another animation after the first animation using .animate function. We can add any number of animations using this technique. Here is the demo of chaining animations.

Wrap Up

In this tutorial, we explored the possibilities of building animations with jQuery animate function. We have looked at various practical techniques when animating the parts of an image to generate the complete image. Now you can continue researching about the things mentioned in the following list for enhancing jQuery animations.

  • Animations queueing
  • Handling animation progress
  • Handling animation steps

Hope you take time to build some amazing animations as we listed in the beginning of this tutorial. Feel free to share and discuss about them using the comments section.