$(function () { // DOM ready, take it away //gsap.registerPlugin('ScrollTrigger'); gsap.config({ nullTargetWarn: false, }); // Modal timeline const openModal = new TimelineMax({ paused: true, }); const modal = $('#modal'); const modalBlur = $('#modal-blur'); const modalWrapper = $('#modal .modal-wrapper'); const modalContainer = $('#modal .modal-wrapper .container'); openModal.to(modal, { duration: .6, autoAlpha: 1, ease: Power4.easeOut, }); openModal.to(modalBlur, { duration: .6, delay:-.6, autoAlpha: 1, ease: Power4.easeOut, }); console.log('wrapper length: '+modalWrapper.length); openModal.from(modalWrapper, { duration: .6, y:144, delay: -.6, ease: Power4.easeOut, }); // open modal $('.open-modal').click(function() { $('#contactForm').trigger("reset"); $('#annoying-button').show(); let uid = $(this).data('uid'); let modalhtml = $("[data-modalid='modal-" + uid +"']"); modalhtml.appendTo(modalContainer); // show modal content let modalId = $(this).data('modal'); $(modal).scrollTop(0); $(modal).find('.grid').hide(); $('#'+modalId).show(); // play modal timeline openModal.play(); $('body').css('overflow','hidden'); }); $('#contactForm').submit(function() { console.log('submit'); openModal.reverse(); setTimeout(function(){ $('body').css('overflow','auto'); }, 600); // open modal timeline time return false; }); // Close modal $('.close').click(function() { openModal.reverse(); setTimeout(function(){ $('body').css('overflow','auto'); }, 600); // open modal timeline time }); /*// Close modal $('.grid-contact').click(function(e) { e.preventDefault(); }); */ // Close modal $(modal).click(function() { if (!$(event.target).closest(".modal .contact-content").length) { openModal.reverse(); setTimeout(function(){ $('body').css('overflow','auto'); }, 600); // open modal timeline time } }); }); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:contact-pop] [136.13494] DESIGN*/ /*******************************************************************/ /* 0.4 D>D */ /* db 174 */