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

              
                //- If JS fails, first image is shown without any carousel controls

body
  .hero-wrap
    .hero.hero-1
    .hero.hero-2.hide
    .hero.hero-3.hide
              
            
!

CSS

              
                body
  display: flex
  align-items: center
  height: 100vh
  width: 100vw
  background: pink
  user-select: none

.hide
  display: none

.hero-wrap
  width:  500px
  height: 500px
  display: flex
  overflow: hidden
  margin: auto
  position: relative

  .slick-prev,
  .slick-next
    z-index: 9999
    flex-grow: 0
    flex-shrink: 1
    flex-basis: 10%
    align-self: center
    padding: 0 12px 10px 12px
    font-family: arial
    font-size: 60px
    color: white
    &:hover
      cursor: pointer
      background: blue
    
  .slick-prev
    order: 1
    margin-right: -40px
    text-align: right

  .slick-next
    order: 3
    margin-left: -40px
    text-align: left

  .slick-list
    order: 2
    width: 500px
    overflow: hidden
    flex-grow: 1
    flex-shrink: 0
    flex-basis: 80%
    z-index: -1    
    
  .slick-dots
    width: 100%
    position: absolute
    bottom: 20px
    left: 0
    z-index: 999
    text-align: center

    li
      color: white
      display: inline
      font-size: 30px
      opacity: 0.4
      &.slick-active
        opacity: 1
      & + li
        margin-left: 15px
      &:hover
        cursor: pointer
      
  .hero
    width: 100vw
    height: 100vh
    filter: grayscale(90%)

    background:
      position:  0 0
      color: pink
      blend-mode: color-burn
    
  .hero-1
    background-image: url('http://lorempixel.com/500/500/nature/3/')
  .hero-2
    background-image: url('http://lorempixel.com/500/500/nature/1/')
  .hero-3
    background-image: url('http://lorempixel.com/500/500/nature/6/')

  .slick-list,
  .slick-track,
  .slick-slide
    height: 100vh
    width: 100vw
    display: flex
              
            
!

JS

              
                $(".hero-wrap").slick({
    infinite: true,
    fade: true,
    speed: 300,
    autoplay: true,
    dots: true,
    nextArrow: '<small class="slick-next">&rarr;</small>',
    prevArrow: '<small class="slick-prev">&larr;</small>',
    customPaging : function(slider, i) {
      var thumb = $(slider.$slides[i]).data();
      // return '<a>'+(i+1)+'</a>';
      return '<a>&bull;</a>';
    },
});

              
            
!
999px

Console