css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              label for="animation-picker" Select animation:
select id="animation-picker"
  optgroup label='Wave'
    option value='wave' selected='' Wave
    option value='reversewave' Reverse Wave
  optgroup label='Pulse'
    option value='pulse' Pulse
    option value='boxpulse' Boxpulse
    option value='dotpulse' Dotpulse
  optgroup label='Line'
    option value='vline' Vertical Line
    option value='hline' Horizontal Line
    option value='neline' Diagonal Line
  optgroup label='Fade'
    option value='vfade' Vertical Fade
    option value='hfade' Horizontal Fade
    option value='nefade' Diagonal Fade
    option value='rfade' Ripple Fade
  optgroup label='Ripple'
    option value='rippleout' Ripple Out
    option value='ripplein' Ripple In

.grid.wave
  - for i in 1..121
    div
            
          
!
            
              @import compass
@import "compass/layout"

$divs: 121
$side: 24px
$gutter: 6px
$columns: 11
$rows: $divs / $columns
$gridwidth: $columns * ($side + $gutter)
$fade: 4s

$default: #181818
$accent: #2ecc71

=animate($animation, $duration, $delay: 0s)
  animation: $animation $duration ease-in-out $delay infinite
  -webkit-animation: $animation $duration ease-in-out $delay infinite
    
@keyframes pulse
  50%
    background: $accent
@-webkit-keyframes pulse
  50%
    background: $accent
  
@keyframes flash
  20%
    background: $accent
  40%
    background: $default
@-webkit-keyframes flash
  20%
    background: $accent
  40%
    background: $default
  
html
  background: #111
  
label, #animation-picker
  display: block
  margin: 24px
  font: bold 12px sans-serif
  color: #bbb
  
  
#animation-picker
  height: 36px
  width: $gridwidth / 2
  margin-top: -22px
  border: none
  outline: none
  font-weight: normal
  background: #282828

.grid
  +stretch(0)
  height: $rows * ($side + $gutter)
  width: $gridwidth
  margin: auto
  font-size: 0
  
  div
    display: inline-block
    height: $side
    width: $side
    margin: $gutter / 2
    background: $default
      
// WAVE
    
.wave div
  @for $i from 1 through $divs
    &:nth-child(#{$i})
      +animate(pulse, 3s, 3s*($i / $divs))
              
.reversewave div
  @for $i from 1 through $divs
    &:nth-child(#{$i})
      +animate( pulse, 3s, 3s*(-$i / $divs))
        
// FLASH
    
.pulse div  
  +animate(pulse, 2s)
    
.boxpulse div
  &:nth-child(-n + #{$columns}),
  &:nth-child(n + #{$divs + 1 - $columns}),
  &:nth-child(#{$columns}n),
  &:nth-child(#{$columns}n + 1)
    +animate(pulse, 2s)
      
.dotpulse div
  &:nth-child(#{ceil($divs / 2)})
    +animate(pulse, 2s)

// LINES

.hline div
  @for $i from 0 through $rows
    $start: $i * $rows + 1
    &:nth-child(n + #{$start}):nth-child(-n + #{$start + $rows})
      +animate(flash, 1s, 1s*($i / $rows))
        
.vline div
  @for $i from 0 through $columns
    &:nth-child(#{$columns}n + #{$i})
      +animate(flash, 1s, 1s*($i / $rows))
        
.neline div
  @for $m from 0 to $rows
    @for $n from 1 through $columns
      &:nth-child(#{$n + $m * $columns})
        +animate(flash, 1s, 1s*(($m + $n) / $rows))
          
// FADE

.vfade div
  @for $i from 0 through $rows
    $start: $i * $rows + 1
    &:nth-child(n + #{$start}):nth-child(-n + #{$start + $rows})
      +animate(pulse, .5s * $rows, 1s*($i / $rows))
        
.hfade div
  @for $i from 0 through $columns
    &:nth-child(#{$columns}n + #{$i})
      +animate(pulse, .5s * $rows, 1s*($i / $rows))
        
.nefade div
  @for $m from 0 to $rows
    @for $n from 1 through $columns
      &:nth-child(#{$n + $m * $columns})
        +animate(pulse, .5s * $rows, 1s*(($m + $n) / $rows))
          
.rfade div
  +animate(pulse, .5s * $rows)
  $levels: floor($rows / 2)
  @for $m from 1 through $levels
    $reach: ($levels - $m) * 2
    @for $n from 0 through $reach
      $start: $m * $columns + 1 + $m + $n * $columns
      &:nth-child(n + #{$start}):nth-child(-n + #{$start + $reach})
        +animate(pulse, .5s * $rows, #{- 2s * $m / ($levels + 1)})
        
// RIPPLE

.rippleout div
  +animate(flash, 2s)
  $levels: floor($rows / 2)
  @for $m from 1 through $levels
    $reach: ($levels - $m) * 2
    @for $n from 0 through $reach
      $start: $m * $columns + 1 + $m + $n * $columns
      &:nth-child(n + #{$start}):nth-child(-n + #{$start + $reach})
        +animate(flash, 2s, #{- 2s * $m / ($levels + 1)})
          
.ripplein div
  +animate(flash, 2s)
  $levels: floor($rows / 2)
  @for $m from 1 through $levels
    $reach: ($levels - $m) * 2
    @for $n from 0 through $reach
      $start: $m * $columns + 1 + $m + $n * $columns
      &:nth-child(n + #{$start}):nth-child(-n + #{$start + $reach})
        +animate(flash, 2s, #{2s * $m / ($levels + 1)})
            
          
!
            
              gridWidth = $('.grid').width()

$('select').change () ->
  $grid = $('.grid')
  $grid.removeClass().width(gridWidth).addClass "grid #{$(this).val()}"
  
# width is changed to trigger a document reflow, thereby resetting all animations
            
          
!
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