PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.0.39
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.0.39
2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 All 108 releases
b-blocks / assets / js / jquery.textillate.min.js

jquery.textillate.min.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.0.39, at assets/js/jquery.textillate.min.js

4 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* Lettering.JS 0.6.1 by Dave Rupert - http://daverupert.com */
2 (function($){function injector(t,splitter,klass,after){var a=t.text().split(splitter),inject='';if(a.length){$(a).each(function(i,item){inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after});t.empty().append(inject)}}var methods={init:function(){return this.each(function(){injector($(this),'','char','')})},words:function(){return this.each(function(){injector($(this),' ','word',' ')})},lines:function(){return this.each(function(){var r="eefec303079ad17405c889e092e105b0";injector($(this).children("br").replaceWith(r).end(),r,'line','')})}};$.fn.lettering=function(method){if(method&&methods[method]){return methods[method].apply(this,[].slice.call(arguments,1))}else if(method==='letters'||!method){return methods.init.apply(this,[].slice.call(arguments,0))}$.error('Method '+method+' does not exist on jQuery.lettering');return this}})(jQuery);
3
4 !function(t){"use strict";function e(e){return/In/.test(e)||t.inArray(e,t.fn.textillate.defaults.inEffects)>=0}function n(e){return/Out/.test(e)||t.inArray(e,t.fn.textillate.defaults.outEffects)>=0}function i(t){return"true"!==t&&"false"!==t?t:"true"===t}function a(e){var n=e.attributes||[],a={};return n.length?(t.each(n,function(t,e){var n=e.nodeName.replace(/delayscale/,"delayScale");/^data-in-*/.test(n)?(a.in=a.in||{},a.in[n.replace(/data-in-/,"")]=i(e.nodeValue)):/^data-out-*/.test(n)?(a.out=a.out||{},a.out[n.replace(/data-out-/,"")]=i(e.nodeValue)):/^data-*/.test(n)&&(a[n.replace(/data-/,"")]=i(e.nodeValue))}),a):a}function s(i,a,s){var l=i.length;l?(a.shuffle&&(i=function(t){for(var e,n,i=t.length;i;e=parseInt(Math.random()*i),n=t[--i],t[i]=t[e],t[e]=n);return t}(i)),a.reverse&&(i=i.toArray().reverse()),t.each(i,function(i,o){var r=t(o);function c(){e(a.effect)?r.css("visibility","visible"):n(a.effect)&&r.css("visibility","hidden"),!(l-=1)&&s&&s()}var u=a.sync?a.delay:a.delay*i*a.delayScale;r.text()?setTimeout(function(){var t,e,n;t=r,e=a.effect,n=c,t.addClass("animated "+e).css("visibility","visible").show(),t.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){t.removeClass("animated "+e),n&&n()})},u):c()})):s&&s()}var l=function(i,l){var o=this,r=t(i);o.init=function(){o.$texts=r.find(l.selector),o.$texts.length||(o.$texts=t('<ul class="texts"><li>'+r.html()+"</li></ul>"),r.html(o.$texts)),o.$texts.hide(),o.$current=t("<span>").html(o.$texts.find(":first-child").html()).prependTo(r),e(l.in.effect)?o.$current.css("visibility","hidden"):n(l.out.effect)&&o.$current.css("visibility","visible"),o.setOptions(l),o.timeoutRun=null,setTimeout(function(){o.options.autoStart&&o.start()},o.options.initialDelay)},o.setOptions=function(t){o.options=t},o.triggerEvent=function(e){var n=t.Event(e+".tlt");return r.trigger(n,o),n},o.in=function(i,l){i=i||0;var c,u=o.$texts.find(":nth-child("+((i||0)+1)+")"),f=t.extend(!0,{},o.options,u.length?a(u[0]):{});u.addClass("current"),o.triggerEvent("inAnimationBegin"),r.attr("data-active",u.data("id")),o.$current.html(u.html()).lettering("words"),"char"==o.options.type&&o.$current.find('[class^="word"]').css({display:"inline-block","-webkit-transform":"translate3d(0,0,0)","-moz-transform":"translate3d(0,0,0)","-o-transform":"translate3d(0,0,0)",transform:"translate3d(0,0,0)"}).each(function(){t(this).lettering()}),c=o.$current.find('[class^="'+o.options.type+'"]').css("display","inline-block"),e(f.in.effect)?c.css("visibility","hidden"):n(f.in.effect)&&c.css("visibility","visible"),o.currentIndex=i,s(c,f.in,function(){o.triggerEvent("inAnimationEnd"),f.in.callback&&f.in.callback(),l&&l(o)})},o.out=function(e){var n=o.$texts.find(":nth-child("+((o.currentIndex||0)+1)+")"),i=o.$current.find('[class^="'+o.options.type+'"]'),l=t.extend(!0,{},o.options,n.length?a(n[0]):{});o.triggerEvent("outAnimationBegin"),s(i,l.out,function(){n.removeClass("current"),o.triggerEvent("outAnimationEnd"),r.removeAttr("data-active"),l.out.callback&&l.out.callback(),e&&e(o)})},o.start=function(t){setTimeout(function(){o.triggerEvent("start"),function t(e){o.in(e,function(){var n=o.$texts.children().length;e+=1,!o.options.loop&&e>=n?(o.options.callback&&o.options.callback(),o.triggerEvent("end")):(e%=n,o.timeoutRun=setTimeout(function(){o.out(function(){t(e)})},o.options.minDisplayTime))})}(t||0)},o.options.initialDelay)},o.stop=function(){o.timeoutRun&&(clearInterval(o.timeoutRun),o.timeoutRun=null)},o.init()};t.fn.textillate=function(e,n){return this.each(function(){var i=t(this),s=i.data("textillate"),o=t.extend(!0,{},t.fn.textillate.defaults,a(this),"object"==typeof e&&e);s?"string"==typeof e?s[e].apply(s,[].concat(n)):s.setOptions.call(s,o):i.data("textillate",s=new l(this,o))})},t.fn.textillate.defaults={selector:".texts",loop:!1,minDisplayTime:2e3,initialDelay:0,in:{effect:"fadeInLeftBig",delayScale:1.5,delay:50,sync:!1,reverse:!1,shuffle:!1,callback:function(){}},out:{effect:"hinge",delayScale:1.5,delay:50,sync:!1,reverse:!1,shuffle:!1,callback:function(){}},autoStart:!0,inEffects:[],outEffects:["hinge"],callback:function(){},type:"char"}}(jQuery);