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.

            
              <div class="demo-only" style="height:640px;">
  <div id="dialog" role="dialog" tabindex="-1" aria-labelledby="header43" class="slds-modal slds-fade-in-open">
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close">
<svg id="close" class="slds-button__icon slds-button__icon--large" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="52" height="52" viewBox="0 0 52 52">
  <g stroke-width="6" stroke="#fff">
    <line x1="26" x2="4" y1="26" y2="4" />
    <line x1="26" x2="48" y2="4" y1="26" />
    <line x1="26" x2="2" y1="26" y2="48" />   
    <line x1="26" x2="48" y1="26" y2="48" />
  </g>
          </svg>
          <span class="slds-assistive-text">Close</span>
        </button>
        <h2 id="header43" class="slds-text-heading--medium">Modal Header</h2>
      </div>
      <div class="slds-modal__content slds-p-around--medium">
        <p>Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis. Cillum sunt ad dolore
          quis aute consequat ipsum magna exercitation reprehenderit magna. Tempor cupidatat consequat elit dolor adipisicing.</p>
        <p>Dolor eiusmod sunt ex incididunt cillum quis nostrud velit duis sit officia. Lorem aliqua enim laboris do dolor eiusmod officia. Mollit incididunt nisi consectetur esse laborum eiusmod pariatur proident. Eiusmod et adipisicing culpa deserunt nostrud
          ad veniam nulla aute est. Labore esse esse cupidatat amet velit id elit consequat minim ullamco mollit enim excepteur ea.</p>
      </div>
      <div class="slds-modal__footer">
        <button class="slds-button slds-button--neutral">Cancel</button>
        <button class="slds-button slds-button--brand">Save</button>
      </div>
    </div>
  </div>
  
  <button id="trigger" class="slds-button slds-button--brand">Trigger modal</button>
  
  <div class="slds-backdrop slds-backdrop--open"></div>
</div>
            
          
!
            
              .slds-button:focus {
  box-shadow: none !important; // Don't do that in production
}
            
          
!
            
              var $close = $('#close');
var $dialog = $('.slds-modal__content');
MorphSVGPlugin.convertToPath()

function revolve() {
  var tl = new TimelineMax();

  return tl.add("begin")
    .to($('#close'), .3, {
      scale: 1.5,
      ease: Expo.easeInOut
    })
    .to($('#close line'), .3, {
      drawSVG: 0,
      ease: Expo.easeInOut
    }, "begin+=0.2")
    .add("closed")
    .to($dialog, .5, {
      height: 0,
      padding: 0,
      ease: Expo.easeInOut
    })
    .to($('#dialog'), .4, {
      y: '-100%',
      ease: Expo.easeInOut
    })
    .to($('.slds-backdrop'), .4, {
      ease: Expo.easeInOut,
      autoAlpha: 0
    }, "closed+=0.6")
}

var closeAnimation = new TimelineMax({
  paused: true
});
closeAnimation.add(revolve());

$close.on("click", function(e) {
  e.preventDefault();
  closeAnimation.restart();
});

$('#trigger').on("click", function(e) {
  e.preventDefault();
  closeAnimation.reverse();
});
            
          
!
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