Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <div class="wrapper">
  <svg class="header" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
    <polygon fill="white" points="0,0 100,100 0,100"/>
  </svg>
  <div class="card-container">
    <div class="card-body">
      <div class="side side-back">
        <div class="container-fluid">
          <div class="row">
            <div class="product-image col-5">
              <img src="https://i.imgur.com/c1DrURu.png" alt="Shoes" />
            </div>
            <div class="features col-7">
              <h2>Features</h2>
              <ul>
                <li>
                  M Select™ DRY seals out water and lets moisture escape so you stay dry when you're on the move 
                </li>
                <li>
                Performance suede leather and mesh upper
                </li>
                <li>
                Bellows, closed-cell foam tongue keeps moisture and debris out 
                </li>
                <li>
                Protective rubber toe cap 
                </li>
                <li>
                Breathable mesh lining 
                </li>
                <li>
                Molded nylon arch shank 
                </li>
                <li>
                Merrell air cushion in the heel absorbs shock and adds stability 
                </li>
                <li>
                Weight: 2lbs 1oz / 940G
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="side side-front">
        <div class="container-fluid">
          <div class="row">
            <div class="product-image col-12 col-lg-5">
              <img src="https://i.imgur.com/c1DrURu.png" alt="Shoes" />
            </div>
            <div class="content col-12 col-lg-7">
              <h2>Waterproof Hiking Shoe</h2>
              <div class="price-rating">
                <div class="price">
                  <h3>Price:</h3>
                  <p>$99.99</p>
                </div>
                <div class="rating">
                  <h3>Rating: <span class="rating-text">4.5</span></h3>
                  <div id="rateYo"></div>
                </div>
              </div>
              <div class="details">
                <p>
                Experience out-of-the-box comfort in this waterproof hiker. With durable leathers, a supportive footbed, and Vibram® traction, all in a versatile package, you won't doubt why Moab stands for Mother-Of-All-Boots™.
                </p>
              </div>
              <div class="button">Add to Cart</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="flip">
    <div class="flip-button">
      <i class="flip-icon fa fa-angle-double-up" aria-hidden="true"></i>
    </div>
    <p>Flip</p>
  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Anton|News+Cycle:700|Roboto');

$yellow: #FDB933;
$card-bg-color: #FFFEE1;
$brown: #915F35;
$orange: #E57740;
$gray: #8D8D8D;
$flipTime: .7s;

html {
  font-size: 15px;
}

h3,
p,
ul {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
}

.wrapper {
  height: 900px;
  background: $yellow;
  position: relative;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  
}

svg.header {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50vw;
  z-index: 1;
}

/* Card Container & Body */

.card-container {
  width: 700px;
  height: 450px;
  border-radius: 5px;
  box-shadow: 0 0 50px rgba(0,0,0,.2);
  padding: 10px;
  perspective: 1000px;
  position: relative;
  transform-style: preserve-3d;
  transition: all $flipTime linear;
  z-index: 1;
  margin-top: 10px;
  margin-bottom: 70px;
  
  .card-body {
    width: 100%;
    height: 100%;
  }
  
}

/*- Card sides -*/
.side {
  width: 98%;
  height: 97.5%;
  backface-visibility: hidden;
  background: #FFFEE1;
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
  padding: 25px;
  position: absolute;
  top: 1.2%;
  left: 1%;
  
  h2 {
    color: $brown;
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    margin-bottom: 30px;
  }
  p,
  li {
    color: $gray;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
  }
  .container-fluid {
    height: 100%;
    .row {
      height: 100%;
    }
  }
}

/* Card-Sides */

.side-back {
  z-index: 4;
  transform: rotateX(180deg);
  .product-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    img {
      height: auto;
      width: 20%;
      margin-left: 10%;
    }
  }
}

.side-front {
  z-index: 2;
  
  .product-image {
    position: relative;
    img {
      position: absolute;
      left: -70%;
      top: 10%;
    }
  }
  
  .content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .price-rating {
    display: flex;
    justify-content: space-between;
    h3 {
      color: $brown;
      font-size: 1.2rem;
      font-family: 'News Cycle', sans-serif;
      text-transform: uppercase;
      span {
        color: $orange;
      }
    }
    .price,
    .rating {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .price p {
      font-size: 2rem;
      font-family: 'News Cycle', sans-serif;
      line-height: 2rem;
      color: $orange;
    }
    .rating .fa {
      font-size: 1.5rem;
      margin-right: 0;
      color: $orange;
    }
  }
  .details {
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid lighten($orange, 30%);
  }
  .button {
    margin-top: auto;
    border: 1px solid $orange;
    border-radius: 40px;
    color: $orange;
    cursor: pointer;
    display:block;
    padding: 15px;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    text-transform: uppercase;
    position: relative;
    transition: all .3s linear;
    overflow: hidden;
    z-index: 3;
    &:before {
      position: absolute;
      top: 0%;
      left: -160%;
      width: 150%;
      height: 100%;
      background: $orange;
      content: ' ';
      transition: all .4s ease-in;
      transform: skewX(60deg);
      z-index: -1;
    }
    &:hover {
      color: #fff;
    }
    &:hover:before {
      left: -30%;
    }
  }
}

/* Flip Button */

.flip {
  color: $orange;
  z-index:2;
  display:flex;
  flex-direction: column;
  align-items: center;
  .flip-button {
    height: 60px;
    width: 60px;
    border: 1px solid $orange;
    border-radius: 50%;
    text-align: center;
    padding-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all $flipTime ease;
    .fa {
      font-size: 2rem;
      line-height: 1rem;
      margin-bottom: 10px;
    }
    &:hover {
      background: $orange;
      color: #fff;
    }
  }
  p {
    margin-top: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
  }
}

/* Flipping */

.flipped {
  transform: rotateX(180deg);
}

.disappear {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in, visibility .75s linear;
}

/* Rating Overrides */
.jq-ry-container {
    padding: 0;
}

@media (max-width: 992px) {
  
  .card-container {
      width: 400px;
      height: 600px;
  }
  
  .side-front .product-image img {
      position: static;
      height: 200px;
  }
  
  .side-front .product-image {
    display: flex;
    justify-content: center;
  }
  
  .side-front .content {
    display: flex;
    flex-direction: column;
    height: auto;
  }
}
              
            
!

JS

              
                // Inspired by this cool shot of Razvan Hosu:
// https://dribbble.com/shots/3366262-Product-presentation

function toggleFlip() {
  this.classList.toggle('flipped');
  
  var cardContainer = document.querySelector('.card-container');
  cardContainer.classList.toggle('flipped');
  
  var sideFront = document.querySelector('.side-front');
  sideFront.classList.toggle('disappear');
}

var flipButton = document.querySelector('.flip-button');

flipButton.addEventListener('click', toggleFlip);


// Rating jQuery Plugin

$(function () {
 
  $("#rateYo").rateYo({
    rating: 4.5,
    starWidth: "25px",
    normalFill: "#f7f3cd"
  }).on("rateyo.change", function (e, data) {
    var rating = data.rating;
    $('.rating-text').text(rating);
  });
  
});

              
            
!
999px

Console