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

              
                <div class="container frame">
  <div class="bubble">
    <p class="text text1 current">YOUR MONEY OR YOUR LIFE!</p>
    <p class="text text2 text-right">MY LIFE</p>
    <p class="text text3">OK</p>
  </div>
  <div class="bubble2">
  <p>FUCK! I NEEDED THAT MONEY, BUT IT WAS AN "OR" STATEMENT</p>
  </div>
<div class="human thief">
  <div class="head"></div>
  <div class="hand left"></div>
  <div class="hand right"></div>
  <div class="body"></div>
</div>
<div class="human victim">
  <div class="head"></div>
  <div class="hand left"></div>
  <div class="hand right"></div>
  <div class="body"></div>
</div>
  
</div>

              
            
!

CSS

              
                body {
  background: #ddd;
  padding: 2em;
  font-family: 'Comic Sans MS';
  font-weight: bold;
}
.frame {
  margin: 0 auto;
  display: block;
  position: relative;
  height: 300px;
  width: 500px;
  border: 1em solid #fff;
  box-shadow: 0px 0 1px 1px #000;
  overflow: hidden;
}
.frame::before {
  content: '';
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  border: 1px solid #000;
  display: block;
}

.human > div,
.human .body::before,
.human .body::after {
  display: block;
  background: #000;
  position: absolute;
}
.human .hand {
  width: 50px;
  height: 10px;
}
.human .body {
  width: 30px;
  height: 100px;
  border-radius: 5px;
}
.human .body::before,
.human .body::after {
  content: '';
  width: 10px;
  height: 70px;
  top: calc(20% + 70px);
}
.human .body::before {
    left: calc(10% + 1px);
}
.human .body::after {
    left: calc(10% + 12px);
}

.human.thief .head {
  width: 40px;
  height: 50px;
  top: 20%;
  left: 10%;
  border-radius: 50%;
}
.human.thief .body {
  top: calc(20% + 50px);
  left: calc(10% + 5px);
}
.human.thief .hand.left {
  top: calc(20% + 70px);
  left: calc(10% - 30px);
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
}
.human.thief .hand.right {
  top: calc(20% + 60px);
  left: calc(10% + 30px);
  -webkit-transform: rotate(5deg);
          transform: rotate(5deg);
}
.human.thief .hand.right::before {
  content: '';
  display: block;
  width: 30px;
  height: 10px;
  background: #999;
  right: -15px;
  top: -10px;
  position: absolute;
}

