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 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.

            
              <!--- Modal Triggers --->
<a class="btn btn-primary js-modal-trigger" data-modal="lil-bit-content">Show me the modal with a teenie bit of content!</a>

<a class="btn btn-info js-modal-trigger" data-modal="lots-of-content">Show me the modal with a lot of content!</a>

<!--- Modal Stuffs --->
<div class="modal-overlay"></div>


<section id="lil-bit-content" class="modal">
    <header class="modal-header">
      <h1>I am a modal</h1>
    </header>
    <div class="modal-body">
     <p>Cupcake ipsum dolor sit amet icing unerdwear.com topping.</p>
   </div>
  <footer class="modal-footer">
    <a class="btn btn-primary js-close-modal-trigger">Close Modal</a>
  </footer>
</section>

<section id="lots-of-content" class="modal">
    <header class="modal-header">
      <h1>I am a modal</h1>
    </header>
    <div class="modal-body">
     <p>Cupcake ipsum dolor sit amet icing unerdwear.com topping. I love muffin icing bonbon halvah. Jelly halvah macaroon I love pastry bonbon. Cookie carrot cake sweet roll. Gingerbread biscuit applicake soufflé liquorice candy canes tart jujubes muffin. Tiramisu I love biscuit dessert. Jelly tootsie roll candy canes marshmallow biscuit fruitcake. I love chocolate bar danish. I love marzipan pastry cupcake topping cookie wafer. Ice cream gingerbread topping donut soufflé. Jelly beans chocolate bar gummies pudding chocolate bar applicake cheesecake chocolate cake. Jelly beans ice cream sweet candy canes. Apple pie cake I love apple pie. Sweet roll I love toffee tart.</p>
     <p>Cupcake ipsum dolor sit amet icing unerdwear.com topping. I love muffin icing bonbon halvah. Jelly halvah macaroon I love pastry bonbon. Cookie carrot cake sweet roll. Gingerbread biscuit applicake soufflé liquorice candy canes tart jujubes muffin. Tiramisu I love biscuit dessert. Jelly tootsie roll candy canes marshmallow biscuit fruitcake. I love chocolate bar danish. I love marzipan pastry cupcake topping cookie wafer. Ice cream gingerbread topping donut soufflé. Jelly beans chocolate bar gummies pudding chocolate bar applicake cheesecake chocolate cake. Jelly beans ice cream sweet candy canes. Apple pie cake I love apple pie. Sweet roll I love toffee tart.</p>
     <p>Cupcake ipsum dolor sit amet icing unerdwear.com topping. I love muffin icing bonbon halvah. Jelly halvah macaroon I love pastry bonbon. Cookie carrot cake sweet roll. Gingerbread biscuit applicake soufflé liquorice candy canes tart jujubes muffin. Tiramisu I love biscuit dessert. Jelly tootsie roll candy canes marshmallow biscuit fruitcake. I love chocolate bar danish. I love marzipan pastry cupcake topping cookie wafer. Ice cream gingerbread topping donut soufflé. Jelly beans chocolate bar gummies pudding chocolate bar applicake cheesecake chocolate cake. Jelly beans ice cream sweet candy canes. Apple pie cake I love apple pie. Sweet roll I love toffee tart.</p>
     <p>Cupcake ipsum dolor sit amet icing unerdwear.com topping. I love muffin icing bonbon halvah. Jelly halvah macaroon I love pastry bonbon. Cookie carrot cake sweet roll. Gingerbread biscuit applicake soufflé liquorice candy canes tart jujubes muffin. Tiramisu I love biscuit dessert. Jelly tootsie roll candy canes marshmallow biscuit fruitcake. I love chocolate bar danish. I love marzipan pastry cupcake topping cookie wafer. Ice cream gingerbread topping donut soufflé. Jelly beans chocolate bar gummies pudding chocolate bar applicake cheesecake chocolate cake. Jelly beans ice cream sweet candy canes. Apple pie cake I love apple pie. Sweet roll I love toffee tart.</p>
   </div>
  <footer class="modal-footer">
    <a class="btn btn-primary js-close-modal-trigger">Close Modal</a>
  </footer>
</section>
            
          
!
            
              body {
  padding: 20px;
  z-index: 1000;
}

.modal {
  background-color: white;
  border-radius: 10px;
  display: none;
  max-height: calc(100% - 100px);
  position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 990;
  
  &.modal-is-visible {
    display: block;
    z-index: 1010;
  }
  
  h1 {
    margin: 0;
    padding: 0;
  }
  
  .modal-body {
    height: 100%;
    overflow: auto;
    overflow-y: scroll;
  }
  
} // .modal

.modal-overlay {
  background-color: transparentize(black, .5);
  display: none;
  position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  z-index: 980;
  
  &.modal-is-visible {
    display: block;
    z-index: 1009;
  }
  
} // .modal-overlay
            
          
!
            
              # Simple Modal

$ ->
  $(document).on 'click', '.js-modal-trigger', (e) ->
    $this = $(this)
    whichModal = $this.attr("data-modal")

    # Adding Visible States for Modal
    $(".modal-overlay").addClass("modal-is-visible")
    $("#" + whichModal).addClass("modal-is-visible")

  $(document).on 'click', '.js-close-modal-trigger', (e) ->

    # Close All Modals
    $(".modal-overlay").removeClass("modal-is-visible")
    $(".modal").removeClass("modal-is-visible")

            
          
!
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