cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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.

            
              //- 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
            
          
!
            
              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
            
          
!
            
              $(".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
Loading ..................

Console