--- layout : 'default' css : 'shape' title : 'Shape' description : 'A shape is a three dimensional object displayed on a two dimensional plane' type : 'UI Module' --- <%- @partial('header') %>

Types

The module uses 3D transformations which are currently only supported in modern versions of Chrome, Safari, and Firefox.

Shape

A shape has multiple sides of arbitrary content. Only one is visible

This side is visible.
This side is not visible.
This side is not visible.

Examples

Interactive

Shape

Square
Rectangle
Irregular

Flip

Left
Right
Up
Down
Over
Back

Shape with Content

Cute Dog

This dog has some things going for it. Its pretty cute and looks like it'd be fun to cuddle up with.

Silly Dog

Silly dogs can be quite fun to have as companions. You never know what kind of ridiculous thing they will do.

5 days ago
Faithful Dog

Sometimes its more important to have a dog you know you can trust. But not every dog is trustworthy, you can tell by looking at its smile.

Cute Dog

This dog has some things going for it. Its pretty cute and looks like it'd be fun to cuddle up with.

Silly Dog

Silly dogs can be quite fun to have as companions. You never know what kind of ridiculous thing they will do.

5 days ago
Faithful Dog

Sometimes its more important to have a dog you know you can trust. But not every dog is trustworthy, you can tell by looking at its smile.

$('.dog.shape') .eq(0) .shape('flip over') .end() .eq(1) .shape('flip left') ;

Getting Started

Initializing a shape

$('.shape') .shape() ;

Transitions automatically assume next side is the next sibling (or first if last element)

$('.shape') .shape('flip up') ;

To manually set the next side to appear use a selector or jQuery object

$('.shape') .shape('set next side', '.second') .shape('flip up') ;

Any internal method can be invoked programmatically

$('.shape') .shape('repaint') ;

Defaults

Shape Settings
duration 1000ms Duration of animation (javascript only). To modify animation duration for css simply modify the css property transition-duration.
easing easeInOutQuad Easing equation for animation (javascript only). To modify the easing for css simply modify the css property transition-easing
selector
{ shape : '.shape', side : '.side' }
Object containing selectors used by module.
className
{ css : 'css', animating : 'animating', hidden : 'hidden', active : 'active' }
Object containing class names used by module.
Callbacks
beforeChange None Callback before side is changed. This context is the new side.
onChange None Callback after side is changed. This context is new side.
UI Module Settings
Name Shape Name used in debug logs
debug True Provides standard debug output to console
performance False Provides standard debug output to console
verbose False Provides ancillary debug output to console
namespace shape Event namespace. Makes sure module teardown does not effect other events attached to an element.
errors
{ side : 'You tried to switch to a side that does not exist.', method : 'The method you called is not defined' }