setTimeout(() => newsletter=false,200))"
x-trap.noscroll="newsletter && animate"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
x-cloak
x-init="$nextTick (() => animate=true)"
x-data="{
animate:false,
popup_step: 1,
email: '',
first_name: '',
last_name: '',
phone: '',
tag: '',
gdpr: null,
submitStep() {
axios
.post(
'/handler-router',
qs.stringify({
internal: true,
module: 'Form',
method: 'ecomail_signin',
email: this.email,
first_name: this.first_name,
last_name: this.last_name,
phone: this.phone,
tag: this.tag,
gdpr: this.gdpr ? 1 : 0,
gtm: JSON.stringify(Alpine.store('Tracking').gtm)
})
)
.then((response) => {
if (response.data.status === 'success') {
this.popup_step = 2;
popup.available = false
localStorage.setItem('popup_hidden', true)
}
if(response.data.status !== 'success' && response.data.message) {
window.messages.add(response.data.status, response.data.message);
}
})
.catch((error) => {
console.error(error);
});
},
cancelStep(callback) {
localStorage.setItem('popup_hidden', true);
axios
.post(
'/handler-router',
qs.stringify({
internal: true,
module: 'Form',
method: 'cancel_popup_email',
email: this.email,
gdpr: this.gdpr ? 1 : 0,
})
)
.then((response) => {
if (response.data.status === 'success') {
callback()
}
if(response.data.status !== 'success' && response.data.message) {
window.messages.add(response.data.status, response.data.message);
}
})
.catch((error) => {
console.error(error);
});
}
}"
>
setTimeout(() => newsletter=false,200))"
@touchend.away="animate=false;$nextTick (() => setTimeout(() => newsletter=false,200))"
x-show="newsletter && animate"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="-translate-y-4 opacity-0"
x-transition:enter-end="translate-y-0 opacity-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="translate-y-0 opacity-100"
x-transition:leave-end="translate-y-4 opacity-0"
>
Thank you for signing up.