| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520 |
- /************************************************
- * REVOLUTION 5.4.2 EXTENSION - LAYER ANIMATION
- * @version: 3.6.3 (17.05.2017)
- * @requires jquery.themepunch.revolution.js
- * @author ThemePunch
- ************************************************/
- (function($) {
- "use strict";
- var _R = jQuery.fn.revolution,
- _ISM = _R.is_mobile(),
- _ANDROID = _R.is_android(),
- extension = { alias:"LayerAnimation Min JS",
- name:"revolution.extensions.layeranimation.min.js",
- min_core: "5.4.5",
- version:"3.6.3"
- };
-
- ///////////////////////////////////////////
- // EXTENDED FUNCTIONS AVAILABLE GLOBAL //
- ///////////////////////////////////////////
- jQuery.extend(true,_R, {
- updateMarkup : function(layer,o) {
-
- var d = jQuery(layer).data();
- if (d.start!==undefined && !d.frames_added && d.frames===undefined) {
-
- var frames = new Array(),
- oin = getAnimDatas(newAnimObject(),d.transform_in,undefined, false),
- oout = getAnimDatas(newAnimObject(),d.transform_out,undefined, false),
- oh = getAnimDatas(newAnimObject(),d.transform_hover,undefined, false);
-
- if (jQuery.isNumeric(d.end) && jQuery.isNumeric(d.start) && jQuery.isNumeric(oin.speed)) {
- d.end = (parseInt(d.end,0) - (parseInt(d.start,0)+parseFloat(oin.speed,0)));
- }
-
- frames.push({frame:"0", delay:d.start, from:d.transform_in, to:d.transform_idle, split:d.splitin, speed:oin.speed, ease:oin.anim.ease, mask:d.mask_in, splitdelay:d.elementdelay});
- frames.push({frame:"5", delay:d.end, to:d.transform_out, split:d.splitout, speed:oout.speed, ease:oout.anim.ease, mask:d.mask_out, splitdelay:d.elementdelay});
- if (d.transform_hover)
- frames.push({frame:"hover", to:d.transform_hover, style:d.style_hover, speed:oh.speed, ease:oh.anim.ease, splitdelay:d.elementdelay});
- d.frames = frames;
- //layer.frames_added = true;
- }
-
- if (!d.frames_added) {
- d.inframeindex = 0;
- d.outframeindex = -1;
- d.hoverframeindex = -1;
- if (d.frames!==undefined) {
- for (var i=0;i<d.frames.length;i++) {
- // CHECK FOR BLOCK SFX ANIMATION
- if (d.frames[i].sfx_effect!==undefined && d.frames[i].sfx_effect.indexOf('block')>=0) {
- if (i===0) {
- d.frames[i].from = "o:0";
- d.frames[i].to = "o:1";
- } else {
- d.frames[i].to = "o:0";
- }
- d._sfx = "block";
- }
-
- if (d.frames[0].from===undefined) d.frames[0].from = "o:inherit";
-
- if (d.frames[0].delay===0) d.frames[0].delay=20;
-
- if (d.frames[i].frame==="hover")
- d.hoverframeindex = i;
- else
- if (d.frames[i].frame==="frame_999" || d.frames[i].frame==="frame_out" || d.frames[i].frame==="last" || d.frames[i].frame==="end")
- d.outframeindex = i;
-
- if (d.frames[i].split!==undefined && d.frames[i].split.match(/chars|words|lines/g))
- d.splittext = true;
- }
-
- }
- d.outframeindex = d.outframeindex===-1 ? d.hoverframeindex === -1 ? d.frames.length-1 : d.frames.length -2 : d.outframeindex; // CHECK LATER !!!
- d.frames_added = true;
-
- }
- },
- // MAKE SURE THE ANIMATION ENDS WITH A CLEANING ON MOZ TRANSFORMS
- animcompleted : function(_nc,opt) {
-
- var _ = _nc.data(),
- t = _.videotype,
- ap = _.autoplay,
- an = _.autoplayonlyfirsttime;
-
- if (t!=undefined && t!="none")
- if (ap==true || ap=="true" || ap=="on" || ap=="1sttime" || an) {
- if (opt.sliderType!=="carousel" ||
- (opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on" && _nc.closest('li').hasClass("active-revslide")) ||
- (opt.sliderType==="carousel" && opt.carousel.showLayersAllTime!=="on" && _nc.closest('li').hasClass("active-revslide"))
- )
- _R.playVideo(_nc,opt);
-
- _R.toggleState(_nc.data('videotoggledby'));
- if ( an || ap=="1sttime") {
- _.autoplayonlyfirsttime = false;
- _.autoplay = "off";
- }
- } else {
- if (ap=="no1sttime")
- _.datasetautoplay = 'on';
- _R.unToggleState(_nc.data('videotoggledby'));
- }
- },
- /********************************************************
- - PREPARE AND DEFINE STATIC LAYER DIRECTIONS -
- *********************************************************/
- handleStaticLayers : function(_nc,opt) {
-
- var s = parseInt(_nc.data('startslide'),0),
- e = parseInt(_nc.data('endslide'),0);
- if (s < 0)
- s=0;
- if (e <0 )
- e = opt.realslideamount;
- if (s===0 && e===opt.realslideamount-1)
- e = opt.realslideamount+1;
- _nc.data('startslide',s);
- _nc.data('endslide',e);
- },
- /************************************
- ANIMATE ALL CAPTIONS
- *************************************/
- animateTheCaptions : function(obj) {
-
- if (_R.compare_version(extension).check==="stop") return false;
- var opt = obj.opt,
- nextli = obj.slide,
- recall = obj.recall,
- mtl = obj.maintimeline,
- preset = obj.preset,
- startSlideAnimAt = obj.startslideanimat,
- base_offsetx = opt.sliderType==="carousel" ? 0 : opt.width/2 - (opt.gridwidth[opt.curWinRange]*opt.bw)/2,
- base_offsety=0,
- index = nextli.data('index');
- // COLLECTION OF LAYERS
- opt.layers = opt.layers || new Object();
- opt.layers[index] = opt.layers[index] || nextli.find('.tp-caption');
- opt.layers["static"] = opt.layers["static"] || opt.c.find('.tp-static-layers').find('.tp-caption');
- if (opt.timelines === undefined) _R.createTimelineStructure(opt);
-
- opt.conh = opt.c.height();
- opt.conw = opt.c.width();
- opt.ulw = opt.ul.width();
- opt.ulh = opt.ul.height();
- /* ENABLE DEBUG MODE */
- if (opt.debugMode) {
- nextli.addClass("indebugmode");
- nextli.find('.helpgrid').remove();
- opt.c.find('.hglayerinfo').remove();
- nextli.append('<div class="helpgrid" style="width:'+(opt.gridwidth[opt.curWinRange]*opt.bw)+'px;height:'+(opt.gridheight[opt.curWinRange]*opt.bw)+'px;"></div>');
- var hg = nextli.find('.helpgrid');
- hg.append('<div class="hginfo">Zoom:'+(Math.round(opt.bw*100))+'% Device Level:'+opt.curWinRange+' Grid Preset:'+opt.gridwidth[opt.curWinRange]+'x'+opt.gridheight[opt.curWinRange]+'</div>')
- opt.c.append('<div class="hglayerinfo"></div>')
- hg.append('<div class="tlhg"></div>');
- }
-
- // PREPARE THE LAYERS
- if (index!==undefined && opt.layers[index])
- jQuery.each(opt.layers[index], function(i,a) {
- var _t = jQuery(this);
- _R.updateMarkup(this,opt);
- _R.prepareSingleCaption({caption:_t, opt:opt, offsetx:base_offsetx, offsety:base_offsety, index:i, recall:recall, preset:preset});
- if (!preset || startSlideAnimAt===0) _R.buildFullTimeLine({caption:_t, opt:opt, offsetx:base_offsetx, offsety:base_offsety, index:i, recall:recall, preset:preset, regenerate: startSlideAnimAt===0});
- if (recall && opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on") _R.animcompleted(_t,opt);
- });
-
- if (opt.layers["static"])
- jQuery.each(opt.layers["static"], function(i,a) {
- var _t = jQuery(this),
- _ = _t.data();
-
- if (_.hoveredstatus!==true && _.inhoveroutanimation!==true) {
- _R.updateMarkup(this,opt);
- _R.prepareSingleCaption({caption:_t, opt:opt, offsetx:base_offsetx, offsety:base_offsety, index:i, recall:recall, preset:preset});
-
- if ((!preset || startSlideAnimAt===0) && _.veryfirstststic !==true) {
- _R.buildFullTimeLine({caption:_t, opt:opt, offsetx:base_offsetx, offsety:base_offsety, index:i, recall:recall, preset:preset, regenerate: startSlideAnimAt===0});
- _.veryfirstststic = true;
- }
- if (recall && opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on") _R.animcompleted(_t,opt);
-
- } else {
- _R.prepareSingleCaption({caption:_t, opt:opt, offsetx:base_offsetx, offsety:base_offsety, index:i, recall:recall, preset:preset});
- }
- });
-
- // RECALCULATE HEIGHTS OF SLIDE IF ROW EXIST
- var _actli = opt.nextSlide === -1 || opt.nextSlide===undefined ? 0 : opt.nextSlide;
- if (opt.rowzones!==undefined)
- _actli = _actli>opt.rowzones.length ? opt.rowzones.length : _actli;
- if (opt.rowzones!=undefined && opt.rowzones.length>0 && opt.rowzones[_actli]!=undefined && _actli>=0 && _actli<=opt.rowzones.length && opt.rowzones[_actli].length>0)
- _R.setSize(opt);
-
-
- // RESTART ANIMATION TIMELINES
-
- if (!preset)
- if (startSlideAnimAt!==undefined) {
- if (index!==undefined)
- jQuery.each(opt.timelines[index].layers,function(key,o) {
- var _ = o.layer.data();
- if (o.wrapper==="none" || o.wrapper===undefined) {
- if (o.triggerstate=="keep" && _.triggerstate==="on")
- _R.playAnimationFrame({caption:o.layer,opt:opt,frame:"frame_0", triggerdirection:"in", triggerframein:"frame_0", triggerframeout:"frame_999"});
- else
- o.timeline.restart();
- }
- });
- if (opt.timelines.staticlayers)
- jQuery.each(opt.timelines.staticlayers.layers,function(key,o) {
-
- var _ = o.layer.data(),
- in_v_range = _actli>=o.firstslide && _actli<=o.lastslide,
- in_uv_range = _actli<o.firstslide || _actli>o.lastslide,
- flt = o.timeline.getLabelTime("slide_"+o.firstslide),
- elt = o.timeline.getLabelTime("slide_"+o.lastslide),
- ct = _.static_layer_timeline_time,
- isvisible = _.animdirection==="in" ? true : _.animdirection==="out" ? false : undefined,
- triggered_in = _.frames[0].delay==="bytrigger",
- triggered_out = _.frames[_.frames.length-1].delay==="bytrigger",
- layer_start_status = _.triggered_startstatus,
- triggerstate = _.lasttriggerstate;
-
- if (_.hoveredstatus===true || _.inhoveroutanimation==true) return;
- /*console.log("-----------------------")
- console.log("Show Static Layer Start")
- console.log("-----------------------")
- console.log(ct);
- console.log(isvisible)*/
- // LAYER ALREADY VISIBLE, TIMER IS NOT UNKNOW ANY MORE
- if (ct!==undefined && isvisible) {
- if (triggerstate=="keep") {
-
- _R.playAnimationFrame({caption:o.layer,opt:opt,frame:"frame_0", triggerdirection:"in", triggerframein:"frame_0", triggerframeout:"frame_999"});
- _.triggeredtimeline.time(ct);
- }
- else {
-
- if (_.hoveredstatus!==true)
- o.timeline.time(ct);
- }
- }
-
- // RESET STATUS ALWAYS TO HIDDEN
- if (triggerstate==="reset" && layer_start_status==="hidden") {
- //console.log("Pre Path X");
- o.timeline.time(0);
- _.animdirection = "out";
- }
-
- //console.log("in Range:"+in_v_range+" "+o.firstslide+" <= "+_actli+" <= "+o.lastslide);
- // LAYER IS ON SLIDE TO SHOW, OR LAYER NEED TO DISAPPEAR
- if (in_v_range) {
- if (isvisible) {
- //console.log("Path A");
- if (_actli===o.lastslide) {
- //console.log("Path A.1");
- o.timeline.play(elt);
- _.animdirection = "in";
- }
- } else {
- //console.log("Path B");
- //console.log(triggered_in+" "+_.animdirection)
- if (!triggered_in && _.animdirection!=="in") {
- //console.log("Path B.1")
- o.timeline.play(flt);
- }
- if ((layer_start_status=="visible" && triggerstate!=="keep") || (triggerstate==="keep" && isvisible===true) || (layer_start_status=="visible" && isvisible===undefined)) {
- //console.log("Path B.2");
- o.timeline.play(flt+0.01);
- _.animdirection = "in";
- }
- }
- } else {
- //console.log("Path C");
- if (in_uv_range) {
- //console.log("Path C.1");
- if (isvisible) {
- //console.log("Path C.1.1")
- o.timeline.play("frame_999");
- } else {
- //console.log("Path C.1.2")
- }
- }
- }
-
- });
-
- }
-
-
-
- // RESUME THE MAIN TIMELINE NOW
- if (mtl != undefined) setTimeout(function() {
-
- mtl.resume();
- },30);
-
-
- },
-
- /********************************************
- PREPARE ALL LAYER SIZES, POSITION
- ********************************************/
- prepareSingleCaption : function(obj) {
- var _nc = obj.caption,
- _ = _nc.data(),
- opt = obj.opt,
- recall = obj.recall,
- internrecall = obj.recall,
- preset = obj.preset,
- rtl = jQuery('body').hasClass("rtl"),
- datas
- _._pw = _._pw===undefined ? _nc.closest('.tp-parallax-wrap') : _._pw;
- _._lw = _._lw===undefined ? _nc.closest('.tp-loop-wrap') : _._lw;
- _._mw = _._mw===undefined ? _nc.closest('.tp-mask-wrap') : _._mw;
-
- _._responsive = _.responsive || "on";
- _._respoffset = _.responsive_offset || "on";
- _._ba = _.basealign || "grid";
- _._gw = _._ba==="grid" ? opt.width : opt.ulw;
- _._gh = _._ba==="grid" ? opt.height : opt.ulh;
-
- _._lig = _._lig===undefined ? _nc.hasClass("rev_layer_in_group") ? _nc.closest('.rev_group') : _nc.hasClass("rev_layer_in_column") ?_nc.closest('.rev_column_inner') : _nc.hasClass("rev_column_inner") ? _nc.closest(".rev_row") : "none" : _._lig,
- _._column = _._column===undefined ? _nc.hasClass("rev_column_inner") ? _nc.closest(".rev_column") : "none" : _._column,
- _._row = _._row===undefined ? _nc.hasClass("rev_column_inner") ? _nc.closest(".rev_row") : "none" : _._row,
- _._ingroup = _._ingroup===undefined ? !_nc.hasClass('rev_group') && _nc.closest('.rev_group') ? true : false :_._ingroup;
- _._isgroup = _._isgroup===undefined ? _nc.hasClass("rev_group") ? true : false : _._isgroup;
- _._nctype = _.type || "none";
- _._cbgc_auto = _._cbgc_auto===undefined ? _._nctype==="column" ? _._pw.find('.rev_column_bg_auto_sized') : false : _._cbgc_auto;
- _._cbgc_man = _._cbgc_man===undefined ? _._nctype==="column" ? _._pw.find('.rev_column_bg_man_sized') : false : _._cbgc_man;
- _._slideid = _._slideid || _nc.closest('.tp-revslider-slidesli').data('index');
- _._id = _._id===undefined ? _nc.data('id') || _nc.attr('id') : _._id;
- _._slidelink = _._slidelink===undefined ? _nc.hasClass("slidelink")===undefined ? false : _nc.hasClass("slidelink") : _._slidelink;
- if (_._li===undefined)
- if (_nc.hasClass("tp-static-layer")) {
- _._isstatic = true;
- _._li = _nc.closest('.tp-static-layers');
- _._slideid = "staticlayers";
- } else {
- _._li = _nc.closest('.tp-revslider-slidesli');
- }
- _._row = _._row===undefined ? _._nctype==="column" ? _._pw.closest('.rev_row') : false : _._row;
-
- if (_._togglelisteners===undefined && _nc.find('.rs-toggled-content')) {
- _._togglelisteners = true;
- if (_.actions===undefined) _nc.click(function() {_R.swaptoggleState(_nc); })
-
- } else {
- _._togglelisteners = false;
- }
- if (opt.sliderLayout=="fullscreen")
- obj.offsety = _._gh/2 - (opt.gridheight[opt.curWinRange]*opt.bh)/2;
- if (opt.autoHeight=="on" || (opt.minHeight!=undefined && opt.minHeight>0))
- obj.offsety = opt.conh/2 - (opt.gridheight[opt.curWinRange]*opt.bh)/2;;
- if (obj.offsety<0) obj.offsety=0;
-
- // LAYER GRID FOR DEBUGGING
- if (opt.debugMode) {
- _nc.closest('li').find('.helpgrid').css({top:obj.offsety+"px", left:obj.offsetx+"px"});
- var linfo = opt.c.find('.hglayerinfo');
- _nc.on("hover, mouseenter",function() {
- var ltxt = "",
- spa = 0;
- if (_nc.data())
- jQuery.each(_nc.data(),function(key,val) {
- if (typeof val !== "object") {
-
- ltxt = ltxt + '<span style="white-space:nowrap"><span style="color:#27ae60">'+key+":</span>"+val+"</span> ";
-
- }
- });
- linfo.html(ltxt);
- });
- }
- /* END OF DEBUGGING */
- var handlecaption=0,
- layervisible = _.visibility === undefined ? "oon" : makeArray(_.visibility,opt)[opt.forcedWinRange] || makeArray(_.visibility,opt) || "ooon";
-
- // HIDE CAPTION IF RESOLUTION IS TOO LOW
- if (layervisible==="off" || (_._gw<opt.hideCaptionAtLimit && _.captionhidden=="on") || (_._gw<opt.hideAllCaptionAtLimit))
- _._pw.addClass("tp-hidden-caption");
- else
- _._pw.removeClass("tp-hidden-caption")
- _.layertype = "html";
-
- if (obj.offsetx<0) obj.offsetx=0;
- // FALL BACK TO NORMAL IMAGES
- if (_.thumbimage !=undefined && _.videoposter==undefined)
- _.videoposter = _.thumbimage;
-
- // IF IT IS AN IMAGE
- if (_nc.find('img').length>0) {
- var im = _nc.find('img');
- _.layertype = "image";
- if (im.width()==0) im.css({width:"auto"});
- if (im.height()==0) im.css({height:"auto"});
- if (im.data('ww') == undefined && im.width()>0) im.data('ww',im.width());
- if (im.data('hh') == undefined && im.height()>0) im.data('hh',im.height());
- var ww = im.data('ww'),
- hh = im.data('hh'),
- fuw = _._ba =="slide" ? opt.ulw : opt.gridwidth[opt.curWinRange],
- fuh = _._ba =="slide" ? opt.ulh : opt.gridheight[opt.curWinRange];
-
- ww = makeArray(im.data('ww'),opt)[opt.curWinRange] || makeArray(im.data('ww'),opt) || "auto",
- hh = makeArray(im.data('hh'),opt)[opt.curWinRange] || makeArray(im.data('hh'),opt) || "auto";
-
- var wful = ww==="full" || ww === "full-proportional",
- hful = hh==="full" || hh === "full-proportional";
- if (ww==="full-proportional") {
- var ow = im.data('owidth'),
- oh = im.data('oheight');
- if (ow/fuw < oh/fuh) {
- ww = fuw;
- hh = oh*(fuw/ow);
- } else {
- hh = fuh;
- ww = ow*(fuh/oh);
- }
- } else {
-
- ww = wful ? fuw : !jQuery.isNumeric(ww) && ww.indexOf("%")>0 ? ww : parseFloat(ww);
- hh = hful ? fuh : !jQuery.isNumeric(hh) && hh.indexOf("%")>0 ? hh : parseFloat(hh);
- }
-
- ww = ww===undefined ? 0 : ww;
- hh = hh===undefined ? 0 : hh;
-
- if (_._responsive!=="off") {
- if (_._ba!="grid" && wful)
- if (jQuery.isNumeric(ww))
- im.css({width:ww+"px"});
- else
- im.css({width:ww});
- else
- if (jQuery.isNumeric(ww))
- im.css({width:(ww*opt.bw)+"px"});
- else
- im.css({width:ww});
-
- if (_._ba!="grid" && hful)
- if (jQuery.isNumeric(hh))
- im.css({height:hh+"px"});
- else
- im.css({height:hh});
-
- else
- if (jQuery.isNumeric(hh))
- im.css({height:(hh*opt.bh)+"px"});
- else
- im.css({height:hh});
-
- } else {
- im.css({width:ww, height:hh});
-
- }
-
- if (_._ingroup && _._nctype!=="row") {
- if (ww!==undefined && !jQuery.isNumeric(ww) && jQuery.type(ww)==="string" && ww.indexOf("%")>0)
- punchgs.TweenLite.set([_._lw,_._pw,_._mw],{minWidth:ww});
-
- if (hh!==undefined && !jQuery.isNumeric(hh) && jQuery.type(hh)==="string" && hh.indexOf("%")>0)
- punchgs.TweenLite.set([_._lw,_._pw,_._mw],{minHeight:hh});
- }
-
-
- }
-
- if (_._ba==="slide") {
- obj.offsetx = 0;
- obj.offsety=0;
- } else {
- if (_._isstatic && opt.carousel!==undefined && opt.carousel.horizontal_align!==undefined && opt.sliderType==="carousel") {
- switch (opt.carousel.horizontal_align) {
- case "center":
- obj.offsetx = 0 + (opt.ulw - (opt.gridwidth[opt.curWinRange]*opt.bw))/2;
- break;
- case "left":
- break;
- case "right":
- obj.offsetx = (opt.ulw - (opt.gridwidth[opt.curWinRange]*opt.bw));
- break;
- }
- obj.offsetx = obj.offsetx<0 ? 0 : obj.offsetx;
- }
- }
- var tag = _.audio=="html5" ? "audio" : "video";
- // IF IT IS A VIDEO LAYER
- if (_nc.hasClass("tp-videolayer") || _nc.hasClass("tp-audiolayer") || _nc.find('iframe').length>0 || _nc.find(tag).length>0) {
- _.layertype = "video";
- if (_R.manageVideoLayer) _R.manageVideoLayer(_nc,opt,recall,internrecall);
- if (!recall && !internrecall) {
- var t = _.videotype;
- if (_R.resetVideo) _R.resetVideo(_nc,opt,obj.preset);
- }
-
- var asprat = _.aspectratio;
- if (asprat!=undefined && asprat.split(":").length>1)
- _R.prepareCoveredVideo(asprat,opt,_nc);
- var im = _nc.find('iframe') ? _nc.find('iframe') : im = _nc.find(tag),
- html5vid = _nc.find('iframe') ? false : true,
- yvcover = _nc.hasClass('coverscreenvideo');
-
- im.css({display:"block"});
- // SET WIDTH / HEIGHT
- if (_nc.data('videowidth') == undefined) {
- _nc.data('videowidth',im.width());
- _nc.data('videoheight',im.height());
- }
- var ww = makeArray(_nc.data('videowidth'),opt)[opt.curWinRange] || makeArray(_nc.data('videowidth'),opt) || "auto",
- hh = makeArray(_nc.data('videoheight'),opt)[opt.curWinRange] || makeArray(_nc.data('videoheight'),opt) || "auto";
-
- /*if (!jQuery.isNumeric(ww) && ww.indexOf("%")>0) {
- hh = (parseFloat(hh)*opt.bh)+"px";
- } else {
- ww = (parseFloat(ww)*opt.bw)+"px";
- hh = (parseFloat(hh)*opt.bh)+"px";
- }*/
- if (ww==="auto" || (!jQuery.isNumeric(ww) && ww.indexOf("%")>0)) {
- ww = ww==="auto" ? "auto" : _._ba==="grid" ? opt.gridwidth[opt.curWinRange]*opt.bw : _._gw;
- } else {
- ww = (parseFloat(ww)*opt.bw)+"px";
- }
- if (hh==="auto" || (!jQuery.isNumeric(hh) && hh.indexOf("%")>0)) {
- hh = hh==="auto" ? "auto" : _._ba==="grid" ? opt.gridheight[opt.curWinRange]*opt.bw : _._gh;
- } else {
- hh = (parseFloat(hh)*opt.bh)+"px";
- }
-
- // READ AND WRITE CSS SETTINGS OF IFRAME AND VIDEO FOR RESIZING ELEMENST ON DEMAND
- _.cssobj = _.cssobj===undefined ? getcssParams(_nc,0) : _.cssobj;
-
- var ncobj = setResponsiveCSSValues(_.cssobj,opt);
-
- // IE8 FIX FOR AUTO LINEHEIGHT
- if (ncobj.lineHeight=="auto") ncobj.lineHeight = ncobj.fontSize+4;
-
- if (!_nc.hasClass('fullscreenvideo') && !yvcover) {
-
- punchgs.TweenLite.set(_nc,{
- paddingTop: Math.round((ncobj.paddingTop * opt.bh)) + "px",
- paddingBottom: Math.round((ncobj.paddingBottom * opt.bh)) + "px",
- paddingLeft: Math.round((ncobj.paddingLeft* opt.bw)) + "px",
- paddingRight: Math.round((ncobj.paddingRight * opt.bw)) + "px",
- marginTop: (ncobj.marginTop * opt.bh) + "px",
- marginBottom: (ncobj.marginBottom * opt.bh) + "px",
- marginLeft: (ncobj.marginLeft * opt.bw) + "px",
- marginRight: (ncobj.marginRight * opt.bw) + "px",
- borderTopWidth: Math.round(ncobj.borderTopWidth * opt.bh) + "px",
- borderBottomWidth: Math.round(ncobj.borderBottomWidth * opt.bh) + "px",
- borderLeftWidth: Math.round(ncobj.borderLeftWidth * opt.bw) + "px",
- borderRightWidth: Math.round(ncobj.borderRightWidth * opt.bw) + "px",
- width:ww,
- height:hh
- });
- } else {
- obj.offsetx=0; obj.offsety=0;
- _nc.data('x',0)
- _nc.data('y',0)
- var ovhh = _._gh;
- if (opt.autoHeight=="on") ovhh = opt.conh
- _nc.css({'width':_._gw, 'height':ovhh });
- }
-
- if ((html5vid == false && !yvcover) || ((_.forcecover!=1 && !_nc.hasClass('fullscreenvideo') && !yvcover))) {
- im.width(ww);
- im.height(hh);
- }
- if (_._ingroup) {
- if (_.videowidth!==null && _.videowidth!==undefined && !jQuery.isNumeric(_.videowidth) && _.videowidth.indexOf("%")>0)
- punchgs.TweenLite.set([_._lw,_._pw,_._mw],{minWidth:_.videowidth});
- }
- } // END OF POSITION AND STYLE READ OUTS OF VIDEO
-
- // RESPONIVE HANDLING OF CURRENT LAYER
- calcCaptionResponsive(_nc,opt,0,_._responsive);
-
- // ALL ELEMENTS IF THE MAIN ELEMENT IS REKURSIVE RESPONSIVE SHOULD BE REPONSIVE HANDLED
- if (_nc.hasClass("tp-resizeme"))
- _nc.find('*').each(function() {
- calcCaptionResponsive(jQuery(this),opt,"rekursive",_._responsive);
- });
-
- // _nc FRONTCORNER CHANGES
- var ncch = _nc.outerHeight(),
- bgcol = _nc.css('backgroundColor');
- sharpCorners(_nc,'.frontcorner','left','borderRight','borderTopColor',ncch,bgcol);
- sharpCorners(_nc,'.frontcornertop','left','borderRight','borderBottomColor',ncch,bgcol);
- sharpCorners(_nc,'.backcorner','right','borderLeft','borderBottomColor',ncch,bgcol);
- sharpCorners(_nc,'.backcornertop','right','borderLeft','borderTopColor',ncch,bgcol);
- if (opt.fullScreenAlignForce == "on") {
- obj.offsetx=0;
- obj.offsety=0;
- }
-
- // BLOCK ANIMATION ON LAYERS
- if (_._sfx==="block")
- if (_._bmask === undefined) {
- _._bmask = jQuery('<div class="tp-blockmask"></div>');
- _._mw.append(_._bmask);
- }
-
-
- _.arrobj = new Object();
- _.arrobj.voa = makeArray(_.voffset,opt)[opt.curWinRange] || makeArray(_.voffset,opt)[0];
- _.arrobj.hoa = makeArray(_.hoffset,opt)[opt.curWinRange] || makeArray(_.hoffset,opt)[0];
- _.arrobj.elx = makeArray(_.x,opt)[opt.curWinRange] || makeArray(_.x,opt)[0];
- _.arrobj.ely = makeArray(_.y,opt)[opt.curWinRange] || makeArray(_.y,opt)[0];
-
-
- var voa = _.arrobj.voa.length==0 ? 0 : _.arrobj.voa,
- hoa = _.arrobj.hoa.length==0 ? 0 : _.arrobj.hoa,
- elx = _.arrobj.elx.length==0 ? 0 : _.arrobj.elx,
- ely = _.arrobj.ely.length==0 ? 0 : _.arrobj.ely;
-
-
-
- _.eow = _nc.outerWidth(true);
- _.eoh = _nc.outerHeight(true);
-
-
- // NEED CLASS FOR FULLWIDTH AND FULLHEIGHT LAYER SETTING !!
- if (_.eow==0 && _.eoh==0) {
- _.eow = opt.ulw;
- _.eoh = opt.ulh;
- }
-
- var vofs= _._respoffset !=="off" ? parseInt(voa,0)*opt.bw : parseInt(voa,0),
- hofs= _._respoffset !=="off" ? parseInt(hoa,0)*opt.bw : parseInt(hoa,0),
- crw = _._ba==="grid" ? opt.gridwidth[opt.curWinRange]*opt.bw : _._gw,
- crh = _._ba==="grid" ? opt.gridheight[opt.curWinRange]*opt.bw : _._gh;
-
- if (opt.fullScreenAlignForce == "on") {
- crw = opt.ulw;
- crh = opt.ulh;
- }
-
- // ALIGN POSITIONED ELEMENTS
- if (_._lig!=="none" && _._lig!=undefined) {
- crw=_._lig.width();
- crh=_._lig.height();
- obj.offsetx =0;
- obj.offsety = 0;
- }
-
-
- elx = elx==="center" || elx==="middle" ? (crw/2 - _.eow/2) + hofs : elx==="left" ? hofs : elx==="right" ? (crw - _.eow) - hofs : _._respoffset !=="off" ? elx * opt.bw : elx;
- ely = ely=="center" || ely=="middle" ? (crh/2 - _.eoh/2) + vofs : ely =="top" ? vofs : ely=="bottom" ? (crh - _.eoh)-vofs : _._respoffset !=="off" ? ely*opt.bw : ely;
-
- if (rtl && !_._slidelink)
- elx = elx + _.eow;
-
- if (_._slidelink) elx=0;
-
- _.calcx = (parseInt(elx,0)+obj.offsetx);
- _.calcy = (parseInt(ely,0)+obj.offsety);
-
- var tpcapindex = _nc.css("z-Index");
-
-
- // SET TOP/LEFT POSITION OF LAYER
- if (_._nctype!=="row" && _._nctype!=="column")
- punchgs.TweenLite.set(_._pw,{zIndex:tpcapindex, top:_.calcy,left:_.calcx,overwrite:"auto"});
- else
- if (_._nctype!=="row")
- punchgs.TweenLite.set(_._pw,{zIndex:tpcapindex, width:_.columnwidth, top:0,left:0,overwrite:"auto"});
- else
- if (_._nctype==="row") {
- var _roww = _._ba==="grid" ? crw+"px" : "100%";
- punchgs.TweenLite.set(_._pw,{zIndex:tpcapindex, width:_roww, top:0,left:obj.offsetx,overwrite:"auto"});
- }
- if (_.blendmode!==undefined)
- punchgs.TweenLite.set(_._pw,{mixBlendMode:_.blendmode});
-
- /*if (_._nctype==="svg") {
- _.svgcontainer = _.svgcontainer===undefined ? _nc.find('.tp-svg-innercontainer') : _.svgcontainer;
- punchgs.TweenLite.set(_.svgcontainer,{ ... });
- }*/
- //SET ROW BROKEN / TABLE FORMED
- if (_._nctype==="row") {
- if (_.columnbreak<=opt.curWinRange) {
- _nc.addClass("rev_break_columns");
- } else {
- _nc.removeClass("rev_break_columns");
- }
- }
- // LOOP ANIMATION WIDTH/HEIGHT
- if (_.loopanimation=="on") punchgs.TweenLite.set(_._lw,{minWidth:_.eow,minHeight:_.eoh});
- //Preset Position of BG
- if (_._nctype==="column") {
- var tempy = _nc[0]._gsTransform !==undefined ? _nc[0]._gsTransform.y : 0,
- pT = parseInt(_._column[0].style.paddingTop,0);
- punchgs.TweenLite.set(_nc,{y:0});
- punchgs.TweenLite.set(_._cbgc_man,{y:parseInt(( pT+_._column.offset().top-_nc.offset().top),0)});
- punchgs.TweenLite.set(_nc,{y:tempy});
- }
- // ELEMENT IN GROUPS WITH % WIDTH AND HEIGHT SHOULD EXTEND PARRENT SIZES
- if (_._ingroup && _._nctype!=="row") {
- if (_._groupw!==undefined && !jQuery.isNumeric(_._groupw) && _._groupw.indexOf("%")>0)
- punchgs.TweenLite.set([_._lw,_._pw,_._mw],{minWidth:_._groupw});
-
- if (_._grouph!==undefined && !jQuery.isNumeric(_._grouph) && _._grouph.indexOf("%")>0)
- punchgs.TweenLite.set([_._lw,_._pw,_._mw],{minHeight:_._grouph});
- }
- },
- /********************************************
- BUILD THE TIMELINE STRUCTURES
- ********************************************/
- createTimelineStructure : function(opt) {
-
-
- // COLLECTION OF TIMELINES
- opt.timelines = opt.timelines || new Object();
-
- function addTimeLineWithLabel(layer,opt,parentobject,slideid) {
- var timeline = new punchgs.TimelineLite({paused:true}),
- c;
-
- parentobject = parentobject || new Object();
- parentobject[layer.attr('id')] = parentobject[layer.attr('id')] || new Object();
- if (slideid==="staticlayers") {
- parentobject[layer.attr('id')].firstslide = layer.data('startslide');
- parentobject[layer.attr('id')].lastslide = layer.data('endslide');
- }
- layer.data('slideid',slideid);
- parentobject[layer.attr('id')].defclasses=c=layer[0].className;
- parentobject[layer.attr('id')].wrapper = c.indexOf("rev_layer_in_column")>=0 ? layer.closest('.rev_column_inner') : c.indexOf("rev_column_inner")>=0 ? layer.closest(".rev_row") : c.indexOf("rev_layer_in_group")>=0 ? layer.closest(".rev_group") : "none";
- parentobject[layer.attr('id')].timeline = timeline;
- parentobject[layer.attr('id')].layer = layer;
- parentobject[layer.attr('id')].triggerstate = layer.data('lasttriggerstate');
- parentobject[layer.attr('id')].dchildren = c.indexOf("rev_row")>=0 ? layer[0].getElementsByClassName('rev_column_inner') : c.indexOf("rev_column_inner")>=0 ? layer[0].getElementsByClassName('tp-caption') : c.indexOf("rev_group")>=0 ? layer[0].getElementsByClassName('rev_layer_in_group') : "none";
- layer.data('timeline',timeline);
-
- }
- //GO THROUGH ALL LI
- opt.c.find('.tp-revslider-slidesli, .tp-static-layers').each(function() {
- var slide = jQuery(this),
- index = slide.data('index');
- opt.timelines[index] = opt.timelines[index] || {};
-
- opt.timelines[index].layers = opt.timelines[index].layers || new Object();
-
- // COLLECT LAYERS
- slide.find('.tp-caption').each(function(i) {
- addTimeLineWithLabel(jQuery(this),opt,opt.timelines[index].layers,index);
- });
- });
-
-
-
- },
- /***************************************
- - BUILD CAPTION FULL TIMELINES -
- ***************************************/
- buildFullTimeLine : function(obj) {
-
- //if (obj.recall) return;
- var _nc = obj.caption,
- _ = _nc.data(),
- opt = obj.opt,
- $svg = {},
- _nc_tl_obj,
- _nc_timeline,
- $hover = newHoverAnimObject(),
- timelineprog = 0;
-
- _nc_tl_obj = opt.timelines[_._slideid]["layers"][_._id];
- if (_nc_tl_obj.generated && obj.regenerate!==true) return;
- _nc_timeline = _nc_tl_obj.timeline;
-
- _nc_tl_obj.generated = true;
-
- if (_.current_timeline!==undefined && obj.regenerate!==true) {
- _.current_timeline_pause = _.current_timeline.paused();
- _.current_timeline_time = _.current_timeline.time();
- _.current_is_nc_timeline = _nc_timeline === _.current_timeline;
- _.static_layer_timeline_time = _.current_timeline_time;
- } else {
- _.static_layer_timeline_time = _.current_timeline_time;
- _.current_timeline_time = 0;
- if (_.current_timeline) _.current_timeline.clear();
- }
-
- _nc_timeline.clear();
-
- // PRESET SVG STYLE
- $svg.svg = _.svg_src!=undefined ? _nc.find('svg') : false;
- if ($svg.svg) {
- _.idlesvg = setSVGAnimObject(_.svg_idle,newSVGHoverAnimObject());
- punchgs.TweenLite.set($svg.svg,_.idlesvg.anim);
- }
-
- // HOVER ANIMATION
- if (_.hoverframeindex!==-1 && _.hoverframeindex!==undefined) {
-
- if (!_nc.hasClass("rs-hover-ready")) {
- _nc.addClass("rs-hover-ready");
- _.hovertimelines = {};
-
- _.hoveranim = getAnimDatas($hover,_.frames[_.hoverframeindex].to);
- _.hoveranim = convertHoverStyle(_.hoveranim,_.frames[_.hoverframeindex].style);
-
- if ($svg.svg) {
- var $svghover = setSVGAnimObject(_.svg_hover,newSVGHoverAnimObject());
- if (_.hoveranim.anim.color!=undefined) {
- $svghover.anim.fill = _.hoveranim.anim.color;
- _.idlesvg.anim.css.fill = $svg.svg.css("fill");
-
- }
-
- _.hoversvg = $svghover;
- }
- _nc.hover(function(e) {
- var obj = {caption:jQuery(e.currentTarget), opt:opt, firstframe : "frame_0", lastframe:"frame_999"},
- tl = getTLInfos(obj),
- nc = obj.caption,
- _ = nc.data(),
- frame = _.frames[_.hoverframeindex],
- animended = true;
-
- _.forcehover = frame.force;
-
- if (animended) {
- _.hovertimelines.item = punchgs.TweenLite.to(nc,frame.speed/1000,_.hoveranim.anim);
- if (_.hoverzIndex || (_.hoveranim.anim && _.hoveranim.anim.zIndex)) {
- _.basiczindex = _.basiczindex===undefined ? _.cssobj.zIndex : _.basiczindex;
- _.hoverzIndex = _.hoverzIndex===undefined ? _.hoveranim.anim.zIndex : _.hoverzIndex;
- _.inhoverinanimation = true;
- if (frame.speed===0) _.inhoverinanimation= false;
- _.hovertimelines.pwhoveranim = punchgs.TweenLite.to(_._pw,frame.speed/1000,{overwrite:"auto",zIndex:_.hoverzIndex});
- _.hovertimelines.pwhoveranim.eventCallback("onComplete",function(_) {
- _.inhoverinanimation=false;;
- },[_])
- }
- if ($svg.svg)
- _.hovertimelines.svghoveranim = punchgs.TweenLite.to([$svg.svg, $svg.svg.find('path')],frame.speed/1000,_.hoversvg.anim);
- _.hoveredstatus = true;
- }
- },
- function(e) {
-
- var obj = {caption:jQuery(e.currentTarget), opt:opt, firstframe : "frame_0", lastframe:"frame_999"},
- tl = getTLInfos(obj),
- nc = obj.caption,
- _ = nc.data(),
- frame = _.frames[_.hoverframeindex],
- animended = true;
-
- if (animended) {
- _.hoveredstatus = false;
- _.inhoveroutanimation = true;
- _.hovertimelines.item.pause();
- _.hovertimelines.item = punchgs.TweenLite.to(nc,frame.speed/1000,jQuery.extend(true,{},_._gsTransformTo));
-
- if (frame.speed==0) _.inhoveroutanimation= false;
- _.hovertimelines.item.eventCallback("onComplete",function(_) {
-
- _.inhoveroutanimation=false;;
- },[_])
- if (_.hovertimelines.pwhoveranim!==undefined) _.hovertimelines.pwhoveranim = punchgs.TweenLite.to(_._pw,frame.speed/1000,{overwrite:"auto",zIndex:_.basiczindex});
- if ($svg.svg) punchgs.TweenLite.to([$svg.svg, $svg.svg.find('path')],frame.speed/1000,_.idlesvg.anim);
- }
- });
- }
- } // END IF HOVER ANIMATION
-
-
- // LOOP TROUGH THE FRAMES AND CREATE FRAME TWEENS AND TL'S ON THE MAIN TIMELINE
- for (var frame_index=0; frame_index<_.frames.length;frame_index++) {
-
- if (frame_index !== _.hoverframeindex) {
-
- // Create a new Timeline for each Frame
- var frame_name = frame_index === _.inframeindex ? "frame_0" : frame_index===_.outframeindex || _.frames[frame_index].frame==="frame_999" ? "frame_999" : "frame_"+frame_index;
- _.frames[frame_index].framename = frame_name;
- _nc_tl_obj[frame_name] = {};
- _nc_tl_obj[frame_name].timeline = new punchgs.TimelineLite({align:"normal"});
-
- var $start = _.frames[frame_index].delay,
- $start_status = _.triggered_startstatus,
- mdelay = $start !== undefined ? jQuery.inArray($start,["slideenter","bytrigger","wait"])>=0 ? $start : parseInt($start,0)/1000 : "wait";
-
- // ADD STARTLABEL FOR STATIC LAYERS
- if (_nc_tl_obj.firstslide!==undefined && frame_name==="frame_0") {
- _nc_timeline.addLabel("slide_"+_nc_tl_obj.firstslide+"_pause",0);
- _nc_timeline.addPause("slide_"+_nc_tl_obj.firstslide+"_pause");
- _nc_timeline.addLabel("slide_"+_nc_tl_obj.firstslide,"+=0.005");
- }
- // ADD ENDSLIDE LABEL FOR STATIC LAYERS
- if (_nc_tl_obj.lastslide!==undefined && frame_name==="frame_999") {
- _nc_timeline.addLabel("slide_"+_nc_tl_obj.lastslide+"_pause","+=0.01");
- _nc_timeline.addPause("slide_"+_nc_tl_obj.lastslide+"_pause");
- _nc_timeline.addLabel("slide_"+_nc_tl_obj.lastslide,"+=0.005");
- }
-
- if (!jQuery.isNumeric(mdelay)) {
- _nc_timeline.addLabel("pause_"+frame_index,"+=0.01");
- _nc_timeline.addPause("pause_"+frame_index);
- _nc_timeline.addLabel(frame_name,"+=0.01");
- } else {
- _nc_timeline.addLabel(frame_name,"+="+mdelay);
- }
-
- _nc_timeline = _R.createFrameOnTimeline({caption:obj.caption, timeline : _nc_timeline, label:frame_name, frameindex : frame_index, opt:opt });
-
- } //
- } // END OF LOOP THROUGH FRAMES AND CREATING NEW TWEENS
- //_nc_timeline.time(timelineprog);
- if (!obj.regenerate) {
- if (_.current_is_nc_timeline)
- _.current_timeline = _nc_timeline;
- if (_.current_timeline_pause)
- _nc_timeline.pause(_.current_timeline_time);
- else
- _nc_timeline.time(_.current_timeline_time);
- }
-
- return;
- },
- /////////////////////////////////////
- // BUILD A FRAME ON THE TIMELINE //
- /////////////////////////////////////
- createFrameOnTimeline : function(obj) {
- var _nc = obj.caption,
- _ = _nc.data(),
- label = obj.label,
- timeline = obj.timeline,
- frame_index = obj.frameindex,
- opt = obj.opt,
- animobject = _nc,
- tweens = {},
- _nc_tl_obj = opt.timelines[_._slideid]["layers"][_._id],
- verylastframe = _.frames.length-1,
- $split = _.frames[frame_index].split,
- $splitdir = _.frames[frame_index].split_direction,
- $sfx = _.frames[frame_index].sfx_effect,
- $splitnow = false;
- $splitdir = $splitdir === undefined ? "forward" : $splitdir;
-
- if (_.hoverframeindex!==-1 && _.hoverframeindex==verylastframe) verylastframe=verylastframe-1;
-
- tweens.content = new punchgs.TimelineLite({align:"normal"});
- tweens.mask = new punchgs.TimelineLite({align:"normal"});
-
- if (timeline.vars.id===undefined)
- timeline.vars.id=Math.round(Math.random()*100000);
- if (_._nctype==="column") {
- timeline.add(punchgs.TweenLite.set(_._cbgc_man,{visibility:"visible"}),label);
- timeline.add(punchgs.TweenLite.set(_._cbgc_auto,{visibility:"hidden"}),label);
-
-
- }
- if (_.splittext && frame_index===0) {
- if (_.mySplitText !== undefined) _.mySplitText.revert();
- var splittarget = _nc.find('a').length>0 ? _nc.find('a') : _nc;
- _.mySplitText = new punchgs.SplitText(splittarget,{type:"chars,words,lines",charsClass:"tp-splitted tp-charsplit",wordsClass:"tp-splitted tp-wordsplit",linesClass:"tp-splitted tp-linesplit"});
- _nc.addClass("splitted");
- }
-
- if ( _.mySplitText !==undefined && $split && $split.match(/chars|words|lines/g)) {
- animobject = _.mySplitText[$split];
- $splitnow = true;
- }
-
- // ANIMATE THE FRAME
-
- var $to = frame_index!==_.outframeindex ? getAnimDatas(newAnimObject(),_.frames[frame_index].to,undefined,$splitnow,animobject.length-1) : _.frames[frame_index].to !==undefined && _.frames[frame_index].to.match(/auto:auto/g)===null ? getAnimDatas(newEndAnimObject(),_.frames[frame_index].to,opt.sdir==1,$splitnow,(animobject.length-1)) : getAnimDatas(newEndAnimObject(),_.frames[_.inframeindex].from,opt.sdir==0,$splitnow,(animobject.length-1)),
- $from = _.frames[frame_index].from !==undefined ? getAnimDatas($to,_.frames[_.inframeindex].from,opt.sdir==1,$splitnow,animobject.length-1) : undefined, // ANIMATE FROM THE VERY FIRST SETTING, OR FROM PREVIOUS SETTING
- $elemdelay = _.frames[frame_index].splitdelay,
- $mask_from,$mask_to;
- if (frame_index===0 && !obj.fromcurrentstate)
- $mask_from = getMaskDatas(_.frames[frame_index].mask);
- else
- $mask_to = getMaskDatas(_.frames[frame_index].mask);
-
- $to.anim.ease = _.frames[frame_index].ease===undefined ? punchgs.Power1.easeInOut : _.frames[frame_index].ease;
-
- if ($from!==undefined) {
- $from.anim.ease = _.frames[frame_index].ease===undefined ? punchgs.Power1.easeInOut : _.frames[frame_index].ease;
- $from.speed = _.frames[frame_index].speed === undefined ? $from.speed : _.frames[frame_index].speed;
- $from.anim.x = $from.anim.x * opt.bw || getBorderDirections($from.anim.x,opt,_.eow,_.eoh,_.calcy,_.calcx, "horizontal" );
- $from.anim.y = $from.anim.y * opt.bw || getBorderDirections($from.anim.y,opt,_.eow,_.eoh,_.calcy,_.calcx, "vertical" );
-
- }
- if ($to!==undefined) {
- $to.anim.ease = _.frames[frame_index].ease===undefined ? punchgs.Power1.easeInOut : _.frames[frame_index].ease;
- $to.speed = _.frames[frame_index].speed === undefined ? $to.speed : _.frames[frame_index].speed;
- $to.anim.x = $to.anim.x * opt.bw || getBorderDirections($to.anim.x,opt,_.eow,_.eoh,_.calcy,_.calcx, "horizontal" );
- $to.anim.y = $to.anim.y * opt.bw || getBorderDirections($to.anim.y,opt,_.eow,_.eoh,_.calcy,_.calcx, "vertical" );
-
- }
-
- // FIX VISIBLE IFRAME BUG IN SAFARI
- if (_nc.data('iframes')) timeline.add(punchgs.TweenLite.set(_nc.find('iframe'),{autoAlpha:1}),label+"+=0.001");
-
- // IN CASE LAST FRAME REACHED, AND ANIMATION IS SET TO AUTO (REVERSE PLAYING)
- if (frame_index===_.outframeindex) {
- if (_.frames[frame_index].to && _.frames[frame_index].to.match(/auto:auto/g)) {
- //
- }
-
- $to.speed = _.frames[frame_index].speed === undefined || _.frames[frame_index].speed==="inherit" ? _.frames[_.inframeindex].speed : _.frames[frame_index].speed;
- $to.anim.ease = _.frames[frame_index].ease === undefined || _.frames[frame_index].ease==="inherit" ? _.frames[_.inframeindex].ease : _.frames[frame_index].ease;
- $to.anim.overwrite ="auto";
- }
- // IN CASE FIRST FRAME REACHED
- if (frame_index===0 && !obj.fromcurrentstate) {
-
- if (animobject != _nc) {
- var old = jQuery.extend({},$to.anim,true);
- timeline.add(punchgs.TweenLite.set(_nc, $to.anim),label);
- $to = newAnimObject();
- $to.ease = old.ease;
- if (old.filter!==undefined) $to.anim.filter = old.filter;
- if (old["-webkit-filter"]!==undefined) $to.anim["-webkit-filter"] = old["-webkit-filter"];
- }
- $from.anim.visibility = "hidden";
- $from.anim.immediateRender = true;
- $to.anim.visibility = "visible";
- //_nc.data('speed',$from.speed);
- //_nc.data('ease',$to.anim.ease);
- } else
- if (frame_index===0 && obj.fromcurrentstate) {
- $to.speed = $from.speed;
- }
- if (obj.fromcurrentstate) {
- $to.anim.immediateRender = true;
- }
-
- // SPECIAL EFFECT LAYER ANIMATIONS
- var $sfx_blockdelay = -1;
-
- //Boxed Mask Animation 0 or 999 Frame
- if ((frame_index===0 && !obj.fromcurrentstate && _._bmask!==undefined && $sfx!==undefined && $sfx.indexOf("block")>=0) ||
- (frame_index===_.outframeindex && !obj.fromcurrentstate && _._bmask!==undefined && $sfx!==undefined && $sfx.indexOf("block")>=0)) {
- var $sfx_speed = frame_index===0 ? ($from.speed/1000)/2 : ($to.speed/1000)/2,
- $sfx_ft = [{scaleY:1,scaleX:0,transformOrigin:"0% 50%"},{scaleY:1,scaleX:1,ease:$to.anim.ease}],
- $sfx_t = {scaleY:1,scaleX:0,transformOrigin:"100% 50%",ease:$to.anim.ease};
-
- $sfx_blockdelay = $elemdelay === undefined ? $sfx_speed : $elemdelay + $sfx_speed;
-
- switch ($sfx) {
- case "blocktoleft":
- case "blockfromright":
- $sfx_ft[0].transformOrigin = "100% 50%";
- $sfx_t.transformOrigin = "0% 50%";
- break;
- case "blockfromtop":
- case "blocktobottom":
- $sfx_ft = [{scaleX:1,scaleY:0,transformOrigin:"50% 0%"},{scaleX:1,scaleY:1,ease:$to.anim.ease}];
- $sfx_t = {scaleX:1,scaleY:0,transformOrigin:"50% 100%",ease:$to.anim.ease};
- break;
- case "blocktotop":
- case "blockfrombottom":
- $sfx_ft = [{scaleX:1,scaleY:0,transformOrigin:"50% 100%"},{scaleX:1,scaleY:1,ease:$to.anim.ease}];
- $sfx_t = {scaleX:1,scaleY:0,transformOrigin:"50% 0%",ease:$to.anim.ease};
- break;
- }
- $sfx_ft[0].background = _.frames[frame_index].sfxcolor;
- timeline.add(tweens.mask.fromTo(_._bmask,$sfx_speed, $sfx_ft[0], $sfx_ft[1],$elemdelay),label);
- timeline.add(tweens.mask.to(_._bmask,$sfx_speed,$sfx_t,$sfx_blockdelay),label);
- }
-
- if ($splitnow)
- var ri = getSplitTextDirs(animobject.length-1, $splitdir);
- if (frame_index===0 && !obj.fromcurrentstate) {
- if (_._sfx_in==="block")
- timeline.add(tweens.content.staggerFromTo(animobject,0.05,{x:0,y:0,autoAlpha:0},{x:0,y:0,autoAlpha:1,delay:$sfx_blockdelay}),label);
- else {
- if ($splitnow && ri!==undefined) {
- var cycles = {from:getCycles($from.anim), to:getCycles($to.anim)};
- for (var si in animobject) {
- var $fanim = jQuery.extend({},$from.anim),
- $tanim = jQuery.extend({},$to.anim);
- for (var k in cycles.from) {
- $fanim[k] = parseInt(cycles.from[k].values[cycles.from[k].index],0);
- cycles.from[k].index = cycles.from[k].index < cycles.from[k].len ? cycles.from[k].index+1 : 0;
- }
- $tanim.ease = $fanim.ease;
- if (_.frames[frame_index].color!==undefined) {
- $fanim.color = _.frames[frame_index].color;
- $tanim.color = _.cssobj.styleProps.color;
- }
- if (_.frames[frame_index].bgcolor!==undefined) {
- $fanim.backgroundColor = _.frames[frame_index].bgcolor;
- $tanim.backgroundColor = _.cssobj.styleProps["background-color"];
-
- }
- timeline.add(tweens.content.fromTo(animobject[ri[si]],$from.speed/1000,$fanim,$tanim,$elemdelay*si),label);
- }
- } else {
- if (_.frames[frame_index].color!==undefined) {
- $from.anim.color = _.frames[frame_index].color;
- $to.anim.color = _.cssobj.styleProps.color;
- }
- if (_.frames[frame_index].bgcolor!==undefined) {
- $from.anim.backgroundColor = _.frames[frame_index].bgcolor;
- $to.anim.backgroundColor = _.cssobj.styleProps["background-color"];
-
- }
- timeline.add(tweens.content.staggerFromTo(animobject,$from.speed/1000,$from.anim,$to.anim,$elemdelay),label);
- }
-
-
- }
- } else {
- if (_._sfx_out==="block" && frame_index===_.outframeindex) {
- timeline.add(tweens.content.staggerTo(animobject,0.001,{autoAlpha:0,delay:$sfx_blockdelay}),label);
- timeline.add(tweens.content.staggerTo(animobject,((($to.speed/1000)/2)-0.001),{x:0,delay:$sfx_blockdelay}),label+"+=0.001");
- } else
- if ($splitnow && ri!==undefined) {
- var cycles = {to:getCycles($to.anim)};
- for (var si in animobject) {
- var $tanim = jQuery.extend({},$to.anim);
- for (var k in cycles.to) {
- $tanim[k] = parseInt(cycles.to[k].values[cycles.to[k].index],0);
- cycles.to[k].index = cycles.to[k].index < cycles.to[k].len ? cycles.to[k].index+1 : 0;
- }
- if (_.frames[frame_index].color!==undefined)
- $tanim.color = _.frames[frame_index].color;
-
- if (_.frames[frame_index].bgcolor!==undefined)
- $tanim.backgroundColor = _.frames[frame_index].bgcolor;
-
- timeline.add(tweens.content.to(animobject[ri[si]],$to.speed/1000,$tanim,$elemdelay*si),label);
- }
- } else {
- if (_.frames[frame_index].color!==undefined)
- $to.anim.color = _.frames[frame_index].color;
-
- if (_.frames[frame_index].bgcolor!==undefined)
- $to.anim.backgroundColor = _.frames[frame_index].bgcolor;
-
- timeline.add(tweens.content.staggerTo(animobject,$to.speed/1000,$to.anim,$elemdelay),label);
- }
- }
-
- if ($mask_to!==undefined && $mask_to!==false && (frame_index!==0 || !obj.ignorefirstframe)) {
- $mask_to.anim.ease = $mask_to.anim.ease === undefined || $mask_to.anim.ease==="inherit" ? _.frames[0].ease : $mask_to.anim.ease;
- $mask_to.anim.overflow = "hidden";
- $mask_to.anim.x = $mask_to.anim.x * opt.bw || getBorderDirections($mask_to.anim.x,opt,_.eow,_.eoh,_.calcy,_.calcx,"horizontal");
- $mask_to.anim.y = $mask_to.anim.y * opt.bw || getBorderDirections($mask_to.anim.y,opt,_.eow,_.eoh,_.calcy,_.calcx,"vertical");
- }
-
- if ((frame_index===0 && $mask_from && $mask_from!==false && !obj.fromcurrentstate) || (frame_index===0 && obj.ignorefirstframe)) {
- $mask_to = new Object();
- $mask_to.anim = new Object();
- $mask_to.anim.overwrite = "auto";
- $mask_to.anim.ease = $to.anim.ease;
- $mask_to.anim.x = $mask_to.anim.y = 0;
- if ($mask_from && $mask_from!==false) {
- $mask_from.anim.x = $mask_from.anim.x * opt.bw || getBorderDirections($mask_from.anim.x,opt,_.eow,_.eoh,_.calcy,_.calcx,"horizontal");
- $mask_from.anim.y = $mask_from.anim.y * opt.bw || getBorderDirections($mask_from.anim.y,opt,_.eow,_.eoh,_.calcy,_.calcx,"vertical");
- $mask_from.anim.overflow ="hidden";
- }
- } else
- if (frame_index===0)
- timeline.add(tweens.mask.set(_._mw,{overflow:"visible"}),label);
-
- if ($mask_from!==undefined && $mask_to!==undefined && $mask_from!==false && $mask_to!==false)
- timeline.add(tweens.mask.fromTo(_._mw,$from.speed/1000,$mask_from.anim,$mask_to.anim,$elemdelay),label);
- else
- if ($mask_to!==undefined && $mask_to!==false)
- timeline.add(tweens.mask.to(_._mw,$to.speed/1000,$mask_to.anim,$elemdelay),label);
-
- timeline.addLabel(label+"_end");
-
- // Reset Hover Effect when Last Frame (Out Animation) ordered
- if (_._gsTransformTo && frame_index===verylastframe && _.hoveredstatus)
- _.hovertimelines.item = punchgs.TweenLite.to(_nc,0,_._gsTransformTo);
-
- _._gsTransformTo = false;
-
-
-
- // ON START
- tweens.content.eventCallback("onStart",tweenOnStart,[frame_index,_nc_tl_obj,_._pw,_,timeline,$to.anim,_nc,obj.updateStaticTimeline,opt]);
-
-
- // ON UPDATE
- tweens.content.eventCallback("onUpdate",tweenOnUpdate,[label,_._id,_._pw,_,timeline,frame_index,jQuery.extend(true,{},$to.anim),obj.updateStaticTimeline,_nc,opt]);
-
-
- // ON COMPLETE
- tweens.content.eventCallback("onComplete",tweenOnComplete,[frame_index,_.frames.length,verylastframe,_._pw,_,timeline,obj.updateStaticTimeline,_nc,opt]);
-
- return timeline;
- },
-
- //////////////////////////////
- // MOVE OUT THE CAPTIONS //
- ////////////////////////////
- endMoveCaption : function(obj) {
- obj.firstframe="frame_0";
- obj.lastframe="frame_999";
- var nc = getTLInfos(obj),
- _ = obj.caption.data();
-
- if (obj.frame!==undefined)
- nc.timeline.play(obj.frame);
- else
- if (!nc.static || (obj.currentslide>=nc.removeonslide) || (obj.currentslide<nc.showonslide)) {
- nc.outnow = new punchgs.TimelineLite;
- nc.timeline.pause();
- if (_.visibleelement===true)
- _R.createFrameOnTimeline({caption:obj.caption, timeline : nc.outnow, label:"outnow", frameindex : obj.caption.data("outframeindex"), opt:obj.opt, fromcurrentstate:true}).play();
- }
- if (obj.checkchildrens)
- if (nc.timeline_obj && nc.timeline_obj.dchildren && nc.timeline_obj.dchildren!=="none" && nc.timeline_obj.dchildren.length>0)
- for (var q = 0; q<nc.timeline_obj.dchildren.length;q++) {
- _R.endMoveCaption({caption:jQuery(nc.timeline_obj.dchildren[q]), opt:obj.opt});
- }
- },
- //////////////////////////////////
- // MOVE CAPTIONS TO xx FRAME //
- /////////////////////////////////
- playAnimationFrame : function(obj) {
- obj.firstframe = obj.triggerframein;
- obj.lastframe = obj.triggerframeout;
- var nc = getTLInfos(obj),
- _ = obj.caption.data(),
- frameindex,
- i=0;
-
- for (var k in _.frames) {
- if (_.frames[k].framename === obj.frame) frameindex = i;
- i++;
- }
-
-
- if (_.triggeredtimeline!==undefined) _.triggeredtimeline.pause();
- _.triggeredtimeline = new punchgs.TimelineLite;
- nc.timeline.pause();
- var fcs = _.visibleelement===true ? true : false;
-
- _.triggeredtimeline = _R.createFrameOnTimeline({caption:obj.caption, timeline : _.triggeredtimeline, label:"triggered", frameindex : frameindex, updateStaticTimeline:true, opt:obj.opt, ignorefirstframe:true, fromcurrentstate:fcs}).play();
-
-
-
- //nc.timeline.play(obj.frame);
-
- },
- //////////////////////////
- // REMOVE THE CAPTIONS //
- /////////////////////////
- removeTheCaptions : function(actli,opt) {
- if (_R.compare_version(extension).check==="stop") return false;
- var removetime = 0,
- index = actli.data('index'),
- allcaptions = new Array;
-
- // COLLECT ALL CAPTIONS
- if (opt.layers[index])
- jQuery.each(opt.layers[index], function(i,a) { allcaptions.push(a); });
-
- /*if (opt.layers["static"])
- jQuery.each(opt.layers["static"], function(i,a) { allcaptions.push(a); });*/
-
- var slideindex = _R.currentSlideIndex(opt);
- // GO THROUGH ALL CAPTIONS, AND MANAGE THEM
- if (allcaptions)
- jQuery.each(allcaptions,function(i) {
- var _nc=jQuery(this);
- if (opt.sliderType==="carousel" && opt.carousel.showLayersAllTime==="on") {
- clearTimeout(_nc.data('videoplaywait'));
- if (_R.stopVideo) _R.stopVideo(_nc,opt);
- if (_R.removeMediaFromList) _R.removeMediaFromList(_nc,opt);
- opt.lastplayedvideos = [];
- } else {
- killCaptionLoops(_nc);
- clearTimeout(_nc.data('videoplaywait'));
- _R.endMoveCaption({caption:_nc,opt:opt, currentslide:slideindex});
- if (_R.removeMediaFromList) _R.removeMediaFromList(_nc,opt);
- opt.lastplayedvideos = [];
- }
-
- });
- }
- });
- /**********************************************************************************************
- - HELPER FUNCTIONS FOR LAYER TRANSFORMS -
- **********************************************************************************************/
- var tweenOnStart = function(frame_index,ncobj,pw,_,tl,toanim,_nc,ust,opt){
-
- var data={};
- data.layer = _nc;
- data.eventtype = frame_index===0 ? "enterstage" : frame_index===_.outframeindex ? "leavestage" : "framestarted";
- data.layertype = _nc.data('layertype');
- _.active = true;
- //_nc.data('active',true);
-
- //_.idleanimadded = false;
- data.frame_index = frame_index;
- data.layersettings = _nc.data();
- opt.c.trigger("revolution.layeraction",[data]);
- if (_.loopanimation=="on") callCaptionLoops(_._lw,opt.bw);
- if (data.eventtype==="enterstage") {
- _.animdirection="in";
- _.visibleelement=true;
- _R.toggleState(_.layertoggledby);
- }
- if (ncobj.dchildren!=="none" && ncobj.dchildren!==undefined && ncobj.dchildren.length>0) {
- if (frame_index===0)
- for (var q=0;q<ncobj.dchildren.length;q++) {
- jQuery(ncobj.dchildren[q]).data('timeline').play(0);
- }
- else
- if (frame_index===_.outframeindex)
- for (var q=0;q<ncobj.dchildren.length;q++) {
- _R.endMoveCaption({caption:jQuery(ncobj.dchildren[q]), opt:opt, checkchildrens:true});
- }
- }
- punchgs.TweenLite.set(pw,{visibility:"visible"});
- _.current_frame = frame_index;
- _.current_timeline = tl;
- _.current_timeline_time = tl.time();
- if (ust) _.static_layer_timeline_time = _.current_timeline_time;
- _.last_frame_started = frame_index;
-
-
- }
- var tweenOnUpdate = function(label,id,pw,_,tl,frame_index,toanim,ust,_nc,opt) {
- if (_._nctype==="column") setColumnBgDimension(_nc,opt);
- punchgs.TweenLite.set(pw,{visibility:"visible"});
- _.current_frame = frame_index;
- _.current_timeline = tl;
- _.current_timeline_time = tl.time();
- if (ust) _.static_layer_timeline_time = _.current_timeline_time;
-
- if (_.hoveranim !== undefined && _._gsTransformTo===false) {
- _._gsTransformTo = toanim;
- if (_._gsTransformTo && _._gsTransformTo.startAt) delete _._gsTransformTo.startAt;
-
- if (_.cssobj.styleProps.css===undefined)
- _._gsTransformTo = jQuery.extend(true,{},_.cssobj.styleProps,_._gsTransformTo);
- else
- _._gsTransformTo = jQuery.extend(true,{},_.cssobj.styleProps.css,_._gsTransformTo);
- }
-
- _.visibleelement=true;
-
- }
- var tweenOnComplete = function(frame_index,frame_max,verylastframe,pw,_,tl,ust,_nc,opt) {
- var data={};
- data.layer = _nc;
-
- data.eventtype = frame_index===0 ? "enteredstage" : frame_index===frame_max-1 || frame_index===verylastframe ? "leftstage" : "frameended";
- data.layertype = _nc.data('layertype');
- data.layersettings = _nc.data();
- opt.c.trigger("revolution.layeraction",[data]);
- if (data.eventtype!=="leftstage") _R.animcompleted(_nc,opt);
- if (data.eventtype==="leftstage")
- if (_R.stopVideo) _R.stopVideo(_nc,opt);
-
- if (_._nctype==="column") {
- punchgs.TweenLite.to(_._cbgc_man,0.01,{visibility:"hidden"});
- punchgs.TweenLite.to(_._cbgc_auto,0.01,{visibility:"visible"});
- }
- if (data.eventtype === "leftstage") {
- _.active = false;
- punchgs.TweenLite.set(pw,{visibility:"hidden",overwrite:"auto"});
- _.animdirection="out";
- _.visibleelement=false;
- _R.unToggleState(_.layertoggledby);
- }
- _.current_frame = frame_index;
- _.current_timeline = tl;
- _.current_timeline_time = tl.time();
- if (ust) _.static_layer_timeline_time = _.current_timeline_time;
-
-
- }
- //////////////////////////////////////////////
- // - GET TIMELINE INFOS FROM CAPTION - //
- /////////////////////////////////////////////
- var getTLInfos = function(obj) {
- var _ = {};
- obj.firstframe=obj.firstframe===undefined ? "frame_0" : obj.firstframe;
- obj.lastframe=obj.lastframe===undefined ? "frame_999" : obj.lastframe;
- _.id = obj.caption.data('id') || obj.caption.attr('id');
- _.slideid = obj.caption.data('slideid') || obj.caption.closest('.tp-revslider-slidesli').data('index');
- _.timeline_obj = obj.opt.timelines[_.slideid]["layers"][_.id];
- _.timeline = _.timeline_obj.timeline;
- _.ffs = _.timeline.getLabelTime(obj.firstframe);
- _.ffe = _.timeline.getLabelTime(obj.firstframe+"_end");
- _.lfs = _.timeline.getLabelTime(obj.lastframe);
- _.lfe = _.timeline.getLabelTime(obj.lastframe+"_end");
- _.ct = _.timeline.time();
- _.static = _.timeline_obj.firstslide!=undefined || _.timeline_obj.lastslide!=undefined;
- if (_.static) {
- _.showonslide = _.timeline_obj.firstslide;
- _.removeonslide = _.timeline_obj.lastslide;
- }
- return _;
- }
- //////////////////////////////////////////////
- // - GET SPLITTEXT DIRECTION ARRAY - //
- /////////////////////////////////////////////
- var shuffleArray = function(array) {
- var currentIndex = array.length, temporaryValue, randomIndex;
- // While there remain elements to shuffle...
- while (0 !== currentIndex) {
- // Pick a remaining element...
- randomIndex = Math.floor(Math.random() * currentIndex);
- currentIndex -= 1;
- // And swap it with the current element.
- temporaryValue = array[currentIndex];
- array[currentIndex] = array[randomIndex];
- array[randomIndex] = temporaryValue;
- }
- return array;
- }
- var getSplitTextDirs = function(alen,d) {
- var ri = new Array();
- switch (d) {
- case "forward":
- case "random":
- for (var si=0;si<=alen;si++) { ri.push(si);}
- if (d==="random") ri = shuffleArray(ri);
- break;
- case "backward":
- for (var si=0;si<=alen;si++) { ri.push(alen-si); }
- break;
- case "middletoedge":
- var cc = Math.ceil(alen/2),
- mm = cc-1,
- pp = cc+1;
- ri.push(cc);
- for (var si=0;si<cc;si++) {
- if (mm>=0) ri.push(mm);
- if (pp<=alen) ri.push(pp);
- mm--;
- pp++;
- }
- break;
- case "edgetomiddle":
- var mm = alen,
- pp = 0;
- for (var si=0;si<=Math.floor(alen/2);si++) {
- ri.push(mm);
- if (pp<mm) ri.push(pp);
- mm--;
- pp++;
- }
- break;
- }
-
- return ri;
- }
- //////////////////////////////////////////////
- // - GET SPLITTEXT CYCLES ANIMATION - //
- /////////////////////////////////////////////
- var getCycles = function(anim) {
- var _ = {};
- for (var a in anim) {
- if (typeof anim[a] === "string" && anim[a].indexOf("|")>=0) {
- if (_[a]===undefined) _[a] = {index:0};
- _[a].values = ((anim[a].replace("[","")).replace("]","")).split("|");
- _[a].len = _[a].values.length-1;
- }
- }
- return _;
- }
- /////////////////////////////////////
- // - CREATE ANIMATION OBJECT - //
- /////////////////////////////////////
- var newAnimObject = function(a) {
- a = a===undefined ? new Object() : a;
- a.anim = a.anim===undefined ? new Object() : a.anim;
- a.anim.x = a.anim.x===undefined ? 0 : a.anim.x;
- a.anim.y = a.anim.y===undefined ? 0 : a.anim.y;
- a.anim.z = a.anim.z===undefined ? 0 : a.anim.z;
- a.anim.rotationX = a.anim.rotationX===undefined ? 0 : a.anim.rotationX;
- a.anim.rotationY = a.anim.rotationY===undefined ? 0 : a.anim.rotationY;
- a.anim.rotationZ = a.anim.rotationZ===undefined ? 0 : a.anim.rotationZ;
- a.anim.scaleX = a.anim.scaleX===undefined ? 1 : a.anim.scaleX;
- a.anim.scaleY = a.anim.scaleY===undefined ? 1 : a.anim.scaleY;
- a.anim.skewX = a.anim.skewX===undefined ? 0 : a.anim.skewX;
- a.anim.skewY = a.anim.skewY===undefined ? 0 : a.anim.skewY;
- a.anim.opacity = a.anim.opacity===undefined ? 1 : a.anim.opacity;
- a.anim.transformOrigin = a.anim.transformOrigin===undefined ? "50% 50%" : a.anim.transformOrigin;
- a.anim.transformPerspective = a.anim.transformPerspective===undefined ? 600 : a.anim.transformPerspective;
- a.anim.rotation = a.anim.rotation===undefined ? 0 : a.anim.rotation;
- //a.anim.ease = a.anim.ease===undefined ? punchgs.Power3.easeOut : a.anim.ease;
- a.anim.force3D = a.anim.force3D===undefined ? "auto" : a.anim.force3D;
- a.anim.autoAlpha = a.anim.autoAlpha===undefined ? 1 : a.anim.autoAlpha;
- a.anim.visibility = a.anim.visibility===undefined ? "visible" : a.anim.visibility;
- a.anim.overwrite = a.anim.overwrite===undefined ? "auto" : a.anim.overwrite;
- a.speed = a.speed===undefined ? 0.3 : a.speed;
- a.filter = a.filter===undefined ? "blur(0px) grayscale(0%) brightness(100%)" : a.filter;
- a["-webkit-filter"] = a["-webkit-filter"]===undefined ? "blur(0px) grayscale(0%) brightness(100%)" : a["-webkit-filter"];
- return a;
- }
- var newSVGHoverAnimObject = function() {
- var a = new Object();
- a.anim = new Object();
-
- a.anim.stroke="none";
- a.anim.strokeWidth=0;
- a.anim.strokeDasharray="none";
- a.anim.strokeDashoffset="0";
- return a;
- }
- var setSVGAnimObject = function(data,a) {
- var customarray = data.split(';');
- if (customarray)
- jQuery.each(customarray,function(index,pa) {
- var p = pa.split(":")
- var w = p[0],
- v = p[1];
-
- if (w=="sc") a.anim.stroke=v;
- if (w=="sw") a.anim.strokeWidth=v;
- if (w=="sda") a.anim.strokeDasharray=v;
- if (w=="sdo") a.anim.strokeDashoffset=v;
- });
-
- return a;
- }
- var newEndAnimObject = function() {
- var a = new Object();
- a.anim = new Object();
- a.anim.x=0;
- a.anim.y=0;
- a.anim.z=0;
- return a;
- }
- var newHoverAnimObject = function() {
- var a = new Object();
- a.anim = new Object();
- a.speed = 0.2;
- return a;
- }
- var animDataTranslator = function(val,defval,$split,$splitamount,ext) {
- ext = ext===undefined ? "" : ext;
- if (jQuery.isNumeric(parseFloat(val))) {
- return parseFloat(val)+ext;
- } else
- if (val===undefined || val==="inherit") {
- return defval+"ext";
- } else
- if (val.split("{").length>1) {
- var min = val.split(","),
- max = parseFloat(min[1].split("}")[0]);
- min = parseFloat(min[0].split("{")[1]);
-
- if ($split!==undefined && $splitamount!==undefined) {
- val=="["+(parseInt(Math.random()*(max-min),0) + parseInt(min,0))+"ext";
- for (var i=0;i<$splitamount;i++) {
- val = val+"|"+(parseInt(Math.random()*(max-min),0) + parseInt(min,0))+ext;
- }
- val = val+"]";
- } else {
- val = Math.random()*(max-min) + min;
- }
- }
-
- return val;
- }
- var getBorderDirections = function (x,o,w,h,top,left,direction) {
-
- if (!jQuery.isNumeric(x) && x.match(/%]/g)) {
- x = x.split("[")[1].split("]")[0];
- if (direction=="horizontal")
- x = (w+2)*parseInt(x,0)/100;
- else
- if (direction=="vertical")
- x = (h+2)*parseInt(x,0)/100;
- } else {
-
- x = x === "layer_left" ? (0-w) : x === "layer_right" ? w : x;
- x = x === "layer_top" ? (0-h) : x==="layer_bottom" ? h : x;
- x = x === "left" || x==="stage_left" ? (0-w-left) : x === "right" || x==="stage_right" ? o.conw-left : x === "center" || x === "stage_center" ? (o.conw/2 - w/2)-left : x;
- x = x === "top" || x==="stage_top" ? (0-h-top) : x==="bottom" || x==="stage_bottom" ? o.conh-top : x === "middle" || x === "stage_middle" ? (o.conh/2 - h/2)-top : x;
- }
-
- return x;
- }
- ///////////////////////////////////////////////////
- // ANALYSE AND READ OUT DATAS FROM HTML CAPTIONS //
- ///////////////////////////////////////////////////
- var getAnimDatas = function(frm,data,reversed,$split,$splitamount) {
-
- var o = new Object();
- o = jQuery.extend(true,{},o, frm);
- if (data === undefined)
- return o;
-
- var customarray = data.split(';'),
- tmpf="";
-
-
- if (customarray)
- jQuery.each(customarray,function(index,pa) {
- var p = pa.split(":")
- var w = p[0],
- v = p[1];
-
-
- if (reversed && reversed!=="none" && v!=undefined && v.length>0 && v.match(/\(R\)/)) {
- v = v.replace("(R)","");
- v = v==="right" ? "left" : v==="left" ? "right" : v==="top" ? "bottom" : v==="bottom" ? "top" : v;
- if (v[0]==="[" && v[1]==="-") v = v.replace("[-","[");
- else
- if (v[0]==="[" && v[1]!=="-") v = v.replace("[","[-");
- else
- if (v[0]==="-") v = v.replace("-","");
- else
- if (v[0].match(/[1-9]/)) v="-"+v;
- }
- if (v!=undefined) {
- v = v.replace(/\(R\)/,'');
-
- if (w=="rotationX" || w=="rX") o.anim.rotationX = animDataTranslator(v,o.anim.rotationX,$split,$splitamount,"deg");
- if (w=="rotationY" || w=="rY") o.anim.rotationY = animDataTranslator(v,o.anim.rotationY,$split,$splitamount,"deg");
- if (w=="rotationZ" || w=="rZ") o.anim.rotation = animDataTranslator(v,o.anim.rotationZ,$split,$splitamount,"deg");
- if (w=="scaleX" || w=="sX") o.anim.scaleX = animDataTranslator(v,o.anim.scaleX,$split,$splitamount);
- if (w=="scaleY" || w=="sY") o.anim.scaleY = animDataTranslator(v,o.anim.scaleY,$split,$splitamount);
- if (w=="opacity" || w=="o") o.anim.opacity = animDataTranslator(v,o.anim.opacity,$split,$splitamount);
- //if (w=="letterspacing" || w=="ls") o.anim.letterSpacing = animDataTranslator(v,o.anim.letterSpacing);
- if (w=="fb") tmpf = tmpf==="" ? 'blur('+parseInt(v,0)+'px)' : tmpf+" "+'blur('+parseInt(v,0)+'px)';
- if (w=="fg") tmpf = tmpf==="" ? 'grayscale('+parseInt(v,0)+'%)' : tmpf+" "+'grayscale('+parseInt(v,0)+'%)';
- if (w=="fbr") tmpf = tmpf==="" ? 'brightness('+parseInt(v,0)+'%)' : tmpf+" "+'brightness('+parseInt(v,0)+'%)';
-
- if (o.anim.opacity===0) o.anim.autoAlpha = 0;
- o.anim.opacity = o.anim.opacity == 0 ? 0.0001 : o.anim.opacity;
- if (w=="skewX" || w=="skX") o.anim.skewX = animDataTranslator(v,o.anim.skewX,$split,$splitamount);
- if (w=="skewY" || w=="skY") o.anim.skewY = animDataTranslator(v,o.anim.skewY,$split,$splitamount);
- if (w=="x") o.anim.x = animDataTranslator(v,o.anim.x,$split,$splitamount);
- if (w=="y") o.anim.y = animDataTranslator(v,o.anim.y,$split,$splitamount);
- if (w=="z") o.anim.z = animDataTranslator(v,o.anim.z,$split,$splitamount);
- if (w=="transformOrigin" || w=="tO") o.anim.transformOrigin = v.toString();
- if (w=="transformPerspective" || w=="tP") o.anim.transformPerspective=parseInt(v,0);
- if (w=="speed" || w=="s") o.speed = parseFloat(v);
-
- //if (w=="ease" || w=="e") o.anim.ease = v;
- }
- })
- if (tmpf!=="") {
- o.anim['-webkit-filter'] = tmpf;
- o.anim['filter'] = tmpf;
- }
-
- return o;
- }
- /////////////////////////////////
- // BUILD MASK ANIMATION OBJECT //
- /////////////////////////////////
- var getMaskDatas = function(d) {
- if (d === undefined)
- return false;
- var o = new Object();
- o.anim = new Object();
- var s = d.split(';')
- if (s)
- jQuery.each(s,function(index,param) {
- param = param.split(":")
- var w = param[0],
- v = param[1];
- if (w=="x") o.anim.x = v;
- if (w=="y") o.anim.y = v;
- if (w=="s") o.speed = parseFloat(v);
- if (w=="e" || w=="ease") o.anim.ease = v;
- });
- return o;
- }
-
- ////////////////////////
- // SHOW THE CAPTION //
- ///////////////////////
- var makeArray = function(obj,opt,show) {
-
- if (obj==undefined) obj = 0;
- if (!jQuery.isArray(obj) && jQuery.type(obj)==="string" && (obj.split(",").length>1 || obj.split("[").length>1)) {
- obj = obj.replace("[","");
- obj = obj.replace("]","");
- var newobj = obj.match(/'/g) ? obj.split("',") : obj.split(",");
- obj = new Array();
- if (newobj)
- jQuery.each(newobj,function(index,element) {
- element = element.replace("'","");
- element = element.replace("'","");
- obj.push(element);
- })
- } else {
- var tempw = obj;
- if (!jQuery.isArray(obj) ) {
- obj = new Array();
- obj.push(tempw);
- }
- }
- var tempw = obj[obj.length-1];
- if (obj.length<opt.rle) {
- for (var i=1;i<=opt.curWinRange;i++) {
- obj.push(tempw);
- }
- }
- return obj;
- }
- /* CREATE SHARP CORNERS */
- function sharpCorners(nc,$class, $side,$borderh,$borderv,ncch,bgcol) {
- var a = nc.find($class);
- a.css('borderWidth',ncch+"px");
- a.css($side,(0-ncch)+'px');
- a.css($borderh,'0px solid transparent');
- a.css($borderv,bgcol);
- }
- var convertHoverStyle = function(t,s) {
- if (s===undefined) return t;
- s = s.replace("c:","color:");
- s = s.replace("bg:","background-color:");
- s = s.replace("bw:","border-width:");
- s = s.replace("bc:","border-color:");
- s = s.replace("br:","borderRadius:");
- s = s.replace("bs:","border-style:");
- s = s.replace("td:","text-decoration:");
- s = s.replace("zi:","zIndex:");
- var sp = s.split(";");
- if (sp)
- jQuery.each(sp,function(key,cont){
- var attr = cont.split(":");
- if (attr[0].length>0) {
- if (attr[0]==="background-color" && attr[1].indexOf("gradient")>=0) attr[0]="background";
- t.anim[attr[0]] = attr[1];
- }
- })
- return t;
- }
- ////////////////////////////////////////////////
- // - GET CSS ATTRIBUTES OF ELEMENT - //
- ////////////////////////////////////////////////
- var getcssParams = function(nc,level) {
-
- var obj = new Object(),
- gp = false,
- pc;
-
-
- // CHECK IF CURRENT ELEMENT SHOULD RESPECT REKURSICVE RESIZES, AND SHOULD OWN THE SAME ATTRIBUTES FROM PARRENT ELEMENT
- if (level=="rekursive") {
- pc = nc.closest('.tp-caption');
- if (pc && (
- (nc.css("fontSize") === pc.css("fontSize")) &&
- (nc.css("fontWeight") === pc.css("fontWeight")) &&
- (nc.css("lineHeight") === pc.css("lineHeight"))
- ))
- gp = true;
- }
-
- obj.basealign = nc.data('basealign') || "grid";
- obj.fontSize = gp ? pc.data('fontsize')===undefined ? parseInt(pc.css('fontSize'),0) || 0 : pc.data('fontsize') : nc.data('fontsize')===undefined ? parseInt(nc.css('fontSize'),0) || 0 : nc.data('fontsize');
- obj.fontWeight = gp ? pc.data('fontweight')===undefined ? parseInt(pc.css('fontWeight'),0) || 0 : pc.data('fontweight') : nc.data('fontweight')===undefined ? parseInt(nc.css('fontWeight'),0) || 0 : nc.data('fontweight');
-
- obj.whiteSpace = gp ? pc.data('whitespace')===undefined ? pc.css('whitespace') || "normal" : pc.data('whitespace') : nc.data('whitespace')===undefined ? nc.css('whitespace') || "normal" : nc.data('whitespace');
- obj.textAlign = gp ? pc.data('textalign')===undefined ? pc.css('textalign') || "inherit" : pc.data('textalign') : nc.data('textalign')===undefined ? nc.css('textalign') || "inherit" : nc.data('textalign');
- obj.zIndex = gp ? pc.data('zIndex')===undefined ? pc.css('zIndex') || "inherit" : pc.data('zIndex') : nc.data('zIndex')===undefined ? nc.css('zIndex') || "inherit" : nc.data('zIndex');
-
- if (jQuery.inArray(nc.data('layertype'),["video","image","audio"])===-1 && !nc.is("img"))
- obj.lineHeight = gp ? pc.data('lineheight')===undefined ? parseInt(pc.css('lineHeight'),0) || 0 : pc.data('lineheight') : nc.data('lineheight')===undefined ? parseInt(nc.css('lineHeight'),0) || 0 : nc.data('lineheight');
- else
- obj.lineHeight = 0;
-
- obj.letterSpacing = gp ? pc.data('letterspacing')===undefined ? parseFloat(pc.css('letterSpacing'),0) || 0 : pc.data('letterspacing') : nc.data('letterspacing')===undefined ? parseFloat(nc.css('letterSpacing')) || 0 : nc.data('letterspacing');
-
- obj.paddingTop = nc.data('paddingtop')===undefined ? parseInt(nc.css('paddingTop'),0) || 0 : nc.data('paddingtop');
- obj.paddingBottom = nc.data('paddingbottom')===undefined ? parseInt(nc.css('paddingBottom'),0) || 0 : nc.data('paddingbottom');
- obj.paddingLeft = nc.data('paddingleft')===undefined ? parseInt(nc.css('paddingLeft'),0) || 0 : nc.data('paddingleft');
- obj.paddingRight = nc.data('paddingright')===undefined ? parseInt(nc.css('paddingRight'),0) || 0 : nc.data('paddingright');
- obj.marginTop = nc.data('margintop')===undefined ? parseInt(nc.css('marginTop'),0) || 0 : nc.data('margintop');
- obj.marginBottom = nc.data('marginbottom')===undefined ? parseInt(nc.css('marginBottom'),0) || 0 : nc.data('marginbottom');
- obj.marginLeft = nc.data('marginleft')===undefined ? parseInt(nc.css('marginLeft'),0) || 0 : nc.data('marginleft');
- obj.marginRight = nc.data('marginright')===undefined ? parseInt(nc.css('marginRight'),0) || 0 : nc.data('marginright');
- obj.borderTopWidth = nc.data('bordertopwidth')===undefined ? parseInt(nc.css('borderTopWidth'),0) || 0 : nc.data('bordertopwidth');
- obj.borderBottomWidth = nc.data('borderbottomwidth')===undefined ? parseInt(nc.css('borderBottomWidth'),0) || 0 : nc.data('borderbottomwidth');
- obj.borderLeftWidth = nc.data('borderleftwidth')===undefined ? parseInt(nc.css('borderLeftWidth'),0) || 0 : nc.data('borderleftwidth');
- obj.borderRightWidth = nc.data('borderrightwidth')===undefined ? parseInt(nc.css('borderRightWidth'),0) || 0 : nc.data('borderrightwidth');
- if (level!="rekursive") {
- obj.color = nc.data('color')===undefined ? "nopredefinedcolor" : nc.data('color');
- obj.whiteSpace = gp ? pc.data('whitespace')===undefined ? pc.css('whiteSpace') || "nowrap" : pc.data('whitespace') : nc.data('whitespace')===undefined ? nc.css('whiteSpace') || "nowrap" : nc.data('whitespace');
- obj.textAlign = gp ? pc.data('textalign')===undefined ? pc.css('textalign') || "inherit" : pc.data('textalign') : nc.data('textalign')===undefined ? nc.css('textalign') || "inherit" : nc.data('textalign');
- obj.fontWeight = gp ? pc.data('fontweight')===undefined ? parseInt(pc.css('fontWeight'),0) || 0 : pc.data('fontweight') : nc.data('fontweight')===undefined ? parseInt(nc.css('fontWeight'),0) || 0 : nc.data('fontweight');
- obj.minWidth = nc.data('width')===undefined ? parseInt(nc.css('minWidth'),0) || 0 : nc.data('width');
- obj.minHeight = nc.data('height')===undefined ? parseInt(nc.css('minHeight'),0) || 0 : nc.data('height');
- if (nc.data('videowidth')!=undefined && nc.data('videoheight')!=undefined) {
- var vwid = nc.data('videowidth'),
- vhei = nc.data('videoheight');
- vwid = vwid==="100%" ? "none" : vwid;
- vhei = vhei==="100%" ? "none" : vhei;
-
- nc.data('width',vwid);
- nc.data('height',vhei);
- }
-
- obj.maxWidth = nc.data('width')===undefined ? parseInt(nc.css('maxWidth'),0) || "none" : nc.data('width');
- obj.maxHeight = jQuery.inArray(nc.data('type'),["column","row"])!==-1 ? "none" : nc.data('height')===undefined ? parseInt(nc.css('maxHeight'),0) || "none" : nc.data('height');
-
- obj.wan = nc.data('wan')===undefined ? parseInt(nc.css('-webkit-transition'),0) || "none" : nc.data('wan');
- obj.moan = nc.data('moan')===undefined ? parseInt(nc.css('-moz-animation-transition'),0) || "none" : nc.data('moan');
- obj.man = nc.data('man')===undefined ? parseInt(nc.css('-ms-animation-transition'),0) || "none" : nc.data('man');
- obj.ani = nc.data('ani')===undefined ? parseInt(nc.css('transition'),0) || "none" : nc.data('ani');
- }
-
-
- obj.styleProps = { borderTopLeftRadius : nc[0].style.borderTopLeftRadius,
- borderTopRightRadius : nc[0].style.borderTopRightRadius,
- borderBottomRightRadius : nc[0].style.borderBottomRightRadius,
- borderBottomLeftRadius : nc[0].style.borderBottomLeftRadius,
- "background" : nc[0].style["background"],
- "boxShadow" : nc[0].style["boxShadow"],
- "background-color" : nc[0].style["background-color"],
- "border-top-color" : nc[0].style["border-top-color"],
- "border-bottom-color" : nc[0].style["border-bottom-color"],
- "border-right-color" : nc[0].style["border-right-color"],
- "border-left-color" : nc[0].style["border-left-color"],
- "border-top-style" : nc[0].style["border-top-style"],
- "border-bottom-style" : nc[0].style["border-bottom-style"],
- "border-left-style" : nc[0].style["border-left-style"],
- "border-right-style" : nc[0].style["border-right-style"],
- "border-left-width" : nc[0].style["border-left-width"],
- "border-right-width" : nc[0].style["border-right-width"],
- "border-bottom-width" : nc[0].style["border-bottom-width"],
- "border-top-width" : nc[0].style["border-top-width"],
- "color" : nc[0].style["color"],
- "text-decoration" : nc[0].style["text-decoration"],
- "font-style" : nc[0].style["font-style"]
- };
-
- if (obj.styleProps.background==="" || obj.styleProps.background===undefined || obj.styleProps.background === obj.styleProps["background-color"])
- delete obj.styleProps.background;
- if (obj.styleProps.color=="")
- obj.styleProps.color = nc.css("color");
- return obj;
- }
- // READ SINGLE OR ARRAY VALUES OF OBJ CSS ELEMENTS
- var setResponsiveCSSValues = function(obj,opt) {
- var newobj = new Object();
- if (obj)
- jQuery.each(obj,function(key,val){
- var res_a = makeArray(val,opt)[opt.curWinRange];
- newobj[key] = res_a!==undefined ? res_a : obj[key];
- });
- return newobj;
- }
- var minmaxconvert = function(a,m,r,fr) {
-
- a = jQuery.isNumeric(a) ? (a * m)+"px" : a;
- a = a==="full" ? fr : a==="auto" || a==="none" ? r : a;
- return a;
- }
- /////////////////////////////////////////////////////////////////
- // - CALCULATE THE RESPONSIVE SIZES OF THE CAPTIONS - //
- /////////////////////////////////////////////////////////////////
- var calcCaptionResponsive = function(nc,opt,level,responsive) {
-
- var _=nc.data();
- _ = _===undefined ? {} : _;
- try{
- if (nc[0].nodeName=="BR" || nc[0].tagName=="br"
- /*|| nc[0].nodeName=="b" || nc[0].tagName=="b" ||
- nc[0].nodeName=="strong" || nc[0].tagName=="STRONG"*/
- )
- return false;
- } catch(e) {
- }
- _.cssobj = _.cssobj===undefined ? getcssParams(nc,level) : _.cssobj;
-
- var obj = setResponsiveCSSValues(_.cssobj,opt),
- bw=opt.bw,
- bh=opt.bh;
- if (responsive==="off") {
- bw=1;
- bh=1;
- }
-
- // IE8 FIX FOR AUTO LINEHEIGHT
- if (obj.lineHeight=="auto") obj.lineHeight = obj.fontSize+4;
- var objmargins = { Top: obj.marginTop,
- Bottom: obj.marginBottom,
- Left: obj.marginLeft,
- Right: obj.marginRight
- }
- if (_._nctype==="column") {
- punchgs.TweenLite.set(_._column,{
- paddingTop: Math.round((obj.marginTop * bh)) + "px",
- paddingBottom: Math.round((obj.marginBottom * bh)) + "px",
- paddingLeft: Math.round((obj.marginLeft* bw)) + "px",
- paddingRight: Math.round((obj.marginRight * bw)) + "px"});
- objmargins = { Top: 0,
- Bottom: 0,
- Left: 0,
- Right: 0
- }
-
- }
- if (!nc.hasClass("tp-splitted")) {
- nc.css("-webkit-transition", "none");
- nc.css("-moz-transition", "none");
- nc.css("-ms-transition", "none");
- nc.css("transition", "none");
-
- var hashover = nc.data('transform_hover')!==undefined || nc.data('style_hover')!==undefined;
- if (hashover) punchgs.TweenLite.set(nc,obj.styleProps);
-
- punchgs.TweenLite.set(nc,{
- fontSize: Math.round((obj.fontSize * bw))+"px",
- fontWeight: obj.fontWeight,
- letterSpacing:Math.floor((obj.letterSpacing * bw))+"px",
- paddingTop: Math.round((obj.paddingTop * bh)) + "px",
- paddingBottom: Math.round((obj.paddingBottom * bh)) + "px",
- paddingLeft: Math.round((obj.paddingLeft* bw)) + "px",
- paddingRight: Math.round((obj.paddingRight * bw)) + "px",
- marginTop: (objmargins.Top * bh) + "px",
- marginBottom: (objmargins.Bottom * bh) + "px",
- marginLeft: (objmargins.Left * bw) + "px",
- marginRight: (objmargins.Right * bw) + "px",
- borderTopWidth: Math.round(obj.borderTopWidth * bh) + "px",
- borderBottomWidth: Math.round(obj.borderBottomWidth * bh) + "px",
- borderLeftWidth: Math.round(obj.borderLeftWidth * bw) + "px",
- borderRightWidth: Math.round(obj.borderRightWidth * bw) + "px",
- lineHeight: Math.round(obj.lineHeight * bh) + "px",
- textAlign:(obj.textAlign),
- overwrite:"auto"});
- if (level!="rekursive") {
-
-
-
- var winw = obj.basealign =="slide" ? opt.ulw : opt.gridwidth[opt.curWinRange],
- winh = obj.basealign =="slide" ? opt.ulh : opt.gridheight[opt.curWinRange],
- maxw = minmaxconvert(obj.maxWidth,bw,"none",winw),
- maxh = minmaxconvert(obj.maxHeight,bh,"none",winh),
- minw = minmaxconvert(obj.minWidth,bw,"0px",winw),
- minh = minmaxconvert(obj.minHeight,bh,"0px",winh);
-
-
- // TWEEN FIX ISSUES
- minw=minw===undefined ? 0 : minw;
- minh=minh===undefined ? 0 : minh;
- maxw=maxw===undefined ? "none" : maxw;
- maxh=maxh===undefined ? "none" : maxh;
-
- if (_._isgroup) {
-
- if (minw==="#1/1#") minw = maxw = winw;
- if (minw==="#1/2#") minw = maxw = winw / 2;
- if (minw==="#1/3#") minw = maxw = winw/3;
- if (minw==="#1/4#") minw = maxw = winw / 4;
- if (minw==="#1/5#") minw = maxw = winw / 5;
- if (minw==="#1/6#") minw = maxw = winw / 6;
- if (minw==="#2/3#") minw = maxw = (winw / 3) * 2;
- if (minw==="#3/4#") minw = maxw = (winw / 4) * 3;
- if (minw==="#2/5#") minw = maxw = (winw / 5) * 2;
- if (minw==="#3/5#") minw = maxw = (winw / 5) * 3;
- if (minw==="#4/5#") minw = maxw = (winw / 5) * 4;
-
- if (minw==="#3/6#") minw = maxw = (winw / 6) * 3;
- if (minw==="#4/6#") minw = maxw = (winw / 6) * 4;
- if (minw==="#5/6#") minw = maxw = (winw / 6) * 5;
- }
- if (_._ingroup) {
- _._groupw = minw;
- _._grouph = minh;
- }
- punchgs.TweenLite.set(nc,{
- maxWidth:maxw,
- maxHeight:maxh,
- minWidth:minw,
- minHeight:minh,
- whiteSpace:obj.whiteSpace,
- textAlign:(obj.textAlign),
- overwrite:"auto"
- });
- if (obj.color!="nopredefinedcolor")
- punchgs.TweenLite.set(nc,{color:obj.color,overwrite:"auto"});
-
- if (_.svg_src!=undefined) {
- var scolto = obj.color!="nopredefinedcolor" && obj.color!=undefined ? obj.color : obj.css!=undefined && obj.css.color!="nopredefinedcolor" && obj.css.color!=undefined ? obj.css.color : obj.styleProps.color!=undefined ? obj.styleProps.color : obj.styleProps.css!=undefined && obj.styleProps.css.color!=undefined ? obj.styleProps.css.color : false;
- if (scolto!=false) {
- punchgs.TweenLite.set(nc.find('svg'),{fill:scolto,overwrite:"auto"});
- punchgs.TweenLite.set(nc.find('svg path'),{fill:scolto,overwrite:"auto"});
- }
- }
-
- }
- if (_._nctype==="column") {
- if (_._column_bg_set===undefined) {
- _._column_bg_set = nc.css('backgroundColor');
- _._column_bg_image = nc.css('backgroundImage');
- _._column_bg_image_repeat =nc.css('backgroundRepeat');
- _._column_bg_image_position =nc.css('backgroundPosition');
- _._column_bg_image_size =nc.css('backgroundSize');
- _._column_bg_opacity = nc.data('bgopacity');
- _._column_bg_opacity = _._column_bg_opacity===undefined ? 1 : _._column_bg_opacity;
-
-
- punchgs.TweenLite.set(nc,{
- backgroundColor:"transparent",
- backgroundImage:""
- });
- }
- setTimeout(function() {
- setColumnBgDimension(nc,opt);
- },1);
-
- // DYNAMIC HEIGHT AUTO CALCULATED BY BROWSER
- if (_._cbgc_auto && _._cbgc_auto.length>0) {
- _._cbgc_auto[0].style.backgroundSize = _._column_bg_image_size;
- if (jQuery.isArray(obj.marginLeft)) {
- punchgs.TweenLite.set(_._cbgc_auto,{
- borderTopWidth: (obj.marginTop[opt.curWinRange] * bh) + "px",
- borderLeftWidth: (obj.marginLeft[opt.curWinRange] * bw) + "px",
- borderRightWidth: (obj.marginRight[opt.curWinRange] * bw) + "px",
- borderBottomWidth:(obj.marginBottom[opt.curWinRange] * bh) + "px",
- backgroundColor:_._column_bg_set,
- backgroundImage:_._column_bg_image,
- backgroundRepeat:_._column_bg_image_repeat,
- backgroundPosition:_._column_bg_image_position,
- opacity:_._column_bg_opacity
-
- });
- } else {
- punchgs.TweenLite.set(_._cbgc_auto,{
- borderTopWidth: (obj.marginTop * bh) + "px",
- borderLeftWidth: (obj.marginLeft * bw) + "px",
- borderRightWidth: (obj.marginRight * bw) + "px",
- borderBottomWidth:(obj.marginBottom * bh) + "px",
- backgroundColor:_._column_bg_set,
- backgroundImage:_._column_bg_image,
- backgroundRepeat:_._column_bg_image_repeat,
- backgroundPosition:_._column_bg_image_position,
- opacity:_._column_bg_opacity
-
- });
- }
-
-
- }
- }
- setTimeout(function() {
- nc.css("-webkit-transition", nc.data('wan'));
- nc.css("-moz-transition", nc.data('moan'));
- nc.css("-ms-transition", nc.data('man'));
- nc.css("transition", nc.data('ani'));
- },30);
- }
- }
- var setColumnBgDimension = function(nc,opt) {
- // DYNAMIC HEIGHT BASED ON ROW HEIGHT
- var _ = nc.data();
- if (_._cbgc_man && _._cbgc_man.length>0) {
-
- var _l,_t,_b,_r,_h,_o;
- if (!jQuery.isArray(_.cssobj.marginLeft)) {
- _l = (_.cssobj.marginLeft * opt.bw);
- _t = (_.cssobj.marginTop * opt.bh);
- _b = (_.cssobj.marginBottom * opt.bh);
- _r = (_.cssobj.marginRight * opt.bw);
- } else {
- _l = (_.cssobj.marginLeft[opt.curWinRange] * opt.bw);
- _t = (_.cssobj.marginTop[opt.curWinRange] * opt.bh);
- _b = (_.cssobj.marginBottom[opt.curWinRange] * opt.bh);
- _r = (_.cssobj.marginRight[opt.curWinRange] * opt.bw);
- }
- _h = _._row.hasClass("rev_break_columns") ? "100%" : (_._row.height() - (_t+_b))+"px";
- _._cbgc_man[0].style.backgroundSize = _._column_bg_image_size;
-
- punchgs.TweenLite.set(_._cbgc_man,{
- width:"100%",
- height:_h,
- backgroundColor:_._column_bg_set,
- backgroundImage:_._column_bg_image,
- backgroundRepeat:_._column_bg_image_repeat,
- backgroundPosition:_._column_bg_image_position,
- overwrite:"auto",
- opacity:_._column_bg_opacity
- });
-
- }
- }
- //////////////////////
- // CAPTION LOOPS //
- //////////////////////
- var callCaptionLoops = function(el,factor) {
- var _ = el.data();
- // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS
- if (el.hasClass("rs-pendulum")) {
- if (_._loop_timeline==undefined) {
- _._loop_timeline = new punchgs.TimelineLite;
- var startdeg = el.data('startdeg')==undefined ? -20 : el.data('startdeg'),
- enddeg = el.data('enddeg')==undefined ? 20 : el.data('enddeg'),
- speed = el.data('speed')==undefined ? 2 : el.data('speed'),
- origin = el.data('origin')==undefined ? "50% 50%" : el.data('origin'),
- easing = el.data('easing')==undefined ? punchgs.Power2.easeInOut : el.data('easing');
-
- startdeg = startdeg * factor;
- enddeg = enddeg * factor;
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",rotation:startdeg,transformOrigin:origin},{rotation:enddeg,ease:easing}));
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",rotation:enddeg,transformOrigin:origin},{rotation:startdeg,ease:easing,onComplete:function() {
- _._loop_timeline.restart();
- }}));
- }
- }
- // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS
- if (el.hasClass("rs-rotate")) {
- if (_._loop_timeline==undefined) {
- _._loop_timeline = new punchgs.TimelineLite;
- var startdeg = el.data('startdeg')==undefined ? 0 : el.data('startdeg'),
- enddeg = el.data('enddeg')==undefined ? 360 : el.data('enddeg'),
- speed = el.data('speed')==undefined ? 2 : el.data('speed'),
- origin = el.data('origin')==undefined ? "50% 50%" : el.data('origin'),
- easing = el.data('easing')==undefined ? punchgs.Power2.easeInOut : el.data('easing');
- startdeg = startdeg * factor;
- enddeg = enddeg * factor;
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",rotation:startdeg,transformOrigin:origin},{rotation:enddeg,ease:easing,onComplete:function() {
- _._loop_timeline.restart();
- }}));
- }
- }
- // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS
- if (el.hasClass("rs-slideloop")) {
- if (_._loop_timeline==undefined) {
- _._loop_timeline = new punchgs.TimelineLite;
- var xs = el.data('xs')==undefined ? 0 : el.data('xs'),
- ys = el.data('ys')==undefined ? 0 : el.data('ys'),
- xe = el.data('xe')==undefined ? 0 : el.data('xe'),
- ye = el.data('ye')==undefined ? 0 : el.data('ye'),
- speed = el.data('speed')==undefined ? 2 : el.data('speed'),
- easing = el.data('easing')==undefined ? punchgs.Power2.easeInOut : el.data('easing');
- xs = xs * factor;
- ys = ys * factor;
- xe = xe * factor;
- ye = ye * factor;
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",x:xs,y:ys},{x:xe,y:ye,ease:easing}));
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",x:xe,y:ye},{x:xs,y:ys,onComplete:function() {
- _._loop_timeline.restart();
- }}));
- }
- }
- // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS
- if (el.hasClass("rs-pulse")) {
- if (_._loop_timeline==undefined) {
- _._loop_timeline = new punchgs.TimelineLite;
- var zoomstart = el.data('zoomstart')==undefined ? 0 : el.data('zoomstart'),
- zoomend = el.data('zoomend')==undefined ? 0 : el.data('zoomend'),
- speed = el.data('speed')==undefined ? 2 : el.data('speed'),
- easing = el.data('easing')==undefined ? punchgs.Power2.easeInOut : el.data('easing');
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",scale:zoomstart},{scale:zoomend,ease:easing}));
- _._loop_timeline.append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",scale:zoomend},{scale:zoomstart,onComplete:function() {
- _._loop_timeline.restart();
- }}));
- }
- }
- if (el.hasClass("rs-wave")) {
- if (_._loop_timeline==undefined) {
- _._loop_timeline = new punchgs.TimelineLite;
- var angle= el.data('angle')==undefined ? 10 : parseInt(el.data('angle'),0),
- radius = el.data('radius')==undefined ? 10 : parseInt(el.data('radius'),0),
- speed = el.data('speed')==undefined ? -20 : el.data('speed'),
- origin = el.data('origin')==undefined ? "50% 50%" : el.data('origin'),
- ors = origin.split(" "),
- oo = new Object();
- if (ors.length>=1) {
- oo.x = ors[0];
- oo.y = ors[1];
- } else {
- oo.x = "50%";
- oo.y = "50%";
- }
-
- radius = radius * factor;
- var _ox = ((parseInt(oo.x,0)/100)-0.5) * el.width(),
- _oy = ((parseInt(oo.y,0)/100)-0.5) * el.height(),
- yo = (-1*radius) + _oy,
- xo = 0 + _ox,
- angobj= {a:0, ang : angle, element:el, unit:radius, xoffset:xo, yoffset:yo},
- ang = parseInt(angle,0),
- waveanim = new punchgs.TweenLite.fromTo(angobj,speed,{ a:(0+ang) },{ a:(360+ang),force3D:"auto",ease:punchgs.Linear.easeNone});
-
- waveanim.eventCallback("onUpdate",function(angobj) {
- var rad = angobj.a * (Math.PI / 180),
- yy = angobj.yoffset+(angobj.unit * (1 - Math.sin(rad))),
- xx = angobj.xoffset+Math.cos(rad) * angobj.unit;
- punchgs.TweenLite.to(angobj.element,0.1,{force3D:"auto",x:xx, y:yy});
- },[angobj]);
-
- waveanim.eventCallback("onComplete",function(_) {
- _._loop_timeline.restart();
- },[_]);
- _._loop_timeline.append(waveanim);
- }
- }
- }
- var killCaptionLoops = function(nextcaption) {
- // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS
- nextcaption.closest('.rs-pendulum, .rs-slideloop, .rs-pulse, .rs-wave').each(function() {
- var _ = this;
- if (_._loop_timeline!=undefined) {
- _._loop_timeline.pause();
- _._loop_timeline = null;
- }
- });
- }
- })(jQuery);
|