cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="flip-container">
	<div class="flipper">
		<div class="front">
			<img class="shadowed" src="http://www.kurtmeredith.com/img/CP-gift-label-front-with-string.png" alt="" />
		</div>
		<div class="back">
			<img class="shadowed" src="http://www.kurtmeredith.com/img/CP-gift-label-back-with-string.png" alt="" />
		</div>
	</div>
</div>
<svg height="0" xmlns="http://www.w3.org/2000/svg">
  <filter id="drop-shadow">
      <feGaussianBlur in="SourceAlpha" stdDeviation="4"/>
      <feOffset dx="5" dy="10" result="offsetblur"/>
      <feFlood flood-color="rgba(0,0,0,0.4)"/>
      <feComposite in2="offsetblur" operator="in"/>
      <feMerge>
          <feMergeNode/>
          <feMergeNode in="SourceGraphic"/>
      </feMerge>
  </filter>
</svg>

            
          
!
            
              //* ************************************* */
//* SASS Variables */
//* ************************************* */
$shadow-color: rgba(0,0,0,0.5);
$shadow-offsetX: 6;
$shadow-offsetY: 9;
$shadow-blur: 4;
$shadow-spread: 0;
$hidden-element-y-axis: -1000px;
$resting-y-axis: -30px;

//* ************************************* */
//* SASS Mixins */
//* ************************************* */
//* webkit animation syntax: 'animation: name duration timing-function delay iteration-count direction;' */
@mixin animation($name: none, $duration: 0, $timing-function: ease, $delay: 0, $iteration-count: 1, $direction: normal) {
  -webkit-animation: $name $duration $timing-function $delay $iteration-count $direction;
  -moz-animation: $name $duration $timing-function $delay $iteration-count $direction;
  -ms-animation: $name $duration $timing-function $delay $iteration-count $direction;
  -o-animation: $name $duration $timing-function $delay $iteration-count $direction;
  animation: $name $duration $timing-function $delay $iteration-count $direction;
}

@mixin transform-rotate($angle: 0deg) {
  -webkit-transform: rotate($angle);
  -ms-transform: rotate($angle);
  transform: rotate($angle);
}

@mixin transform-translate($x-axis: 0, $y-axis: 0) {
  -webkit-transform: translate($x-axis, $y-axis);
  -ms-transform: translate($x-axis, $y-axis);
  transform: translate($x-axis, $y-axis);
}

@mixin transform-rotateY($angle: 0deg) {
  -webkit-transform: rotateY($angle);
  transform: rotateY($angle);
}

@mixin transform-origin($origin-x-axis: 50%, $origin-y-axis: 50%, $origin-z-axis: 0) {
  -webkit-transform-origin:$origin-x-axis $origin-y-axis $origin-z-axis;
  -ms-transform-origin:$origin-x-axis $origin-y-axis $origin-z-axis;
  transform-origin:$origin-x-axis $origin-y-axis $origin-z-axis;
}

@mixin opacity($opacity: 1) {
  zoom: 1;
  filter: alpha(opacity=$opacity * 100);
  opacity: ($opacity * 1.0);
}

@mixin backface-visibility($visibility: hidden) {
  -webkit-backface-visibility: $visibility;
  -moz-backface-visibility: $visibility;
  -ms-backface-visibility: $visibility;
  backface-visibility: $visibility;
}

@mixin perspective($pixels: none) {
  -webkit-perspective: $pixels;
  -moz-transform: perspective($pixels+px);
  perspective: $pixels;
  -moz-transform-style: preserve-3d; 
}

@mixin transform-style($style: flat) {
  -webkit-transform-style: $style;
  transform-style: $style;
}

@mixin shadow($offsetX, $offsetY, $blur, $color) {
  -webkit-filter: drop-shadow($offsetX+px $offsetY+px $blur+px $color);
  filter: url(#drop-shadow);
  -ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=" + $offsetX + ", OffY=" + $offsetY + ", Color='" + $color + "')";
  filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=" + $offsetX + ", OffY=" + $offsetY + ", Color='" + $color + "')";
}

