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

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

CSS

              
                *
  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
    
*/   

              
            
!

JS

              
                
              
            
!
999px

Console