/*! 2018-07-13 */
$(function(){function a(){return f[Math.floor(Math.random()*f.length)]}function b(){k&&k.paused&&k.play()}function c(a){var c=a.accelerationIncludingGravity,e=(new Date).getTime();if(e-s>80){var f=e-s;s=e,m=c.x,n=c.y,o=c.z,Math.abs(m+n+o-p-q-r)/f*1e4>l?(b(),$("body").addClass("shakeing"),d()):$("body").removeClass("shakeing"),p=m,q=n,r=o}}function d(){e||_meepoajax._ajax({do_it:"shake_count",type:"POST",dataType:"json",cache:!1,formPata:{rid:scene_id,rotate_id:rotate_id},success:function(b){-1==b.errno?i.html("淡定，淡定，游戏还没开始！"):(0==b.errno&&i.html(a()),1==b.errno&&i.html(b.message))}})}var e=($(window).width()<$(window).height()?$(window).width():$(window).height(),!1),f=SHAKE_INFO&&$.isArray(SHAKE_INFO.slogan_list)&&SHAKE_INFO.slogan_list.length>0?SHAKE_INFO.slogan_list:["再大力！","再大力,再大力！","再大力,再大力,再大力！","摇，大力摇","快点摇啊，别停！","摇啊，摇啊，摇啊","小心手机，别飞出去伤到花花草草","看灰机～～～"],g=$(".shake-icon"),h=$(".shake-icon").offset().top+$(".shake-icon").height()+20,i=$(".memo").css({top:h+"px"});$(window).on("resize",function(){var a=$(".shake-icon").offset().top+$(".shake-icon").height()+20;$(".memo").css({top:a+"px"})});var j=/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent);i.html("点一下图标开启音乐更刺激"),g.one("click",function(){b(),i.html("听从现场指挥摇动手机")}),window.DeviceMotionEvent?window.addEventListener("devicemotion",c,!1):(i.html("您的手机不支持摇一摇，您可以通过点击图标参与。"),g.on("click",function(){10*Math.random()<5?(b(),$("body").addClass("shakeing"),d()):($("body").removeClass("shakeing"),d())}));var k=document.getElementById("ShakeAudio"),l=500;j||(l=800);var m,n,o,p,q,r,s=0});