Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions css/component.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
}

/* Morph Button Style: Modal */
.morph-button-modal::before {
.morph-button-modal .modal {
position: fixed;
top: 0;
left: 0;
Expand All @@ -132,14 +132,15 @@
-webkit-transition: opacity 0.5s;
transition: opacity 0.5s;
pointer-events: none;
display: block;
}

.morph-button-modal.open::before {
.morph-button-modal.open .modal {
opacity: 1;
pointer-events: auto;
}

.morph-button-modal.active::before {
.morph-button-modal.active .modal {
z-index: 1800;
}

Expand Down Expand Up @@ -495,4 +496,4 @@
.morph-button-sidebar.open .morph-content {
height: 100% !important;
}
}
}
15 changes: 14 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<link rel="stylesheet" type="text/css" href="css/component.css" />
<link rel="stylesheet" type="text/css" href="css/content.css" />
<script src="js/modernizr.custom.js"></script>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<div class="container">
Expand All @@ -39,6 +40,7 @@ <h1>Morphing Buttons Concept</h1>
<div class="mockup-content">
<p>Pea horseradish azuki bean lettuce avocado asparagus okra.</p>
<div class="morph-button morph-button-modal morph-button-modal-2 morph-button-fixed">
<span class="modal"></span>
<button type="button">Login</button>
<div class="morph-content">
<div>
Expand All @@ -56,6 +58,7 @@ <h2>Login</h2>
</div><!-- morph-button -->
<strong class="joiner">or</strong>
<div class="morph-button morph-button-modal morph-button-modal-3 morph-button-fixed">
<span class="modal"></span>
<button type="button">Signup</button>
<div class="morph-content">
<div>
Expand Down Expand Up @@ -152,7 +155,17 @@ <h3>Sidebar Transitions</h3>
[].slice.call( document.querySelectorAll( 'form button' ) ).forEach( function( bttn ) {
bttn.addEventListener( 'click', function( ev ) { ev.preventDefault(); } );
} );

$(document).keyup(function(e) {
if (e.keyCode == 27) {
// escape
$('.active .icon-close').click();
}
});
$('.modal').click(function() {
$('.active .icon-close').click();
});
})();
</script>
</body>
</html>
</html>