JSFiddle - React, Tailwind, and code Playground

HTML

<div id="modal-window" class="modal-window" >
    <div id='modal-head' class="modal-head"><h2>Hello</h2></div>
    <div id='modal-body' class="modal-body">I am modal window â„–2</div>
    <div id='modal-footer' class = "modal-footer">
        <span class='modal-button close-button'>Close me</span>
    </div>
</div>
<input type="button" id="m" data-modal-id="modal-window-1" value="window">

CSS

/*default*/

.modal-overlay {

 width: 100%;
 height: 100%;
 z-index: 99999;
 background-color: black;
 opacity: .8;
 display: none;
 position: fixed;
 top:0;
 left: 0;

 -webkit-box-shadow: 0 0 15px #fff;
 -moz-box-shadow: 0 0 15px #fff;
  -o-box-shadow: 0 0 15px #fff;
  box-shadow: 0 0 15px #fff;
  
}

.modal-window-animate {

   transition: all .7s ease-in;
    -o-transition: all .7s ease-in;
   -moz-transition: all  .7s ease-in;
   -webkit-transition: all  .7s ease-in;      
  
}



/*------------------------
MODAL STYLE
*/



.modal-window {
    
    -webkit-transform: scale(0);
    -moz-transform: scale(0)
    -o-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0);


    display: none;
    width: 300px;

    background-color: white;
    z-index: 100000;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #808080;

    margin: 0;
    color: #808080;
    font-size: 13px;
    font-weight: normal;
    line-height: 18px;
    background-color: #FFFFFF;
    border: 1px solid #EAEEFA;
    border: 1px solid rgba(234, 238, 250, 0.6);

    -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}

.modal-head {
    padding: 5px 15px;
    margin: 0;
}

.modal-head h2 {

    text-align: center;
}


.modal-body {
    padding: 40px;
    font-size: 15px;
    text-align: center;
    border-top: 1px solid #EEEEEE;
    -webkit-border-radius: 0 0 6px 6px;
    -moz-border-radius: 0 0 6px 6px;
    border-radius: 0 0 6px 6px;
    -webkit-box-shadow: inset 0 1px 0 #FFF;
    -moz-box-shadow: inset 0 1px 0 #FFF;
    box-shadow: inset 0 1px 0 #FFF;

}

.modal-footer {
    display: block;
    background-color: #F5F5F5;
    padding: 10px 11px 11px;
    border-top: 1px solid #EEEEEE;
    -webkit-border-radius: 0 0 6px 6px;
    -moz-border-radius: 0 0 6px 6px;
   ...

JavaScript

var bt = document.getElementById( "m"),
         win = document.getElementById( "modal-window" );

        var modal = new ModalJS({
            window: win,
            opt_closeButtonCls: "modal-footer",
            opt_isOverlayClickHide: true
        })

        bt.onclick = function ( ) {
            modal.show();
        };

        modal.on( "showed", function ( ) {
            console.log("showed" );
        } );

         modal.on( "close", function ( ) {
             
             win.style.transform = "scale(0)";
            
        } );

        modal.setEndAnimationPostition = function ( ) {

            var win = this.window,
                top = ( window.innerHeight - win.offsetHeight ) / 2 ,
                left = ( window.innerWidth - win.offsetWidth ) / 2 ;
    
            win.style.top = top + "px";
            win.style.left = left + "px";
            win.style.transform = "scale(1)";
        };