?AlkantarClanX12
| Current Path : /home/rankinh/numerik/wp-content/themes/blackdsn/assets/js/plugins/ |
| Current File : /home/rankinh/numerik/wp-content/themes/blackdsn/assets/js/plugins/YouTubePopUp.min.js |
"use strict";!function(e){jQuery.fn.YouTubePopUp=function(o){let t=e.extend({autoplay:1},o);e(this).off("click"),e(this).on("click",(function(o){o.preventDefault();let a,u,p,n=e(this).attr("href");n.match(/(youtube.com)/)&&(a="v=",u=1),(n.match(/(youtu.be)/)||n.match(/(vimeo.com\/)+[0-9]/))&&(a="/",u=3),n.match(/(vimeo.com\/)+[a-zA-Z]/)&&(a="/",u=5);let c=n.split(a)[u],l=c.replace(/(&)+(.*)/,"");(n.match(/(youtu.be)/)||n.match(/(youtube.com)/))&&(p="https://www.youtube.com/embed/"+l+"?autoplay="+t.autoplay),(n.match(/(vimeo.com\/)+[0-9]/)||n.match(/(vimeo.com\/)+[a-zA-Z]/))&&(p="https://player.vimeo.com/video/"+l+"?autoplay="+t.autoplay);let i=e('<div class="YouTubePopUp-Wrap YouTubePopUp-animation"></div>'),m=e('<div class="YouTubePopUp-Content"></div>');m.append('<span class="YouTubePopUp-Close"></span>'),m.append('<iframe src="'+p+'" allowfullscreen></iframe>'),i.append(m),TweenLite.set(i,{autoAlpha:0,animationName:"none"}),TweenLite.set(m,{autoAlpha:0,y:"30%"}),e("body").append(i);let s=new TimelineLite({onReverseComplete:function(){e(".YouTubePopUp-Wrap").remove(),s=null}}).to(".YouTubePopUp-Wrap",.5,{autoAlpha:1}).to(".YouTubePopUp-Content",1,{autoAlpha:1,y:"0%",ease:Back.easeOut.config(4)});e(".YouTubePopUp-Wrap, .YouTubePopUp-Close").on("click",(function(){s.reverse()})),m=i=l=c=p=u=a=n=null}))}}(jQuery);
//# sourceMappingURL=YouTubePopUp.min.js.map