<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const btnLabel = '.success-btn-close';
const formLabel = '.zero_form';
const successLabel = 'success-zero';
const closeBtn = document.querySelector(btnLabel);
const form = document.querySelector(formLabel);
const successZero = closeBtn.closest('.t-rec');
successZero.classList.add(successLabel, 'hide-success', 'position-success');
document.addEventListener('click', function(event) {
if(event.target.closest(formLabel+' .t-submit')){
setTimeout(function(){
if ( form.querySelector('.t-form').classList.contains("js-send-form-success") ){
successZero.classList.remove('hide-success');
document.querySelector('.t-form-success-popup').appendChild(successZero);
};
}, 1000);
};
if(event.target.closest(btnLabel)){
window.tildaForm.closeSuccessPopup();
};
});
})();
});
</script>
<style>
.t-form-success-popup__window ,
.hide-success {
opacity: 0!important;
height: 0!important;
max-height: 0!important;
min-height: 0!important;
pointer-events: none!important;
overflow: hidden!important;
padding-top: 0!important;
padding-bottom: 0!important;
}
.position-success {
position: inherit;
width: 100%;
top: 50%;
transform: translateY(-50%);
}
</style>