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.

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

            
              #CrossFade
  each img in [1043,1039,1017,929] 
    img(src='//unsplash.it/1600/900?image='+img, alt="img")
  .intro
    h1 Lorem ipsum dolor sit amet
    p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis impedit facilis nesciunt quam vitae voluptatibus ullam vero.
            
          
!
            
              *
  margin 0
  padding 0
  box-sizing border-box
  

:root
  font-size calc(.5vw + 1vh + .5vmin)
body
  font 100 50%/1.5 'Roboto', sans-serif
  
.intro
  position relative
  margin 2em
  padding .2em .6em
  cursor pointer
  // &:hover
  //   background rgba(96, 125, 139, 0.5);

  
  color #FFF
  font-size 2em
  max-width 26em
  h1
    margin-bottom .5em
    line-height 1
    font-weight 100
  
//===== #CrossFade =======

#CrossFade
  background #FFF //no flash
  
  display flex
  align-items flex-end
  
  height 100vh
  overflow hidden
  position relative
  
  img
    position absolute
    min-width 100%
    min-height 100%
    height auto
    background #000
    
    
    backface-visibility hidden
    opacity 0    
    transform scale(1.4) rotate(12deg)

    animation CrossFade 24s infinite
    &:nth-child(3)
      animation-delay 6s
    &:nth-child(2)
      animation-delay 12s
    &:nth-child(1)
      animation-delay 18s
    
@keyframes CrossFade
  25%
    opacity 1
    transform scale(1) rotate(0)
  40%
    opacity 0   
  
    
 
//===== #CrossFadeMixin =======
/* 

$duration = 12
$slides = 4
$step = $duration/$slides
setDelayRevers($duration, $slides)
  
  for index in (2..$slides)
    &:nth-child({index -1}) 
      animation-delay ($step*index)s

#CrossFade
  height 100vh
  overflow hidden
  position relative
  
  display flex
  img
    align-self center
    position absolute
    
    min-width 100%
    min-height 100%
    height auto
    
    backface-visibility hidden
    opacity 0
  
    transform scale(1.4) rotate(12deg)
    animation CrossFade ($duration)s infinite 
    setDelayRevers($duration, $slides)   
@keyframes CrossFade
  25%
    opacity 1
    transform scale(1) rotate(0)
  40%
    opacity 0
    
*/   

            
          
!
999px
🕑 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 ..................

Console