WebKit Transform Perspective Function

Yar, 3D transform be ahead. The examples below also live together in a lovely house in this fiddle.

Safari has support for a perspective transform function. This is pretty convenient for doing a simple 3d transform, like a card flip.

#wkptfn-example1 .alpha {
  background: blue;
  transform: perspective(800px) rotateY( 0deg);
}

#wkptfn-example1:hover .alpha {
  transform: perspective(800px) rotateY(-180deg);      
}

#wkptfn-example1 .beta {
  background: red;
  transform: perspective(800px) rotateY(180deg);
}

#wkptfn-example1:hover .beta {
  transform: perspective(800px) rotateY( 0deg);
}

Hover for Card Flippin’ Action

The problem with it is that the perspective is only for the one element. If you use the same transform across elements with different position, each element will have its own vanishing point.

#wkptfn-example2 div {
  transform: perspective(800px) rotateY(45deg);
}

To remedy this, you need to specify a perspective or the parent with perspective: and then let the children inherit it with transform-style: preserve-3d;

#wkptfn-example3 {
  perspective: 800px;
}

#wkptfn-example3 div {
  transform-style: preserve-3d;
  transform: rotateY(45deg);
}