Wednesday, October 22, 2014

Font Combinations: 10 Sites for Inspiration - Six Revisions

Font Combinations: 10 Sites for Inspiration - Six Revisions


Font Combinations: 10 Sites for Inspiration

Posted: 22 Oct 2014 03:00 AM PDT

Combining different fonts in a pleasing and harmonious way is a challenging aspect of producing good typography. A lot of it has to do with good taste: When you actually see the fonts in action, you will instinctively know whether or not they work well together.

There are many sites you can visit to get ideas and inspiration for good font combinations. Here are a few of them.

Beautiful Web Type Combinations

Beautiful Web Type Combinations

An open source project, Beautiful Web Type Combinations is a one-page showcase of great Google Fonts pairings.

Typ.io

Typ.io

Typ.io examines beautiful sites to determine what fonts they use. This site will help you answer a deceptively simple question: "What font goes with what?"

Google Web Fonts Typographic Project

Google Web Fonts Typographic Project

This open source project is another showcase of beautiful Google Fonts combinations.

Discover.typography

Discover.typography

Discover.typography will provide you with a great deal of ideas for putting together solid font combinations. Click on a design you like to find a listing of fonts being used within it.

I Font You

I Font You

I Font You is a gallery of designs which aims to help people find great font combinations.

Type Connection

Type Connection

Type Connection is a game that will teach you how to construct good font combinations. This site embraces four principles of pairing typefaces.

Beautiful Web Type

Beautiful Web Type

Beautiful Web Type is yet another showcase of fonts found on Google Fonts.

Typewolf

Typewolf

Typewolf  is an online gallery that exhibits great typography found around the Web. On this site, each featured design comes with a list of fonts being used.

Just My Type

Just My Type

Just My Type is an assembly of well-matched combinations of fonts from a couple of popular Web font subscription services (Typekit and Cloud.typography).

Fonts In Use

Fonts In Use

This site is a huge gallery of over 4,000 typography-centered designs. A list of fonts for each featured piece is provided, which can give you insights towards building good font combinations.

Font Combination Learning Resources

Here are some good guides and tutorials to read if you would like to learn how to pair fonts well.

Related Content

About the Author

Example of a website with a large background image: Jacob Gube is the founder of Six Revisions. He’s also a front-end web developer. Follow him on Twitter: @sixrevisions.

The post Font Combinations: 10 Sites for Inspiration appeared first on Six Revisions.

Monday, October 20, 2014

Freebie: Touch Gesture Icons - Six Revisions

Freebie: Touch Gesture Icons - Six Revisions


Freebie: Touch Gesture Icons

Posted: 20 Oct 2014 03:00 AM PDT

Touch Gestures preview

This freebie contains 30 different visuals of common touchscreen gestures used in mobile device interfaces. Gestures in this set of icons include "tap", "pinch", "slide", and more.

These icons are useful additions to any mobile user interface. They can be used for visual queues, documentation of the app’s features, or for educating new users about the app’s UI.

This freebie was exclusively designed for Six Revisions by Creatticon, a website where you can get free, high-quality web design resources.

The touch gestures come in two different styles: solid and outline. You get the Adobe Illustrator source files for easy customizing and resizing of the touch gestures without losing visual quality. PNGs in different sizes are also provided so that you can use the touch gestures right away.

Preview

Preview of all the touch gestures.

Terms of Use

  1. You can use the touch gesture icons as part of your commercial or personal projects. Examples: Web designs, mobile app interfaces, ebooks, infographics, presentations, etc.
  2. Attribution is not required. But if you want to provide attribution, you can use this HTML:
    <a href="http://sixrevisions.com/freebies/touch-gesture-icons/"> Touch Gesture Icons</a>.
  3. You cannot redistribute or resell the source files in this freebie.

Download Touch Gesture Icons

Related Content

About the Author

Jascha BrinkmannJascha Brinkmann is currently preparing Creatticon where he wants to give back for everything he got over the years from the creative community. He focuses on creating high quality, extremely huge web resources that you can use right away, effortless and completely for free.

The post Freebie: Touch Gesture Icons appeared first on Six Revisions.

Friday, October 17, 2014

1stwebdesigner

1stwebdesigner


Light Your Posts: How to Create Featured Posts Section in WordPress

Posted: 17 Oct 2014 06:00 AM PDT

WordPress is a very powerful CMS. What is great about this is that it can be customized to the way you want it to be. You can add features and edit design and even create featured posts section in just a few minutes.

There are features that you can see on the widgets area to display like the categories, the latest posts and archive posts. But what if you want to highlight some posts to your readers on your site?

This is commonly known as “Featured Posts Content” or “Featured Posts Section“. It’s not a default feature that you can see on the WordPress “stock” installation. The good news is it can be added.

In this article,you are going to learn how you can add a Featured Section on your WordPress site.

Note: You will not focus on the design of the featured section here. Instead, you will be focusing on the implementation side of this tutorial. But please feel free to edit the CSS and customize the design the way you want it to be.

Resources You Need to Complete This Tutorial:

What You Are Going to Build:

screenshot

[ DOWNLOAD THE FINAL VERSION ]

