(function ($, root, undefined) { $(function () { $('.grid').hide(); 'use strict'; // DOM ready, take it away // Modal timeline const openModal = gsap.timeline({ 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, }); openModal.from(modalWrapper, { duration: .6, y:144, delay: -.6, ease: Power4.easeOut, }); // open modal $('.open-modal').click(function() { 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'); if (Modernizr.hiddenscroll) { } else { $('body').css('padding-right','17px'); $('.header').css('right','17px'); } $thismodal = $('#'+modalId); $sesimg = $thismodal.find('.session-image img'); $sesimgw = $sesimg.width(); $sesimg.height($sesimgw); }); // Close modal $(modal).click(function() { if (!$(event.target).closest(".modal .content").length) { openModal.reverse(); setTimeout(function(){ $('body').css('overflow','auto'); if (Modernizr.hiddenscroll) { } else { $('body').css('padding-right','0'); $('.header').css('right','0'); } }, 600); // open modal timeline time } }); }); })(jQuery, this); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:modal] [18.47] DESIGN*/ /*******************************************************************/ /* 0.2 D>D */ /* db 158 */