-
-
Save JoDeveloper/c10de9f6de32c9b6abda59574c46e57f to your computer and use it in GitHub Desktop.
Modals with Zero JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="{{ $name }}" class="overlay"> | |
<a href="#" class="cancel"></a> | |
<div class="modal"> | |
{{ $slot }} | |
<a href="#" class="close">×</a> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.overlay { | |
visibility: hidden; | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
background: rgba(0, 0, 0, .7); | |
} | |
.overlay:target { | |
visibility: visible; | |
} | |
.modal { | |
position: relative; | |
width: 600px; | |
max-width: 80%; | |
background: white; | |
border-radius: 8px; | |
padding: 1em 2em; | |
} | |
.modal .close { | |
position: absolute; | |
top: 15px; | |
right: 15px; | |
color: grey; | |
text-decoration: none; | |
} | |
.overlay .cancel { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#join-modal">Join</a> | |
@component('modal', ['name' => 'join-modal']) | |
<h1>Pick a Plan</h1> | |
<p> | |
Lorem ipsum... | |
</p> | |
@endcomponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment