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="card">
  <div class="slides">
    <div slide-id="1" slide-color="#D18B49" class="slide active">
      <div class="thumbnail"><img src="https://www.jqueryscript.net/demo/Nice-Material-Inspried-Card-Slider-with-jQuery-CSS3/Stag.svg"/></div>
      <h1 class="title">The Magnificent Stag</h1>
      <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
    </div>
    <div slide-id="2" slide-color="#542F13" class="slide">
      <div class="thumbnail"><img src="https://www.jqueryscript.net/demo/Nice-Material-Inspried-Card-Slider-with-jQuery-CSS3/Bear.svg"/></div>
      <h1 class="title">The Courageous Bear</h1>
      <p class="description">Nam tristique porttitor erat sed convallis. Donec id iaculis massa, id pulvinar odio. </p>
    </div>
    <div slide-id="3" slide-color="#A5AAAE" class="slide">
      <div class="thumbnail"><img src="https://www.jqueryscript.net/demo/Nice-Material-Inspried-Card-Slider-with-jQuery-CSS3/Mouse.svg"/></div>
      <h1 class="title">The Sneaky Mouse</h1>
      <p class="description">Ut condimentum facilisis turpis in tincidunt.</p>
    </div>
    <div slide-id="4" slide-color="#ED8D1F" class="slide">
      <div class="thumbnail"><img src="https://www.jqueryscript.net/demo/Nice-Material-Inspried-Card-Slider-with-jQuery-CSS3/Fox.svg"/></div>
      <h1 class="title">The Cunning Fox</h1>
      <p class="description"> Nulla facilisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin vulputate massa ut iaculis eleifend. </p>
    </div>
    <div slide-id="5" slide-color="#C4C8CB" class="slide">
      <div class="thumbnail"><img src="https://www.jqueryscript.net/demo/Nice-Material-Inspried-Card-Slider-with-jQuery-CSS3/Rabbit.svg"/></div>
      <h1 class="title">The Jumpy Rabbit</h1>
      <p class="description">Phasellus accumsan nisi ac ex ultrices dignissim. </p>
    </div>
  </div>
  <div class="footer"><a id="prev" href="#" ripple="" ripple-color="#666666" class="btn">Prev</a><a id="next" href="#" ripple="" ripple-color="#666666" class="btn">Next</a></div>
</div>
              
            
!

CSS

              
                body {
  background: #D18B49;
  color: rgba(0, 0, 0, 0.6);
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  line-height: 1.6em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-transition: 0.5s ease;
  transition: 0.5s ease;
}

.btn {
  border-radius: 2px;
  padding: 8px 12px;
  color: #D18B49;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  -webkit-transition: 0.5s ease;
  transition: 0.5s ease;
}

.card {
  background: #FFFFFF;
  max-width: 400px;
  margin: 50px auto;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  box-sizing: border-box;
  padding: 48px;
  text-align: center;
}

.slides {
  position: relative;
  overflow: hidden;
  -webkit-transition: 0.5s ease;
  transition: 0.5s ease;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: 0.5s ease;
  transition: 0.5s ease;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

.thumbnail { margin: 0 0 48px; }

.title {
  margin: 0 0 12px;
  color: #D18B49;
  font-size: 24px;
  -webkit-transition: 0.5s ease;
  transition: 0.5s ease;
}

.description { margin: 0 0 48px; }

.footer {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin: 0 -12px -12px;
}
 [ripple] {
 z-index: 1;
 position: relative;
 overflow: hidden;
}

[ripple] .ripple {
  position: absolute;
  background: #FFFFFF;
  width: 60px;
  height: 60px;
  border-radius: 100%;
  -webkit-transform: scale(0);
  -ms-transform: scale(0);
  transform: scale(0);
  -webkit-animation: ripple 2s;
  animation: ripple 2s;
}
 @-webkit-keyframes
ripple {  0% {
 -webkit-transform: scale(0);
 transform: scale(0);
 opacity: 0.2;
}
 100% {
 -webkit-transform: scale(20);
 transform: scale(20);
 opacity: 0;
}
}
 @keyframes
ripple {  0% {
 -webkit-transform: scale(0);
 transform: scale(0);
 opacity: 0.2;
}
 100% {
 -webkit-transform: scale(20);
 transform: scale(20);
 opacity: 0;
}
}
              
            
!

JS

              
                $(document).ready(function() {
  var getslideHeight = $('.slide.active').height();

  $('.slides').css({
    height: getslideHeight
  });

  function calcslideHeight() {
    getslideHeight = $('.slide.active').height();

    $('.slides').css({
      height: getslideHeight
    });
  }

  function animateContentColor() {
    var getslideColor = $('.slide.active').attr('slide-color');

    $('body').css({
      background: getslideColor
    });

    $('.title').css({
      color: getslideColor
    });

    $('.btn').css({
      color: getslideColor
    });
  }

  var slideItem = $('.slide'),
    slideCurrentItem = slideItem.filter('.active');

  $('#next').on('click', function(e) {
    e.preventDefault();

    var nextItem = slideCurrentItem.next();

    slideCurrentItem.removeClass('active');

    if (nextItem.length) {

      slideCurrentItem = nextItem.addClass('active');
    } else {
      slideCurrentItem = slideItem.first().addClass('active');
    }

    calcslideHeight();
    animateContentColor();
  });

  $('#prev').on('click', function(e) {
    e.preventDefault();

    var prevItem = slideCurrentItem.prev();

    slideCurrentItem.removeClass('active');

    if (prevItem.length) {
      slideCurrentItem = prevItem.addClass('active');
    } else {
      slideCurrentItem = slideItem.last().addClass('active');
    }

    calcslideHeight();
    animateContentColor();
  });

  // Ripple
  $('[ripple]').on('click', function(e) {
    var rippleDiv = $('<div class="ripple" />'),
      rippleSize = 60,
      rippleOffset = $(this).offset(),
      rippleY = e.pageY - rippleOffset.top,
      rippleX = e.pageX - rippleOffset.left,
      ripple = $('.ripple');

    rippleDiv.css({
      top: rippleY - (rippleSize / 2),
      left: rippleX - (rippleSize / 2),
      background: $(this).attr("ripple-color")
    }).appendTo($(this));

    window.setTimeout(function() {
      rippleDiv.remove();
    }, 1900);
  });
});
              
            
!
999px

Console