-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.php
More file actions
37 lines (36 loc) · 1.24 KB
/
Copy pathtemplate.php
File metadata and controls
37 lines (36 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<div x-data="modal()" x-init="listen()">
<div x-show.transition.opacity="open" x-on:click.away="open = false"
class="p-4 fixed flex justify-center items-center inset-0 bg-black bg-opacity-75 z-50">
<div x-show.transition="open"
class="container max-w-3xl max-h-full bg-white rounded-xl shadow-lg overflow-auto">
<div class="px-8 py-4 border-b border-black">
<h2>Header</h2>
</div>
<div class="px-8 py-4">
<p>Body</p>
</div>
<div class="px-8 py-4 border-t border-black text-center">
<button x-on:click.prevent="open = false"
class="py-2 px-4 rounded-full text-center inline-block border border-black text-black bg-white hover:bg-black hover:text-white focus:outline-none">
Close
</button>
</div>
</div>
</div>
</div>
<script>
function modal(){
return {
open: false,
listen() {
document.addEventListener("mouseleave", (event) => {
var cookieIsSet = Cookies.get('exit_intent');
if(cookieIsSet == undefined){
Cookies.set('exit_intent', 'yes', { expires: 60 });
this.open = true;
}
})
}
}
}
</script>