JSFiddle - React, Tailwind, and code Playground

by mackry

HTML

<button>Test</button>

<div id="overlay"></div>

<div id="border">
    <div id="dialog">
        <button id="cancel">Cancel</button>
    </div>
</div>

CSS

body {
    background: #ddd;      
}
#overlay {
    position: absolute;
    top: -10px;
    height: 100%;
    width: 100%;
    background: -moz-radial-gradient(right bottom 45deg, circle closest-corner, #171717 50%, red 100%);
    background: -webkit-gradient(radial, center center, 300, center center, 800, from(#171717), to(#000));
    opacity: .7;
    display: none;
}

#border {
    background: rgba(30,70,90,0.7);
    height:0;
    width: 0;
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    
    -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 2px 3px rgba(0,0,0,0.3);
    
    -webkit-transition: all .05s ease-out;
    -moz-transition: all 0.12s ease-out;
}

#border.active {
    display: block;
    height: 200px;
    width: 250px;
    left: 300px;
    top: 100px;
    opacity: 1;
    padding: 6px;
    
    -webkit-transition: all .05s ease-out;
    -moz-transition: all 0.12s ease-out;
}

#dialog {
    height: 100%;
    width: 100%;
    background: #FFF;
    
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    
    -moz-box-shadow: 0 1px 1px #316378;
    -webkit-box-shadow: 0 1px 1px #316378;
    box-shadow: 0 1px 1px #316378;
}

button#cancel {
    display: none;
    margin-top: 9px;
    color: #626262;
    text-shadow: 0 1px #f2f2f2;
    border: 1px solid #c2c2c2;
    
    background: -webkit-gradient(linear, left top, left bottom, from(#ececec), to(#d2d2d2));     
    background: -moz-linear-gradient(top,  #ececec,  #d2d2d2);
    
    -moz-box-shadow: inset 0 1px #fff, 0 1px 2px #b6c4ca;
    -webkit-box-shadow: inset 0 1px #fff, 0 1px 2px #b6c4ca;
    box-shadow: inset 0 1px #fff, 0 1px 2px #b6c4ca;   
}

button#cancel:active {
    background: -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#ececec));     
    background:...

JavaScript

$(document).ready(function() {
    var overlay = $('#overlay'),
        dialog = $('#border'),
        cancel = $('#cancel');

    $('button').toggle(function() {
        //$(this).effect("transfer", { to: dialog }, 1000);
        //overlay.fadeIn(150, function() {
        dialog.addClass('active');
        //cancel.show();
        //});
    },  function () {
        closeDialog();
    });

    overlay.click(closeDialog);

    cancel.click(closeDialog);

    function closeDialog() {
        //overlay.fadeOut(150, function() {
        dialog.removeClass('active');
        //cancel.hide();
        //});
    }
});