Skip to content

Commit fff33d3

Browse files
committed
Show modal vue method and structure
1 parent 95ab375 commit fff33d3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/components/shared/Header.vue

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<div>
8181
<button
8282
class="text-md font-medium bg-indigo-500 hover:bg-indigo-600 text-white shadow-sm rounded-lg px-5 py-2.5"
83+
@click="showModal()"
8384
>
8485
Hire Me
8586
</button>
@@ -97,21 +98,21 @@
9798

9899
<!-- Hire me modal start -->
99100
<transition name="fade">
100-
<div v-show="show_modal" class="fixed inset-0 z-30">
101+
<div v-show="modal" class="fixed inset-0 z-30">
101102
<!-- background -->
102103
<div
103-
v-show="show_modal"
104+
v-show="modal"
104105
@click="showModal()"
105-
class="bg-filter bg-white opacity-25 fixed inset-0 w-full h-full z-20"
106+
class="bg-filter bg-black bg-opacity-70 fixed inset-0 w-full h-full z-20"
106107
></div>
107108
<!-- -->
108109
<main
109110
class="flex flex-col items-center justify-center h-full w-full"
110111
>
111112
<transition name="fade-up-down">
112113
<div
113-
v-show="show_modal"
114-
class="modal-wrapper inline-block flex items-center z-30"
114+
v-show="modal"
115+
class="modal-wrapper flex items-center z-30"
115116
>
116117
<div
117118
class="modal max-w-md mx-auto xl:max-w-5xl lg:max-w-5xl md:max-w-2xl bg-white max-h-screen shadow-lg flex-row rounded relative"
@@ -170,7 +171,7 @@ export default {
170171
return {
171172
isOpen: false,
172173
theme: '',
173-
modal: true,
174+
modal: false,
174175
};
175176
},
176177
@@ -186,17 +187,17 @@ export default {
186187
this.theme = theme;
187188
},
188189
showModal() {
189-
if (this.show_modal) {
190+
if (this.modal) {
190191
//stop screen scrolling
191192
document
192193
.getElementsByTagName('html')[0]
193194
.classList.remove('overflow-y-hidden');
194-
this.show_modal = false;
195+
this.modal = false;
195196
} else {
196197
document
197198
.getElementsByTagName('html')[0]
198199
.classList.add('overflow-y-hidden');
199-
this.show_modal = true;
200+
this.modal = true;
200201
}
201202
},
202203
},

0 commit comments

Comments
 (0)