cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <!--

Follow me on
Dribbble: https://dribbble.com/supahfunk
Twitter: https://twitter.com/supahfunk
Codepen: https://codepen.io/supah/

-->
<div class="shop-card">
  <div class="title">
    Nike Metcon 2
  </div>
  <div class="desc">
    Men's training shoe
  </div>
  <div class="slider">
    <figure data-color="#E24938, #A30F22">
      <img src="http://www.supah.it/dribbble/012/1.jpg" />
    </figure>
    <figure data-color="#6CD96A, #00986F">
      <img src="http://www.supah.it/dribbble/012/2.jpg" />
    </figure>
    <figure data-color="#4795D1, #006EB8">
      <img src="http://www.supah.it/dribbble/012/3.jpg" />
    </figure>
    <figure data-color="#292a2f, #131519">
      <img src="http://www.supah.it/dribbble/012/4.jpg" />
    </figure>
  </div>

  <div class="cta">
    <div class="price">$130</div>
    <button class="btn">Add to cart<span class="bg"></span></button>
  </div>
</div>
<div class="bg"></div>

            
          
!
            
              /*--------------------
Mixins
---------------------*/
@mixin center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/*--------------------
Body
---------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  font-family: 'Open Sans Condensed', sans-serif;
}

body {
  background: linear-gradient(15deg, #d33f34 50%, #a61322 50.1%);
}


/*--------------------
Shop Card
---------------------*/
.shop-card {
  @include center;
  width: 350px;
  background: #f5f5f5;
  box-shadow: 0 10px 20px rgba(0,0,0,.3);
  overflow: hidden;
  border-radius: 5px;
  padding: 25px;
  text-align: center;
  z-index: 2;

  figure {
    margin: 0;
    padding: 0;
    overflow: hidden;
    outline: none!important;

    & img {
      margin: -95px 0 -60px;
      width: 100%;
    }
  }

  .title {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 30px;
    color: #23211f;
    margin-bottom: 5px;
  }

  .desc {
    font-size: 17px;
    opacity: .8;
    margin-bottom: 3px;
  }

  .cta {
    padding: 20px 20px 5px;

    &::after {
      content: '';
      display: table;
      clear: both;
    }
  }

  .price {
    float: left;
    color: #FF3100;
    font-size: 22px;
    font-weight: 900;
    padding-top: 2px;
    transition: color .3s ease-in-out;
    margin-top: 4px;
  }

  .btn {
    position: relative;
    z-index: 1;
    float: right;
    display: inline-block;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    color: #FF3100;
    padding: 12px 18px;
    cursor: pointer;
    transition: all .3s ease-in-out;
    line-height: .95;
    border: none;
    background: none;
    outline: none;
    border: 1px solid #FF3100;
    border-radius: 20px;
    overflow: hidden;
    
    & .bg {
      width: 101%;
      height: 101%;
      display: block!important;
      z-index: -1;
      opacity: 0;
      transition: all .3s ease-in-out;
      background: linear-gradient(135deg, #a61322, #d33f34);
    }
    
    &:hover {
      color: #fff!important;
      border: 1px solid transparent!important;
      
      & .bg {
        opacity: 1;
      }
    }
    
  }

}


/*--------------------
Slick Dots
---------------------*/
.slick-dots {
  bottom: -30px;
  
  a {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
  }
  
  span {
    @include center;
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }

  circle {
    fill: none;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-dasharray: 39 39;
    stroke-dashoffset: 39;
    transition: all .9s ease-in-out;
    transition: stroke-dashoffset 0.5s;
  }

  .slick-active circle {
    stroke-dashoffset: 0;
  }
}


/*--------------------
Background
--------------------*/
.bg {
  @include center;
  width: 100%;
  height: 100%;
  background: linear-gradient(15deg, #d33f34 50%, #a61322 50.1%);
  z-index: 1;
  display: none;
}

            
          
!
            
              function background(c1, c2) {
  return {
    background: '-moz-linear-gradient(15deg, ' + c1 + ' 50%, ' + c2 + ' 50.1%)',
    background: '-o-linear-gradient(15deg, ' + c1 + ', ' + c2 + ' 50.1%)',
    background: '-webkit-linear-gradient(15deg, ' + c1 + ' 50%, ' + c2 + ')',
    background: '-ms-linear-gradient(15deg, ' + c1 + ' 50%, ' + c2 + ' 50.1%)',
    background: 'linear-gradient(15deg, ' + c1 + ' 50%,' + c2 + ' 50.1%)'
  }
}

function changeBg(c1, c2) {
  $('div.bg').css(background(c1, c2)).fadeIn(700, function() {
    $('body').css(background(c1, c2));
    $('.bg').hide();
  })
  $('span.bg').css({
    background: '-moz-linear-gradient(135deg, ' + c1 + ', ' + c2 + ')',
    background: '-o-linear-gradient(135deg, ' + c1 + ', ' + c2 + ')',
    background: '-webkit-linear-gradient(135deg, ' + c1 + ', ' + c2 + ')',
    background: '-ms-linear-gradient(135deg, ' + c1 + ', ' + c2 + ')',
    background: 'linear-gradient(135deg, ' + c1 + ',' + c2 + ')'
  });
}

$slider = $('.slider');

$slider.slick({
  arrows: false,
  dots: true,
  infinite: true,
  speed: 600,
  fade: true,
  focusOnSelect: true,
  customPaging: function(slider, i) {
    var color = $(slider.$slides[i]).data('color').split(',')[1];
    return '<a><svg width="100%" height="100%" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6.215" stroke="' + color + '"></circle></svg><span style="background:' + color + '"></span></a>';
  }
}).on('beforeChange', function(event, slick, currentSlide, nextSlide) {
  colors = $('figure', $slider).eq(nextSlide).data('color').split(',');
  color1 = colors[0];
  color2 = colors[1];
  $('.price, .btn').css({
    color: color1
  });
  changeBg(color1, color2);
  $('.btn').css({
    borderColor: color2
  });
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console