123

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.

            
              <!-- desing https://dribbble.com/shots/1899530-Jumping-Squares -->
<div id="mirror">Change direction</div>

<div class="loading">

  <div class="squareXS"></div>
  <div class="squareXL"></div>

</div>

            
          
!
            
              .loading
  position absolute
  top 50%
  left 50%
  width 256px
  height 256px
  margin -128px 0 0 -128px
  &.mirror
    transform scale(-1, 1)
  &:after
    content ''
    position absolute
    width 64px
    height 12px
    top 205px
    left 96px
    background rgba(0,0,0,.05)
    border-radius 50%
    animation shadow 1.25s linear infinite 

.squareXL
  position absolute
  z-index 1
  width 64px
  height 64px
  top 146px
  left 96px
  background #F53FC7
  border-radius 2px
  animation cubexl 1.25s linear infinite
  
.squareXS
  position absolute
  width 32px
  height 32px
  top 114px
  left 112px
  background #1C56FB
  border-radius 2px
  animation cubexs 1.25s linear infinite

@keyframes cubexl
  0%
    width 128px
    height 32px
    transform translateX(-32px) translateY(35px) rotate(0deg)
  5%
    width 128px
    height 32px
    transform translateX(-32px) translateY(35px) rotate(0deg)
  22%
    transform translateX(0) translateY(0) rotate(0deg)
  25%
    width 64px
    height 64px
    transform translateX(0) translateY(-10px) rotate(0deg)
  35%
    transform translateX(0) translateY(-90px) rotate(30deg)
  45%
    transform translateX(0) translateY(-130px) rotate(60deg)
  50%
    transform translateX(0) translateY(-145px) rotate(75deg)
  55%
    transform translateX(0) translateY(-150px) rotate(90deg)
  60%
    transform translateX(0) translateY(-140px) rotate(105deg)
  65%
    transform translateX(0) translateY(-130px) rotate(120deg)
  75%
    transform translateX(0) translateY(-90px) rotate(150deg)
  85%
    width 64px
    height 64px
    transform translateX(0) translateY(0) rotate(180deg)
  100%
    width 128px
    height 32px
    transform translateX(-32px) translateY(35px) rotate(180deg)

@keyframes cubexs
  0%
    width 64px
    height 16px
    transform translateX(-16px) translateY(51px) rotate(0deg)
  5%
    width 64px
    height 16px
    transform translateX(-16px) translateY(51px) rotate(0deg);
  22%
    transform translateX(0) translateY(3px) rotate(0deg); 
  25%
    width 32px
    height 32px
    transform translateX(0) translateY(-15px) rotate(0deg);
  35%
    transform translateX(0) translateY(-135px) rotate(-60deg); 
  45%
    transform translateX(0) translateY(-195px) rotate(-120deg)
  50%
    transform translateX(0) translateY(-215px) rotate(-150deg)
  55%
    transform translateX(0) translateY(-225px) rotate(-180deg)
  60%
    transform translateX(0) translateY(-215px) rotate(-210deg)
  65%
    transform translateX(0) translateY(-195px) rotate(-240deg)
  75%
    transform translateX(0) translateY(-135px) rotate(-300deg)
  85%
    width 32px
    height 32px
    transform translateX(0) translateY(0) rotate(-360deg)
  100%
    width 64px
    height 16px
    transform translateX(-16px) translateY(51px) rotate(-360deg)

@keyframes shadow
  0%
    transform scale(2.5,1)
  30%
    transform scale(1.5,1)
  55%
    transform scale(.8,.8)
  85%
    transform scale(1.5,1)
  100%
    transform scale(2.5,1)
    
#mirror
  position absolute
  bottom 10px
  left 50%
  transform translateX(-50%)
  font-family monospace
  text-transform uppercase
  font-size 15px
  padding 10px
  color #11256C
  cursor pointer
  user-select none
  &:active
    transform translate(-50%,1px)
  
body
  background #FFF9EB url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI4MHB4IiBoZWlnaHQ9IjgwcHgiIHZpZXdCb3g9IjAgMCA4MCA4MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5BcnRib2FyZEAyeDwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9IkFydGJvYXJkIiBmaWxsPSIjQ0RDMUEwIj4gICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsIiBjeD0iNzgiIGN5PSI0MCIgcj0iMiI+PC9jaXJjbGU+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=') repeat top left
  background-size 40px
            
          
!
            
              $("#mirror").click(function() {
  $(".loading").toggleClass("mirror");
});
            
          
!
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.

Console