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 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.

            
              %ul.slideshow
  %li
    %h3 The Seasons
    <!-- By Keven Law from Los Angeles, USA (Long Hot Summer......) [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons, http://commons.wikimedia.org/wiki/File%3AFlickr_-_law_keven_-_Long_Hot_Summer.......jpg -->
    %span Summer

  %li
    <!-- By http://www.ForestWander.com [CC-BY-SA-3.0-us (http://creativecommons.org/licenses/by-sa/3.0/us/deed.en)], via Wikimedia Commons, http://commons.wikimedia.org/wiki/File%3ARed-fall-tree-lake_-_West_Virginia_-_ForestWander.png -->
    %span Fall        

  %li
    <!-- By Valerii Tkachenko [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons, http://commons.wikimedia.org/wiki/File%3AWinter_wonderland_Austria_mountain_landscape_(8290712092).jpg -->
    %span Winter

  %li
    <!-- By Arman7 (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons, http://commons.wikimedia.org/wiki/File%3ABoroujerd_spring.jpg --> 
    %span Spring
            
          
!
            
              @import "bourbon";

html {
  min-height: 100%;
}

body {
  height: 100%;
}

// length of each slide in seconds
$animation-delay: 6s;

.slideshow {
  list-style: none;
  z-index: 1;
  li {
    span { 
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0px;
      left: 0px;
      color: transparent;
      background-size: cover;
      background-position: 50% 50%;
      background-repeat: none;
      opacity: 0;
      z-index: 0;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      // multiply slide duration by the total number of slides
      @include animation(imageAnimation $animation-delay * 4 linear infinite 0s);
    }
    h3 {
      position: absolute;
      text-align: center;
      z-index: 2;
      bottom: 150px;
      left: 0;
      right: 0;
      opacity: 0;
      font-size: em(65px);
      font-family: 'Josefin Sans', sans-serif;
      text-transform: uppercase;
      color: #fff;
      // multiply slide duration by the total number of slides
      @include animation(titleAnimation $animation-delay * 4 linear 1 0s);

      @media only screen and (min-width: 768px) {
        bottom: 30px;
        font-size: em(130px);
      }

      @media only screen and (min-width: 1024px) {
        font-size: em(175px);
      }
    }
  }
}

// add and remove new slides here, maintaning the animation-delay format
.slideshow li:nth-child(1) span { 
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/203277/summer-slide.jpg);
}
.slideshow li:nth-child(2) span { 
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/203277/fall-slide.jpg);
  @include animation-delay($animation-delay);
}
.slideshow li:nth-child(3) span { 
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/203277/winter-slide.jpg);
  @include animation-delay($animation-delay * 2);
}
.slideshow li:nth-child(4) span { 
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/203277/spring-slide.jpg);
  @include animation-delay($animation-delay * 3);
}

// animation for the slideshow images
@include keyframes(imageAnimation) {
  0% {
    opacity: 0;
    @include animation-timing-function(ease-in);
  }
  12.5% {
    opacity: 1;
    @include animation-timing-function(ease-out);
  }
  25% {
    opacity: 1;
  }
  37.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

// animation for the title
@include keyframes(titleAnimation) {
  0% {
    opacity: 0;
  }
  12.5% {
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  37.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

// modernizr is used to show the first slide as a fallback for when css animations are not supported
.no-cssanimations .slideshow li span {
  opacity: 1;
}
            
          
!
999px
Loading ..................

Console