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.

            
              <h1>Custom Pop-Out Box</h1>
<p>OK, I know they're called, modals.</p>
<p>But I heard that "pop-out box" before, and it stuck.</p>

<!-- Trigger -->
<button id="popBtn">Pop-Out Box</button>

<!-- Box -->
<div id="popOut" class="popOut">

  <!-- Box content -->
  <div class="popOut-content">
<!--     <div class="popOut-header"> -->
      <span class="close">&times;</span>
<!--       <h2>Pop Out</h2>
    </div> -->
    <div class="popOut-body">
      <p>WE GOT ACTION...</p>
      <p>Some more crapola...<p>
      <p>Bacon ipsum dolor amet landjaeger spare ribs jerky, meatloaf kevin venison shankle hamburger drumstick turducken. Shoulder picanha porchetta, andouille short ribs doner cupim shank fatback pork chop brisket. Jerky kevin pancetta spare ribs, drumstick tri-tip chicken. Pancetta burgdoggen kielbasa, biltong meatloaf brisket pork belly pork loin ham boudin pig turkey shoulder drumstick. Tongue shank pork belly, kielbasa spare ribs ball tip turkey.</p>
      <p>Pork belly venison sirloin picanha meatball frankfurter. Drumstick frankfurter short ribs, flank picanha pig turducken landjaeger biltong t-bone pork loin pork belly. Shank turkey jerky, kevin fatback bresaola filet mignon. Pig landjaeger andouille rump swine meatball bresaola pastrami shoulder boudin alcatra doner. Pig drumstick ham hock doner meatloaf, jowl boudin shankle short ribs shoulder. Capicola sirloin tri-tip pork loin sausage beef.</p>
      <p>Ribeye sirloin andouille shankle, pork chop ground round alcatra ball tip cupim chicken. Bacon drumstick frankfurter beef ribs salami. Ball tip prosciutto flank sirloin pancetta alcatra brisket buffalo. Jowl strip steak t-bone tri-tip, biltong salami ham short ribs landjaeger bacon ground round. Spare ribs pork drumstick rump cupim beef ribs doner ribeye tri-tip shoulder strip steak.</p>
      <p>Ribeye shank tongue pig salami filet mignon strip steak. Tongue turkey porchetta corned beef doner chuck ham filet mignon biltong. Capicola porchetta turducken tail tri-tip, drumstick pastrami bresaola kielbasa short loin corned beef leberkas swine. Buffalo tongue kevin hamburger biltong, prosciutto flank ham hock bresaola venison shankle doner. Jowl jerky short loin turkey pork chop corned beef sausage tenderloin.</p>
      <p>Ribeye shank tongue pig salami filet mignon strip steak. Tongue turkey porchetta corned beef doner chuck ham filet mignon biltong. Capicola porchetta turducken tail tri-tip, drumstick pastrami bresaola kielbasa short loin corned beef leberkas swine. Buffalo tongue kevin hamburger biltong, prosciutto flank ham hock bresaola venison shankle doner. Jowl jerky short loin turkey pork chop corned beef sausage tenderloin.</p>
    </div>
<!--     <div class="popOut-footer">
      <h3>If you want a footer...</h3>
    </div> -->
  </div>

</div>
            
          
!
            
              h1{color: #0A71B3;
text-align:center;}
p{text-align: center;}

#popBtn{
  font-size: 2em;
  display:block;
  margin:auto;
  background-color:#0A71B3;
  border-radius: 20px;
  padding:1em 2em;
  color: #ffffff;
  text-transfrom: uppercase;
  box-shadow: 10px 10px 10px #888888;
}
/* The Modal (background) */
.popOut {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content */
.popOut-content {
  position: relative;
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border: 1px solid #888;
  width: 80%;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
  -webkit-animation-name: animatetop;
  -webkit-animation-duration: 0.4s;
  animation-name: animatetop;
  animation-duration: 0.4s
}

/* Add Animation */
@-webkit-keyframes animatetop {
  from {top:-300px; opacity:0} 
  to {top:0; opacity:1}
}

@keyframes animatetop {
  from {top:-300px; opacity:0}
  to {top:0; opacity:1}
}

/* The Close Button */
.close {
  color: #003594;
  float: right;
  padding-right: 10px;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #003594;
  text-decoration: none;
  cursor: pointer;
}

.popOut-header {
  padding: 2px 10px;
  background-color: #003594;
  color: white;
}

.popOut-body {padding: 2px 16px;}

.popOut-footer {
  padding: 2px 10px;
  background-color: #003594;
  color: white;
}
            
          
!
            
              // box
let popOut = document.getElementById('popOut');

// open
let popBtn = document.getElementById("popBtn");

// x to close
let span = document.getElementsByClassName("close")[0];

// Open
popBtn.onclick = function() {
  popOut.style.display = "block";
}

// Close box with X
span.onclick = function() {
  popOut.style.display = "none";
}

//Click anywhere to close
window.onclick = function(event) {
  if (event.target == popOut) {
    popOut.style.display = "none";
  }
}
            
          
!
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