text: function getLocationHash(){var i=location.href.indexOf("#"),e=-1===i?"":location.href.slice(i+1);return e}function getUrlParameterByName(i){i=i.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+i+"=([^&#]*)"),n=e.exec(location.search);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}function checkIsPC(){var i={win:!1,mac:!1,xll:!1},e=navigator.platform;i.win=0==e.indexOf("Win"),i.mac=0==e.indexOf("Mac"),i.x11="X11"==e||0==e.indexOf("Linux");var n=$(window).width();return n>app.DEFAULT_WIDTH&&(i.win||i.mac||i.xll)?!0:!1}var app={};app.isPC=!1,app.width,app.height,app.loop=!1,app.DEFAULT_WIDTH=414,app.DEFAULT_HEIGHT=736,app.init=function(i){i=i||{},app.loop=i.loop||getUrlParameterByName("loop")||!1,checkIsPC()&&(app.isPC=!0,app.width=app.DEFAULT_WIDTH,app.height=Math.min(app.DEFAULT_HEIGHT,app.height)),$(".wrap, .swiper-slide, .swiper-container,body").height(app.height).width(app.width);var e=$.extend({direction:"vertical",loop:app.loop,longSwipesRatio:.1,preventClicks:!1,preventClicksPropagation:!1},i||{});app.swiper=new Swiper(".swiper-container",e),app.initPC(),app.initArrow(),app.music.init(),$(".home-btn").on("click",function(){return app.swiper.slideTo(0),!1}),i.hashnav&&$(window).on("hashchange",function(){var i=getLocationHash().replace("#","");if(i)for(var e=0,n=app.swiper.slides.length;n>e;e++){var a=$(app.swiper.slides).eq(e),p=a.attr("data-hash");if(p===i&&!a.hasClass(app.swiper.params.slideDuplicateClass)){var t=a.index();if(app.swiper.activeIndex==t)return;app.swiper.slideTo(t)}}})},app.initArrow=function(){if(!app.loop){var i=$(".arrow"),e=app.swiper.slides.length;app.swiper.on("SlideChangeEnd",function(){var n=app.swiper.activeIndex;n>=e-1?i.hide():i.show()})}},app.initPC=function(){if(!app.isPC)return!1;var i=$(window).width()/2+app.width/2,e=$("#copyright");e.css({top:app.height+"px",opacity:1}),e.show();var n=$("#pc-board");n.find(".qrcode div").html('<img src="http://plus.94uv.com/qrcode/urlQrcode.html?data='+decodeURIComponent(location.href)+'"/>'),n.css({left:i+"px"}).show(),app.initPager()},app.initPager=function(){var i=$("#pc-board .pager a"),e=$("#btn-prev"),n=$("#btn-next");i.show();var a=app.swiper.slides.length;n.on("click",function(){return app.swiper.slideNext(),!1}),e.on("click",function(){return app.swiper.slidePrev(),!1});var p=function(){if(app.loop)return!1;var p=app.swiper.activeIndex;i.css("visibility","visible"),p>=a-1?n.css("visibility","hidden"):0==p?e.css("visibility","hidden"):i.show()};app.swiper.on("SlideChangeEnd",p),p()};var loading=function(){function i(i,n,o){o&&(r=1),"function"==typeof n&&(l=n);var s={};$(i).each(function(){var i=$(this);i.find("img").each(function(){var i=this.src;s[i]||(s[i]=1,c.push(i))});var e=i.css("background-image");"none"==e||s[e]||(s[e]=1,e=e.replace(/(\'|\")/g,"").replace("url(","").replace(")",""),console.log("pre-image:"+e),c.push(e))}),p=c.length,t=new Date,e(),a()}function e(){$.each(c,function(i,e){var a=new Image;a.src=e,a.onload=function(){this.complete&&(o++,n(Math.round(o/p*100)))}})}function n(i){h.length&&h.text(i+"%")}function a(){var i=new Date,e=i-t;r?o>=p&&e>s?l():setTimeout(function(){a()},200):o>=p?l():setTimeout(function(){a()},200)}var p,t,r,o=0,c=[],s=1e3,l=function(){},h=$("#percentage");return{init:i}}();app.music=function(){var i=$({}),e=$("audio")[0],n="player-btn-stop";return i.init=function(){$(".player-btn").on("click",function(){var e=$(this);e.hasClass("player-btn-stop")?i.on():i.off()})},i.on=function(){$(".player-btn").removeClass(n),e.play()},i.off=function(){$(".player-btn").addClass(n),e.pause()},i}();