Getting Started

A simple dummy WP theme called Test-theme was used in this tutorial. It is consists of a series of WP template files (but not complete) just for the sake of displaying featured posts. You can download it here if you want or you can use any other theme to go along with this tutorial.

This tutorial will focus on following features:

  • Creating a meta box (checkbox) on pages/posts
  • Saving the meta box information
  • Displaying the Featured posts on the front page

Let's start!

STEP 1 – Creating a Meta Box (Checkbox) on Pages/Posts

Open functions.php, and add the following function to register a checkbox meta box. This function will create and display a meta box on pages/posts edit screen in a form of check box.

  function add_featured_meta_box($post){  $featured = get_post_meta($post->ID, '_featured-post', true);  echo "<label for='_featured-post'>".__('Feature this post?', 'foobar')."</label>";  echo "<input type='checkbox' name='featured-post' id='featured-post' value='1' ".checked(1, $featured)." />";  }  

If users want to add posts to the Featured Section on the front page or any page, they can simply tick the check box. But for now, it won’t save the data yet since you did not add the function to save the data of the meta box.

feature-checkbox

STEP 2 – Saving the Meta Box Information

Once again open functions.php, and add the following snippets under the add_featured_meta_box function.

  function save_featured_meta($post_id){  // Do validation here for post_type, nonces, autosave, etc...  if (isset($_REQUEST['featured-post']))  update_post_meta(esc_attr($post_id), '_featured-post', esc_attr($_REQUEST['featured-post']));  // I like using _ before my custom fields, so they are only editable within my form rather than the normal custom fields UI  }  add_action('save_post', 'save_featured_meta');    

These codes will check if the featured-post was set. It will update or save the data to the database using the update_posts_meta function. This function will update value of an existing meta key (custom field) for the specified post.

The first thing this function will do is make sure that $meta_key already exists on $post_id. If it does not, add_post_meta($post_id, $meta_key, $meta_value) is called instead and its result is returned.

STEP 3 – Displaying the Featured Posts on the Front Page

Now for this part of the tutorial, you're going to display the featured posts on the front page. To do this, copy the snippets below on your preferred WP template file and position.

In this tutorial, codes on the index.php file located at the sidebar have been added.

  <h2>Featured Posts</h2>  <?php    $args = array(          'posts_per_page' => 5,          'meta_key' => '_featured-post',          'meta_value' => 1  	);      $featured = new WP_Query($args);    if ($featured->have_posts()): while($featured->have_posts()): $featured->the_post(); ?>  <h3><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h3>  <p class="details">By <a href="<?php the_author_posts() ?>"><?php the_author(); ?> </a> / On <?php echo get_the_date('F j, Y'); ?> / In <?php the_category(', '); ?></p>  <?php if (has_post_thumbnail()) : ?>    <figure> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('', array('class' => 'box')); ?></a> </figure>  <p ><?php the_excerpt();?></p>  <?php  endif;  endwhile; else:  endif;  ?>                       	    

This code will simply parse the array of the number of featured posts to display, the ID and the value. Then using WP_Query, you will with the intricacies of a posts (or pages) request to a WordPress about our featured posts.

Finally, you will loop the featured posts on the sidebar and get the details like the title, permalink, author, excerpt and so on.

Note: CSS has been added on the dummy theme created; however, you can change it the way you want it to be.

If you are going to check the front page, you will get result similar to the image below.

featured-posts

Conclusion

Congrats! You have successfully created your very first featured posts section using WordPress meta box and some functions. If you are not comfortable doing all this, you can use a plugin like TSP Featured Posts and Featured Posts Widget.

I hope this tutorial will be useful for you. If you have any way other than this to display a featured posts section please share it with us on the comment section.

A Close Look at CSS Box Shadow - Six Revisions

A Close Look at CSS Box Shadow - Six Revisions


A Close Look at CSS Box Shadow

Posted: 17 Oct 2014 03:00 AM PDT

The CSS box-shadow property can be used to give block elements a drop shadow or an inner shadow. Let’s take a close look at this CSS property.

Examples

Below are three different examples of applying the CSS box-shadow property on a div.

Example 1: Simple Drop Shadow

Here’s how you could give a div a subtle gray drop shadow.

box-shadow: 0 0 10px gray;

A basic gray drop shadow rendered using CSS box-shadow.

Example 2: Inner Shadow

An inner shadow can be rendered using the inset property value.

box-shadow: inset 0 0 10px;

An inner shadow rendered using CSS box-shadow.

Example 3: Offset Drop Shadow

In this example, the box shadow is cast with a bias towards the bottom-right side of the box by using a horizontal offset and vertical offset of 5px.

box-shadow: 5px 5px 10px;

Offset drop shadow (bottom right).

What if you wanted to have the shadow at the top-left portion of the box instead? We can do so using negative values for the horizontal offset and vertical offset. In the following example, the horizontal offset and vertical offset is set to -5px.

box-shadow: -5px -5px 10px;

Offset drop shadow (top left).

Now that you’ve seen a few examples of CSS box-shadow in action, let’s dig a little deeper.

Syntax

The general syntax of the box-shadow property is as follows:

box-shadow: [inset] [horizontal offset] [vertical offset] [blur radius] [spread distance] [color];

CSS Property Values

The CSS box-shadow property has six possible property values:

  1. inset
  2. horizontal offset
  3. vertical offset
  4. blur radius
  5. spread distance
  6. color

Only two property values are required: the horizontal offset and the vertical offset.

Four property values, the horizontal offset, vertical offset, blur radius, and spread distance, must use a CSS length unit (e.g. px, em, %, etc.)

The color value must be a CSS color unit such as a hex value (e.g. #000000).

Property Value Summary

Property value Required? Unit Default value if not specified
inset No keyword If inset is not specified, the box shadow will be outside of the HTML element.
horizontal offset Yes length No default value. It must be specified.
vertical offset Yes length No default value. It must be specified.
blur radius No length 0
spread distance No length 0
color No color Equal to the color property of the HTML element/s that the box shadow is being applied to.

inset

If the inset keyword property value is present, the box shadow will be placed inside the HTML element.

box-shadow: inset 0 0 5px 5px olive;

CSS box-shadow with inset property value specified.

As a comparative reference, here’s the same box shadow without the inset property:

box-shadow: 0 0 5px 5px olive;

CSS box-shadow with inset property value not specified.

horizontal offset

The horizontal offset value controls the x-axis position of the box shadow. A positive value will shift the box shadow to the right, while a negative value will shift it to the left.

In the following example, the horizontal offset is set to 20px, or double the value of the vertical offset (which is set to 10px), so the shadow is two times wider horizontally.

box-shadow: 20px 10px;

CSS box-shadow with horizontal offset value at 20px.

vertical offset

The vertical offset controls the box shadow’s position on the y-axis. A positive value will move it down while a negative value will move it up.

In the following example, the vertical offset has a length of -20px, or double the length of the horizontal offset (10px), so the size of the shadow is twice as big on the vertical axis. Also, since the value is negative, the location of the shadow is offset towards the top of the box.

box-shadow: 10px -20px;

CSS box-shadow with vertical offset value at -20px.

blur radius

The blur radius property value affects the blurriness/sharpness of the box shadow.

The blur radius is optional. If you don’t specify it, it will default to 0. Additionally, it can’t have a negative value, unlike horizontal offset and vertical offset.

If the blur radius is 0, the box shadow will be sharp and its color will be solid. As you increase the value, it will become blurrier and more opaque.

In the example below, the blur radius value is set to 20px, thus the blurriness is quite pronounced.

box-shadow: 5px 5px 20px;

CSS box-shadow with blur radius set at 20px.

spread distance

The spread distance makes the box shadow larger or smaller in all directions. If it has a positive value, the box shadow will grow in size on all sides. If it has a negative value, the box shadow will contract on all sides.

Notice how, because of the positive spread distance (10px), there’s a 10px drop shadow on all sides of the box because there is no horizontal offset and vertical offset:

box-shadow: 0 0 10px 5px;

CSS box-shadow with a positive spread distance  value.

When the spread distance is negative, the shadow shrinks on all sides. In the following example, the shadow is smaller than the box’s width because of its negative spread distance and the absence of a horizontal offset:

box-shadow: 0 10px 10px -5px;

CSS box-shadow with a negative spread distance  value.

color

As you can already tell by its name, the color value sets the box shadow’s color. It can be specified using any CSS color unit. Specifying a color value is optional.

By default — in other words, if you don’t explicitly state a color value for your box shadow — the shadow’s color will be equal to the color value of the HTML element the box-shadow property is being applied to. For instance, if you have a div that has the color of red, the box shadow’s color will also be red:

color: red;  box-shadow: 0 0 10px 5px;

CSS box-shadow without a color value specified.

If you want a different shadow color, then you’ll need to specify it in the box-shadow property value declaration. Below you can see that even though the foreground color of the div is still red, the box shadow color is blue.

color: red;  box-shadow: 0 0 10px 5px blue;

CSS box-shadow without a color value of 'blue'.

Multiple Box Shadows

This is where you can get really creative with this CSS property: You can apply more than one box shadow on an element.

The syntax is as follows:

box-shadow: [box shadow properties 1], [box shadow properties 2], [box shadow properties n];

In other words, you can have multiple box shadows by separating each property value group with commas (,).

In the following example, there are two box shadows: A red one at the top-left side of the box, and a blue one at the bottom-right side.

box-shadow: -5px -5px 30px 5px red,               5px 5px 30px 5px blue;

CSS box-shadow with multiple box-shadow property values.

Browser Support

The CSS box-shadow property has good browser support. Using Internet Explorer as the least common denominator, the property has been supported since IE 9 (which was released in 2011).

CSS Box Shadow Examples

You can see a live demo of all the box shadow examples used in this article by clicking the button below.

View Demo

CSS Box Shadow Examples

Related Content

About the Author

Example of a website with a large background image: Jacob Gube is the founder of Six Revisions. He’s a front-end web developer by profession. If you’d like to connect with him, head on over to the contact page or follow him on Twitter: @sixrevisions.

The post A Close Look at CSS Box Shadow appeared first on Six Revisions.