Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                    <body style="width: 100%; margin-right: auto; margin-left: auto;">
      <div class="main">
        <!-- Passienja container, set your desired devices -->
        <div class="container passienja desktop tablet mobile">
          <div class="col">
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>        
            </div>
          </div>
          <div class="col">
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p> 
            </div>
          </div>
          <div class="col" >
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
          <div class="col">
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
          <div class="col" >
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
          <div class="col" >
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
          <div class="col">
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
          <div class="col">
            <div class="front"> 
              <p> Front Side </p>
            </div>
            <div class="back"> 
              <p> Back Side </p>
            </div>
          </div>
        </div>
      </div>
    </body>
              
            
!

CSS

              
                //Mixins
@mixin prefix($element, $value) {
  -moz-#{$element}: $value;
  -o-#{$element}: $value;
  -ms-#{$element}: $value;
  -webkit-#{$element}: $value;
  #{$element}: $value;
}

//Helpers
%center {
  margin-left: auto;
  margin-right: auto;
}

/* General Styles*/
.main {
  @extend %center;
  max-width: 1300px;
  margin-top: 5%;
  height: 500px;
}
.col {
  @extend %center;
  float: left;
  margin-bottom: 2.5%;
  padding-left: 2.5%;
  padding-right: 2.5%;
}
.front {
  text-align: center;
  background-color: #000000;
  color: #ffffff;
  width: 260px;
  height: 320px;
}
.back {
  text-align: center;
  background-color: #ff0000;
  color: #ffffff;
  width: 260px;
  height: 320px;
  max-width: 260px;
}
p {
  padding-top: 45%;
  font-size: 40px;
}


/*Mobile Passienja Flipper*/
.mobile {
  .flip-container {
    @include prefix(perspective, 1000);
    @include prefix(transform-style, preserve-3d);
  }
  .flip-container.hover {
    .back {
      @include prefix(transform, rotateY(0deg));
    }
    .front {
      @include prefix(transform, rotateY(180deg));
    }
  }
  .flipper {
    @include prefix(transition, 0.6s);
    @include prefix(transform-style, preserve-3d);
    position: relative;
  }
  .front {
    @include prefix(backface-visibility, hidden);
    @include prefix(transition, 0.6s);
    @include prefix(transform-style, preserve-3d);
    @include prefix(transform, rotateY(0deg));
    z-index: 2;
  }
  .back {
    @include prefix(backface-visibility, hidden);
    @include prefix(transition, 0.6s);
    @include prefix(transform-style, preserve-3d);
    @include prefix(transform, rotateY(180deg));
    position: absolute;
    text-align: center;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}
/*Tablet Passienja Flipper*/
@media (min-width: 480px) {
  .tablet {
    .flip-container {
      @include prefix(perspective, 1000);
      @include prefix(transform-style, preserve-3d);
    }
    .flip-container.hover {
      .back {
        @include prefix(transform, rotateY(0deg));
      }
      .front {
        @include prefix(transform, rotateY(180deg));
      }
    }
    .flipper {
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      position: relative;
    }
    .front {
      @include prefix(backface-visibility, hidden);
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      @include prefix(transform, rotateY(0deg));
      z-index: 2;
    }
    .back {
      @include prefix(backface-visibility, hidden);
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      @include prefix(transform, rotateY(180deg));
      position: absolute;
      text-align: center;
      border-left: 15px solid transparent;
      border-right: 15px solid transparent;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }
}
/*Desktop Passienja Flipper*/
@media (min-width: 1025px) {
  .desktop {
    .flip-container {
      @include prefix(perspective, 1000);
      @include prefix(transform-style, preserve-3d);
    }
    .flip-container.hover {
      .back {
        @include prefix(transform, rotateY(0deg));
      }
      .front {
        @include prefix(transform, rotateY(180deg));
      }
    }
    .flipper {
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      position: relative;
    }
    .front {
      @include prefix(backface-visibility, hidden);
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      @include prefix(transform, rotateY(0deg));
      z-index: 2;
    }
    .back {
      @include prefix(backface-visibility, hidden);
      @include prefix(transition, 0.6s);
      @include prefix(transform-style, preserve-3d);
      @include prefix(transform, rotateY(180deg));
      position: absolute;
      text-align: center;
      border-left: 15px solid transparent;
      border-right: 15px solid transparent;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }
}
              
            
!

JS

              
                const passienja = $(".passienja");
const flip = $(passienja).children(); //Adds flip classes to desired elements

$.each(flip, () => {
  $(flip).addClass("flip-container flipper");
});
$(document).ready(() => {
  setTimeout(() => {
    function log(i) {
      $(flip[i]).toggleClass("hover");

      if (i < flip.length) {
        setTimeout(() => {
          i++;
          log(i); //Set your desired flip start delay in ms
        }, 200);
      }
    }

    log(0); //Set your desired flip interval in ms
  }, 100);
});
              
            
!
999px

Console