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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div id="container">
  <h1>Click or Touch the Screen.</h1>
  <p>Click as fast as you can. <em>Try it on a touchscreen - it's even more fun.</em></p>
</div>
            
          
!
            
              * {
  user-select: none;
  cursor:default;
}

body,html {
  height:100%;
  font-family:helvetica neue,helvetica,arial,sans-serif;
}

h1,p {
  text-align:center;
  position:relative;
  z-index:1;
}

h1 {
  padding:50px 0;
  margin:0 50px;
  font-size:30px;
  line-height:30px;
  font-weight:200;
}

p {
  font-size:14px;
  font-weight:200;
  margin:0 50px;
  color:#53646e;
  em {
    color:#42a6df;
  }
}

#container {
  position:relative;
  height:100%;
  width:100%;
  overflow:hidden;
  button {
    padding:20px;
    border:none;
    background:transparent;
    display:block;
    position:relative;
    z-index:3;
    margin:0 auto;
  }
}

.dot {
  height:2px;
  width:2px;
  border-radius:100%;
  position:absolute;
  z-index:0;
  animation:sploosh 3s cubic-bezier(0.165, 0.84, 0.44, 1);
  background:transparent;
}

@keyframes sploosh {
  0% {
    box-shadow:0 0 0 0px rgba(66,166,223,.7);
    background:rgba(66,166,223,.7);
  }
  100% {
    box-shadow:0 0 0 300px rgba(66,166,223,.0);
    background:rgba(66,166,223,.0);
  }
}
            
          
!
            
              // initial animation

$(window).ready(function(){
  setTimeout(function(){
    setTimeout(function(){
      $('#container').append('<div class="dot" style="top:50%;left:50%;"></div>')
    },900);
    setTimeout(function(){
      $('#container').append('<div class="dot" style="top:50%;left:50%;"></div>')
    },600);
    setTimeout(function(){
      $('#container').append('<div class="dot" style="top:50%;left:50%;"></div>')
    },300);
    setTimeout(function(){
      $('#container').append('<div class="dot" style="top:50%;left:50%;"></div>')
    },0);
    setTimeout(function(){
      $('#container .dot').remove();
    },2900);
  },1500);
});


// click animation

if (Modernizr.touch) {   
    $('#container').on('touchstart',function(e) {
      var left = e.originalEvent.touches[0].pageX;
      var top = e.originalEvent.touches[0].pageY;

      $(this).append('<div class="dot" style="top:'+top+'px;left:'+left+'px;"></div>')
      setTimeout(function(){
        $('#container .dot:first-of-type').remove();
      },3000);
    });
    document.body.addEventListener('touchmove',function(e){
        e.preventDefault();
    });
} else {   
    $('#container').on('mousedown',function(e) {
      var left = e.pageX;
      var top = e.pageY;

      $(this).append('<div class="dot" style="top:'+top+'px;left:'+left+'px;"></div>')
      setTimeout(function(){
        $('#container .dot:first-of-type').remove();
      },3000);
    }); 
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console