/* ************************************* */
/* Animations
/* ************************************* */
@-webkit-keyframes allmoves {
  0%, 100% {
    @include opacity(1);
    @include transform-translate(0, $hidden-element-y-axis);
    // Start hidden above the window.
  }
  5% {
    @include transform-translate(0, $resting-y-axis);
    // Natural resting position.
  }
  4%, 53%, 95%, 96% {
    @include transform-translate(0, $resting-y-axis + 12px);
    // Slight bounce upon entry and exit.
    @include transform-rotate(0);
  }
  98% {
    @include transform-translate(0, $resting-y-axis + 50px);
  }
  6%, 12% { 
    @include transform-rotate(3deg);
  }
  9%, 15% { 
    @include transform-rotate(-3deg);
  }
  18%, 24% { 
    @include transform-rotate(2deg);
  }
  21%, 27%, 57% { 
    @include transform-rotate(-2deg);
  }
  30%, 36%, 60% { 
    @include transform-rotate(0.7deg);
  }
  33%, 39%, 63% { 
    @include transform-rotate(-0.7deg);
  }
  42%, 48%, 66%, 72% { 
    @include transform-rotate(0.2deg);
  }
  45%, 51%, 69% { 
    @include transform-rotate(-0.2deg);
  }
  52%, 75% { 
    @include transform-rotate(0);
  }
}

@-webkit-keyframes flip-front {
  0% {
    @include transform-rotateY(0);
  }
  54% {
    @include transform-rotateY(0);
  }
  58% {
    @include transform-rotateY(180deg);
  }
  100% {
    @include transform-rotateY(180deg);
  }
}

@-webkit-keyframes flip-back {
  0% {
    @include transform-rotateY(180deg);
  }
  54% {
    @include transform-rotateY(180deg);
  }
  58% {
    @include transform-rotateY(0);
  }
  100% {
    @include transform-rotateY(0);
  }
}

@-moz-keyframes allmoves {
  0%, 100% {
    @include opacity(1);
    @include transform-translate(0, $hidden-element-y-axis);
    // Start hidden above the window.
  }
  5% {
    @include transform-translate(0, $resting-y-axis);
    // Natural resting position.
  }
  4%, 53%, 95%, 96% {
    @include transform-translate(0, $resting-y-axis + 12px);
    // Slight bounce upon entry and exit.
    @include transform-rotate(0);
  }
  98% {
    @include transform-translate(0, $resting-y-axis + 50px);
  }
  6%, 12% { 
    @include transform-rotate(3deg);
  }
  9%, 15% { 
    @include transform-rotate(-3deg);
  }
  18%, 24% { 
    @include transform-rotate(2deg);
  }
  21%, 27%, 57% { 
    @include transform-rotate(-2deg);
  }
  30%, 36%, 60% { 
    @include transform-rotate(0.7deg);
  }
  33%, 39%, 63% { 
    @include transform-rotate(-0.7deg);
  }
  42%, 48%, 66%, 72% { 
    @include transform-rotate(0.2deg);
  }
  45%, 51%, 69% { 
    @include transform-rotate(-0.2deg);
  }
  52%, 75% { 
    @include transform-rotate(0);
  }
}

@-moz-keyframes flip-front {
  0% {
    @include transform-rotateY(0);
  }
  54% {
    @include transform-rotateY(0);
  }
  58% {
    @include transform-rotateY(180deg);
  }
  100% {
    @include transform-rotateY(180deg);
  }
}

@-moz-keyframes flip-back {
  0% {
    @include transform-rotateY(180deg);
  }
  54% {
    @include transform-rotateY(180deg);
  }
  58% {
    @include transform-rotateY(0);
  }
  100% {
    @include transform-rotateY(0);
  }
}

@-ms-keyframes allmoves {
  0%, 100% {
    @include opacity(1);
    @include transform-translate(0, $hidden-element-y-axis);
    // Start hidden above the window.
  }
  5% {
    @include transform-translate(0, $resting-y-axis);
    // Natural resting position.
  }
  4%, 53%, 95%, 96% {
    @include transform-translate(0, $resting-y-axis + 12px);
    // Slight bounce upon entry and exit.
    @include transform-rotate(0);
  }
  98% {
    @include transform-translate(0, $resting-y-axis + 50px);
  }
  6%, 12% { 
    @include transform-rotate(3deg);
  }
  9%, 15% { 
    @include transform-rotate(-3deg);
  }
  18%, 24% { 
    @include transform-rotate(2deg);
  }
  21%, 27%, 57% { 
    @include transform-rotate(-2deg);
  }
  30%, 36%, 60% { 
    @include transform-rotate(0.7deg);
  }
  33%, 39%, 63% { 
    @include transform-rotate(-0.7deg);
  }
  42%, 48%, 66%, 72% { 
    @include transform-rotate(0.2deg);
  }
  45%, 51%, 69% { 
    @include transform-rotate(-0.2deg);
  }
  52%, 75% { 
    @include transform-rotate(0);
  }
}

