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.

            
              

<div >
    <svg viewBox="0 0 200 130" width="200" class="row1 col3">
        <polygon fill="#ff0000" points="0,57.78 100,0 200,57.77 100.01,115.56 	"/>
        <polygon fill="#E6E7E8" points="0,57.78 0,72.22 100,130 100.01,115.56 "/>
        <polygon fill="#D1D3D4" points="100.01,115.56 200,57.77 200,72.23 100,130 "/>
    </svg>
    <svg  viewBox="0 0 200 130" width="200" class="row2 col4">
        <polygon fill="#00ff00" points="0,57.78 100,0 200,57.77 100.01,115.56 	"/>
        <polygon fill="#E6E7E8" points="0,57.78 0,72.22 100,130 100.01,115.56 "/>
        <polygon fill="#D1D3D4" points="100.01,115.56 200,57.77 200,72.23 100,130 "/>
    </svg>
    <svg  viewBox="0 0 200 130" width="200" class="row3 col3">
        <polygon fill="#ffff00" points="0,57.78 100,0 200,57.77 100.01,115.56 	"/>
        <polygon fill="#E6E7E8" points="0,57.78 0,72.22 100,130 100.01,115.56 "/>
        <polygon fill="#D1D3D4" points="100.01,115.56 200,57.77 200,72.23 100,130 "/>
    </svg>
    <svg  viewBox="0 0 200 130" width="200" class="row4 col2">
        <polygon fill="#0000ff" points="0,57.78 100,0 200,57.77 100.01,115.56 	"/>
        <polygon fill="#E6E7E8" points="0,57.78 0,72.22 100,130 100.01,115.56 "/>
        <polygon fill="#D1D3D4" points="100.01,115.56 200,57.77 200,72.23 100,130 "/>
    </svg>
    <svg  viewBox="0 0 200 130" width="200" class="row4 col4">
        <polygon fill="#00ffff" points="0,57.78 100,0 200,57.77 100.01,115.56 	"/>
        <polygon fill="#E6E7E8" points="0,57.78 0,72.22 100,130 100.01,115.56 "/>
        <polygon fill="#D1D3D4" points="100.01,115.56 200,57.77 200,72.23 100,130 "/>
    </svg>
</div>
            
          
!
            
              div {
  position: relative;
}
svg {
  position: absolute;
  transition: all .4s cubic-bezier(0.75, 0, 0.5, 1);
}
.row1 { top: 0; }
.row2 { top: 59px; }
.row3 { top: 118px; }
.row4 { top: 177px; }
.row5 { top: 236px; }

.col1 { left: 0; }
.col2 { left: 101px; }
.col3 { left: 202px; }
.col4 { left: 303px; }
.col5 { left: 404px; }

.row1.col1 { z-index: 14; }
.row1.col2 { z-index: 13; }
.row1.col3 { z-index: 12; }
.row1.col4 { z-index: 11; }
.row1.col5 { z-index: 10; }

.row2.col1 { z-index: 24; }
.row2.col2 { z-index: 23; }
.row2.col3 { z-index: 22; }
.row2.col4 { z-index: 21; }
.row2.col5 { z-index: 20; }

.row3.col1 { z-index: 34; }
.row3.col2 { z-index: 33; }
.row3.col3 { z-index: 32; }
.row3.col4 { z-index: 31; }
.row3.col5 { z-index: 30; }

.row4.col1 { z-index: 44; }
.row4.col2 { z-index: 43; }
.row4.col3 { z-index: 42; }
.row4.col4 { z-index: 41; }
.row4.col5 { z-index: 40; }

.row5.col1 { z-index: 54; }
.row5.col2 { z-index: 53; }
.row5.col3 { z-index: 52; }
.row5.col4 { z-index: 51; }
.row5.col5 { z-index: 50; }

            
          
!
            
              
var SEQUENCE_DELAY = 2000;
var MOVE_DELAY = 300;
var moveSequence = [
  [
    {selector: '.row4.col4', target: 'row5 col3'},
    {selector: '.row3.col3', target: 'row4 col4'},
    {selector: '.row2.col4', target: 'row3 col3'},
    {selector: '.row1.col3', target: 'row2 col4'}
  ],
  [
    {selector: '.row4.col2', target: 'row3 col1'},
    {selector: '.row5.col3', target: 'row4 col2'},
    {selector: '.row2.col4', target: 'row3 col5'},
    {selector: '.row3.col1', target: 'row2 col2'}
  ],
  [
    {selector: '.row2.col2', target: 'row1 col3'},
    {selector: '.row3.col3', target: 'row2 col4'},
    {selector: '.row4.col4', target: 'row3 col3'},
    {selector: '.row3.col5', target: 'row4 col4'}
  ]
];

function triggerMove() {
  var moves = moveSequence.shift(),
      delay = 0;

  moveSequence.push(moves);

  for (var i = 0; i < moves.length; i++) {
    setTimeout(function(item, target) {
      $(item).removeClass().addClass(target);
    }, delay, moves[i]['selector'], moves[i]['target']);
    delay += MOVE_DELAY;
  }

  setTimeout(triggerMove, delay + SEQUENCE_DELAY);

}

triggerMove();
            
          
!
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