css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  h1 Custom Carousel
  h6 ( click slides or press left & right arrow keys )
  a(href="https://github.com/cmdeveloped" target="_blank")
    i(class='fab fa-github')
  a(href="https://twitter.com/collinscode_" target="_blank")
    i(class='fab fa-twitter')
  a(href="https://codepen.io/collinscode" target="_blank")
    i(class='fab fa-codepen')
  a(href="https://linkedin.com/in/cmdeveloped" target="_blank")
    i(class='fab fa-linkedin')

  - for(var x = 0; x < 9; x++)

              flexbox(a, b)
  display flex
  align-items a
  justify-content b
gradient(a, b, c)
  background b
  background linear-gradient(a, b, c)
color1 = #2E5266
color2 = #6E8898
color3 = #9FB1BC
color4 = #D3D0CB

  min-height 100vh
  flexbox(center, center)
  gradient(to bottom, #ECE9E6, #FFF)
    width 100%
    flexbox(center, center)
    flex-direction column
    font-family 'Quicksand', sans-serif
    overflow-x hidden
    position relative
    top -2.5rem
      text-align center
      color color1
      margin-bottom 3rem
        margin-bottom 0
        margin 0
        margin 0
        color color1
        display inline-block
          margin-right 0.5rem
          font-size 1.5rem
          padding 0.5rem
          margin-top 0.5rem

  flexbox(center, center)
  position relative
    height 20rem
    width 12rem
    position relative
    z-index 1
    transform scale(0.6) translateY(-2rem)
    opacity 0
    cursor pointer
    pointer-events none
    gradient(to top, color1, color2)
    transition 1s
      content ''
      position absolute
      height 2px
      width 100%
      border-radius 100%
      background-color rgba(0,0,0,0.3)
      bottom -5rem
      filter blur(4px)
    for val, i in (1..10)
          content '' + i + ''
          position absolute
          top 50%
          left 50%
          transform translateX(-50%) translateY(-50%)
          font-size 3rem
          font-weight 300
          color white
    z-index 3
    transform scale(1) translateY(0) translateX(0)
    opacity 1
    pointer-events auto
    transition 1s
  .ui-card.prev, .ui-card.next
    z-index 2
    transform scale(0.8) translateY(-1rem) translateX(0)
    opacity 0.6
    pointer-events auto
    transition 1s
              $num = $('.ui-card').length;
$even = $num / 2;
$odd = ($num + 1) / 2;

if ($num % 2 == 0) {
  $('.ui-card:nth-child(' + $even + ')').addClass('active');
  $('.ui-card:nth-child(' + $even + ')').prev().addClass('prev');
  $('.ui-card:nth-child(' + $even + ')').next().addClass('next');
} else {
  $('.ui-card:nth-child(' + $odd + ')').addClass('active');
  $('.ui-card:nth-child(' + $odd + ')').prev().addClass('prev');
  $('.ui-card:nth-child(' + $odd + ')').next().addClass('next');

$('.ui-card').click(function() {
  $slide = $('.active').width();
  if ($(this).hasClass('next')) {
    $('.container').stop(false, true).animate({left: '-=' + $slide});
  } else if ($(this).hasClass('prev')) {
    $('.container').stop(false, true).animate({left: '+=' + $slide});
  $(this).removeClass('prev next');
  $(this).siblings().removeClass('prev active next');

// Keyboard nav
$('html body').keydown(function(e) {
  if (e.keyCode == 37) { // left
  else if (e.keyCode == 39) { // right
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................