@-ms-keyframes flip-front {
  0% {
    @include transform-rotateY(0);
  }
  54% {
    @include transform-rotateY(0);
  }
  58% {
    @include transform-rotateY(180deg);
  }
  100% {
    @include transform-rotateY(180deg);
  }
}

@-ms-keyframes flip-back {
  0% {
    @include transform-rotateY(180deg);
  }
  54% {
    @include transform-rotateY(180deg);
  }
  58% {
    @include transform-rotateY(0);
  }
  100% {
    @include transform-rotateY(0);
  }
}

@keyframes allmoves {
  0%, 100% {
    @include opacity(1);
    @include transform-translate(0, $hidden-element-y-axis);
    // Start hidden above the window.
  }
  5% {
    @include transform-translate(0, $resting-y-axis);
    // Natural resting position.
  }
  4%, 53%, 95%, 96% {
    @include transform-translate(0, $resting-y-axis + 12px);
    // Slight bounce upon entry and exit.
    @include transform-rotate(0);
  }
  98% {
    @include transform-translate(0, $resting-y-axis + 50px);
  }
  6%, 12% { 
    @include transform-rotate(3deg);
  }
  9%, 15% { 
    @include transform-rotate(-3deg);
  }
  18%, 24% { 
    @include transform-rotate(2deg);
  }
  21%, 27%, 57% { 
    @include transform-rotate(-2deg);
  }
  30%, 36%, 60% { 
    @include transform-rotate(0.7deg);
  }
  33%, 39%, 63% { 
    @include transform-rotate(-0.7deg);
  }
  42%, 48%, 66%, 72% { 
    @include transform-rotate(0.2deg);
  }
  45%, 51%, 69% { 
    @include transform-rotate(-0.2deg);
  }
  52%, 75% { 
    @include transform-rotate(0);
  }
}

@keyframes flip-front {
  0% {
    @include transform-rotateY(0);
  }
  54% {
    @include transform-rotateY(0);
  }
  58% {
    @include transform-rotateY(180deg);
  }
  100% {
    @include transform-rotateY(180deg);
  }
}

@keyframes flip-back {
  0% {
    @include transform-rotateY(180deg);
  }
  54% {
    @include transform-rotateY(180deg);
  }
  58% {
    @include transform-rotateY(0);
  }
  100% {
    @include transform-rotateY(0);
  }
}

/* ************************************* */
/* CSS
/* ************************************* */
body {
  background: url(http://placehold.it/1024x768/aaaaaa/cccccc) 50% 0 no-repeat; 
}

/* entire container, keeps perspective */
.flip-container {
  @include opacity(0);
  margin-top: $resting-y-axis;
  margin-right: auto;
  margin-left: auto;
	@include perspective(1000);
  @include animation(allmoves, 10s, ease-in-out, 5s, infinite, normal);
  @include transform-origin(50%, -80px, 0); 
}

.flip-container .flipper .front, .flip-container.hover .flipper .front {
  @include animation(flip-front, 10s, ease-in-out, 5s, infinite, normal);
}

.flip-container .flipper .back, .flip-container.hover .flipper .back {
  @include animation(flip-back, 10s, ease-in-out, 5s, infinite, normal);
}

.flip-container, .front, .back {
	width: 250px;
	height: 450px;
}

/* flip speed goes here */
.flipper {
  @include transform-style(preserve-3d);
	position: relative;
}

/* hide back of pane during swap */
.front, .back {
	@include backface-visibility();
	position: absolute;
	top: 0;
	left: 0;
}

/* front pane, placed above back */
.front {
	z-index: 2;
}

/* back, initially hidden pane */
.back {
  @include transform-rotateY(180deg);
}

.shadowed {
  @include shadow($shadow-offsetX, $shadow-offsetY, $shadow-blur, $shadow-color);
}

            
          
!
999px
Loading ..................

Console