.human.victim .head {
  width: 40px;
  height: 50px;
  top: 20%;
  right: 10%;
  border-radius: 50%;
}
.human.victim .body {
  top: calc(20% + 50px);
  right: calc(10% + 5px);
}
.human.victim .hand.left {
  top: calc(20% + 40px);
  right: calc(10% - 30px);
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
}
.human.victim .hand.right {
  top: calc(20% + 35px);
  right: calc(10% + 20px);
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
}
.human.victim .hand.right::before {
  content: '';
  display: block;
  width: 30px;
  height: 20px;
  background: green;
  left: -15px;
  top: -10px;
  z-index: 9999;
  position: absolute;
  -webkit-transform: rotate(-70deg);
          transform: rotate(-70deg);
  -webkit-animation: drop-money .5s ease-in-out 6.5s;
          animation: drop-money .5s ease-in-out 6.5s;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
@-webkit-keyframes drop-money {
  from {left: -20px;}
  to {left: -40px;}
}
@keyframes drop-money {
  from {left: -20px;}
  to {left: -40px;}
}

.bubble {
  position: absolute;
  display: block;
  top: 5%;
  background: #fff;
  padding: 1em;
  left: 50%;
  min-width: 200px;
  text-align: center;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  overflow: hidden;
  border-radius: 10px;
}

.bubble p {
  text-align: left;
  display: none;
  margin: 0;
}
.bubble p.text-right {
  text-align: right;
}
.bubble p.current {
 display: block;
}
.bubble2 {
  width: 300px;
  position: absolute;
  top: 5%;
  left: 5%;
  background: #fff;
  border-radius: 10px;
  padding: 1em;
  opacity: 0;
  -webkit-animation: last-bubble .1s linear 8s;
          animation: last-bubble .1s linear 8s;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
@-webkit-keyframes last-bubble {
  from {opacitty: 0;}
  to {opacity: 1;}
}
@keyframes last-bubble {
  from {opacitty: 0;}
  to {opacity: 1;}
}

.human.thief .hand.right::after {
  content: '';
  display: block;
  width: 10px;
  height: 4px;
  background: #666;
  position: absolute;
  z-index: -1;
  right: -10px;
  top: -7px;
  -webkit-animation: bullet .5s linear 6s;
          animation: bullet .5s linear 6s;
}
@-webkit-keyframes bullet {
    from {right: -10px;}
    to {right: -300px;}
}
@keyframes bullet {
    from {right: -10px;}
    to {right: -300px;}
}

.human.victim {
  position: absolute;
  right: 5%;
  top: 15%;
  -webkit-animation: dead .1s ease-out 6.5s;
          animation: dead .1s ease-out 6.5s;
      -webkit-animation-fill-mode: forwards;
              animation-fill-mode: forwards;
}
@-webkit-keyframes dead {
    from {
      -webkit-transform: none;
              transform: none;}
    to {
      top: 200px;
      -webkit-transform: rotate(90deg);
              transform: rotate(90deg);
  }
}
@keyframes dead {
    from {
      -webkit-transform: none;
              transform: none;}
    to {
      top: 200px;
      -webkit-transform: rotate(90deg);
              transform: rotate(90deg);
  }
}
.human.thief {
  -webkit-animation: leaving 2s ease-in 7s;
          animation: leaving 2s ease-in 7s;
     position: absolute;
  top: 46px;
  left: 46px;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
@-webkit-keyframes leaving {
  0% {
    -webkit-transform: none;
            transform: none;
  }
  20% {
    	-webkit-transform: scale(-1, 1);
    	        transform: scale(-1, 1);
    margin-left: 80px;
  }
  100% {
    margin-left: -100px;
    -webkit-transform: scale(-1, 1);
            transform: scale(-1, 1);
  }
}
@keyframes leaving {
  0% {
    -webkit-transform: none;
            transform: none;
  }
  20% {
    	-webkit-transform: scale(-1, 1);
    	        transform: scale(-1, 1);
    margin-left: 80px;
  }
  100% {
    margin-left: -100px;
    -webkit-transform: scale(-1, 1);
            transform: scale(-1, 1);
  }
}
.human.victim .body::before {
  -webkit-animation: dead-foot-right .3s linear 6.5s;
          animation: dead-foot-right .3s linear 6.5s;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
@-webkit-keyframes dead-foot-right {
  from {-webkit-transform: rotate(0);transform: rotate(0);}
  to {-webkit-transform: rotate(20deg);transform: rotate(20deg);left: -6px;}
}
@keyframes dead-foot-right {
  from {-webkit-transform: rotate(0);transform: rotate(0);}
  to {-webkit-transform: rotate(20deg);transform: rotate(20deg);left: -6px;}
}
.human.victim .body::after {
  -webkit-animation: dead-foot-left .3s linear 6.5s;
          animation: dead-foot-left .3s linear 6.5s;
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}
@-webkit-keyframes dead-foot-left {
  from {-webkit-transform: rotate(0);transform: rotate(0);}
  to {-webkit-transform: rotate(-20deg);transform: rotate(-20deg);left: 26px;}
}
@keyframes dead-foot-left {
  from {-webkit-transform: rotate(0);transform: rotate(0);}
  to {-webkit-transform: rotate(-20deg);transform: rotate(-20deg);left: 26px;}
}
              
            
!

JS

              
                window.setInterval(bubble, 2000);  

var first = $('.text.current');

function bubble() {
  var curr = $('.text.current');
      if(curr.next().length) {
        curr.removeClass('current').next().addClass('current');
      } else {
        $('.bubble').hide();
      }
}
              
            
!
999px

Console