{"version":3,"sources":["../../dev/j/load-animation-css.js"],"names":["avm","define","load","fileName","body","document","path","this","getStaticPath","link","createElement","rel","type","href","media","appendChild","paths","i","styleSheets","length","Array","prototype","slice","apply","split","join","playCssMonster","direction","timeout","setTimeout","animation","addClass","playClass","clearTimeout","delay","stopCssMonster","removeClass","$","require","waypoints","$window","window","loadCss","el","next","on","detect","os","isAndroid","isIOS"],"mappings":"AAOAA,IAAIC,OAAO,oBAAsB,WAChC,YAEA,QACCC,KAAM,SAASC,GACd,GAAIC,GAAQC,SAASD,KACpBE,EAAOC,KAAKC,gBACZC,EAAQJ,SAASK,cAAc,OAEhCD,GAAKE,IAAO,aACZF,EAAKG,KAAO,WACZH,EAAKI,KAAOP,EAAO,IAAMH,EACzBM,EAAKK,MAAQ,SACTX,GAAYG,GACfF,EAAKW,YAAYN,IAGnBD,cAAe,WAGd,IAAK,GAFDQ,GAEKC,EAAI,EAAGA,EAAIZ,SAASa,YAAYC,OAAQF,IAChD,GAAIZ,SAASa,YAAYD,IAAMZ,SAASa,YAAYD,GAAGJ,KAAM,CAC5DG,EAAQI,MAAMC,UAAUC,MAAMC,MAAMlB,SAASa,YAAYD,GAAGJ,KAAKW,MAAM,MAAO,GAAI,GAClF,OAIF,GAAIR,GAASA,EAAMG,OAClB,MAAQH,GAAMS,KAAK,WAMvB,WAoBC,QAASC,GAAeC,GAEvBC,EAAUC,WAAW,SAASF,GAE7BG,EAAUC,SAASC,GACnBC,aAAaL,IACXM,GAGJ,QAASC,GAAeR,GAEvBM,aAAaL,GACbE,EAAUM,YAAYJ,GA/BvB,GASCJ,GATGS,EAAIrC,IAAIsC,QAAQ,UACnBC,EAAYvC,IAAIsC,QAAQ,uBACxBE,EAAUH,EAAEI,QACZC,EAAU1C,IAAIsC,QAAQ,qBACtBK,EAAKN,EAAE,eAEPL,GADOW,EAAGC,OACC,kBACXd,EAAYO,EAAE,wBACdH,EAAQ,GAGTM,GAAQK,GAAG,gBAAiB,WACvBN,EAAUI,GACbjB,IAEAS,KAmBF,IAAIW,GAAS9C,IAAIsC,QAAQ,iBAEjBQ,GAAOC,GAAGC,WAAcF,EAAOC,GAAGE,OACpCP,EAAQxC,KAAK","file":"load-animation-css.js","sourcesContent":["/**\n * Asynchronous CSS\n * @module avast.web.loadCss\n * @version 0.1.0\n * @author Aleš Gabriel \n */\n\navm.define('avast.web.loadCss', (function(){\n\t\"use strict\";\n\n\treturn {\n\t\tload: function(fileName) {\n\t\t\tvar body = document.body,\n\t\t\t\tpath = this.getStaticPath(),\n\t\t\t\tlink = document.createElement('link');\n\n\t\t\tlink.rel = 'stylesheet';\n\t\t\tlink.type = 'text/css';\n\t\t\tlink.href = path + '/' + fileName;\n\t\t\tlink.media = 'screen';\n\t\t\tif (fileName && path) {\n\t\t\t\tbody.appendChild(link);\n\t\t\t}\n\t\t},\n\t\tgetStaticPath: function(){\n\t\t\tvar paths;\n\n\t\t\tfor (var i = 0; i < document.styleSheets.length; i++){\n\t\t\t\tif (document.styleSheets[i] && document.styleSheets[i].href) {\n\t\t\t\t\tpaths = Array.prototype.slice.apply(document.styleSheets[i].href.split('/'), [0, -1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (paths && paths.length) {\n\t\t\t\treturn paths.join('/');\n\t\t\t}\n\t\t}\n\t}\n})());\n\n(function(){\n\tvar $ = avm.require('jquery'),\n\t\twaypoints = avm.require('avast.web.waypoints'),\n\t\t$window = $(window),\n\t\tloadCss = avm.require('avast.web.loadCss'),\n\t\tel = $('#protection'),\n\t\tnext = el.next(),\n\t\tplayClass ='play-animation',\n\t\tanimation = $('#avast-animation-div'),\n\t\tdelay = 1000,\n\t\ttimeout;\n\n\t$window.on('resize scroll', function() {\n\t\tif (waypoints(el)) {\n\t\t\tplayCssMonster();\n\t\t} else {\n\t\t\tstopCssMonster();\n\t\t}\n\t});\n\n\tfunction playCssMonster(direction) {\n\t\t//console.log('play monster');\n\t\ttimeout = setTimeout(function(direction) {\n\t\t\t//console.log('play monster timeout');\n\t\t\tanimation.addClass(playClass);\n\t\t\tclearTimeout(timeout);\n\t\t}, delay);\n\t}\n\n\tfunction stopCssMonster(direction) {\n\t\t//console.log('stop monster');\n\t\tclearTimeout(timeout);\n\t\tanimation.removeClass(playClass);\n\t}\n\n\tvar detect = avm.require('avast.detect')();\n\n if (!detect.os.isAndroid && !detect.os.isIOS) {\n loadCss.load('windows-animation-v12.css');\n }\n\n})();\n"]}