|
@@ -18,6 +18,22 @@ createjs.Sound.registerSound("sound/cut.mp3", "cut");//切菜
|
|
|
createjs.Sound.registerSound("sound/oil.mp3", "oil");//空锅倒油(肉、油麦菜)
|
|
|
createjs.Sound.registerSound("sound/soup.mp3", "soup");//煮
|
|
|
|
|
|
+// 大屏适配
|
|
|
+var hFont = $('html').css('font-size');
|
|
|
+var h = $(window).height();
|
|
|
+hFont = hFont.slice(0,-2);
|
|
|
+// 屏幕超过1245。显示大屏配置
|
|
|
+if(h/hFont > 16.6){
|
|
|
+ $("body").addClass("big-page");
|
|
|
+}else if(h/hFont < 15.2){
|
|
|
+ $("body").addClass("small-page");
|
|
|
+ $(".game-box").css("top",'-35px')
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
window.user_info = {
|
|
|
uid: 0,
|
|
|
logo:'http://img5q.duitang.com/uploads/item/201502/25/20150225060808_wuANL.jpeg',//用户头像
|
|
@@ -97,7 +113,7 @@ function handleComplete(evt, comp) {
|
|
|
exportRoot.plate.hsr_icon3.alpha = 1;
|
|
|
exportRoot.plate.hsr_icon4.alpha = 1;
|
|
|
cutDishArr = hsr_iconArr;
|
|
|
- //$('#poster').attr('src','./img/poster/hsr.png');
|
|
|
+ $('#poster').attr('src','./img/poster/hsr.png');
|
|
|
}else if(dishIndex == 1){
|
|
|
exportRoot.plate.qcdf_icon1.alpha = 1;
|
|
|
exportRoot.plate.qcdf_icon2.alpha = 1;
|
|
@@ -105,19 +121,19 @@ function handleComplete(evt, comp) {
|
|
|
exportRoot.plate.qcdf_icon4.alpha = 1;
|
|
|
exportRoot.plate.qcdf_icon5.alpha = 1;
|
|
|
cutDishArr = qcdf_iconArr;
|
|
|
- //$('#poster').attr('src','./img/poster/qcdf.png');
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf.png');
|
|
|
}else if(dishIndex == 2){
|
|
|
exportRoot.plate.swy_icon1.alpha = 1;
|
|
|
exportRoot.plate.swy_icon2.alpha = 1;
|
|
|
cutDishArr = swy_iconArr;
|
|
|
- //$('#poster').attr('src','./img/poster/swy.png');
|
|
|
+ $('#poster').attr('src','./img/poster/swy.png');
|
|
|
}else{
|
|
|
exportRoot.plate.ymc_icon1.alpha = 1;
|
|
|
exportRoot.plate.ymc_icon2.alpha = 1;
|
|
|
exportRoot.plate.ymc_icon3.alpha = 1;
|
|
|
exportRoot.plate.ymc_icon4.alpha = 1;
|
|
|
cutDishArr = ymc_iconArr;
|
|
|
- //$('#poster').attr('src','./img/poster/ymc.png');
|
|
|
+ $('#poster').attr('src','./img/poster/ymc.png');
|
|
|
}
|
|
|
})
|
|
|
$(".replay-btn").on("click",function(){
|
|
@@ -229,6 +245,15 @@ function handleComplete(evt, comp) {
|
|
|
.to(exportRoot.btn2, 0.4, { alpha: 1, ease: Power0.easeIn })
|
|
|
return anim;
|
|
|
}
|
|
|
+ function menuIconInAnim2(dom,callback){
|
|
|
+ var anim = new TimelineMax({onComplete:callback });
|
|
|
+ anim.to(dom.icon1, 0.3, { alpha: 1, ease: Power0.easeIn })
|
|
|
+ .to(dom.icon2, 0.3, { alpha: 1, ease: Power0.easeIn })
|
|
|
+ .to(dom.icon3, 0.3, { alpha: 1, ease: Power0.easeIn })
|
|
|
+ .to(dom.icon4, 0.3, { alpha: 1, ease: Power0.easeIn })
|
|
|
+ .to(dom.icon5, 0.3, { alpha: 1, ease: Power0.easeIn })
|
|
|
+ return anim;
|
|
|
+ }
|
|
|
|
|
|
function materialEnterAnim(dom,delay){
|
|
|
dom.scale = 0.1;
|
|
@@ -488,19 +513,30 @@ function handleComplete(evt, comp) {
|
|
|
exportRoot.plate.swy_icon2.alpha = 0;
|
|
|
}
|
|
|
|
|
|
- oilIconAnim();
|
|
|
- proAnim(function() {
|
|
|
- btnAnim(exportRoot.btn2);
|
|
|
- if(dishIndex == 0){
|
|
|
- menuIconInAnim(exportRoot.pot.hsr);
|
|
|
- }else if(dishIndex == 1){
|
|
|
- menuIconInAnim(exportRoot.pot.qcdf);
|
|
|
- }else if(dishIndex == 3){
|
|
|
- menuIconInAnim(exportRoot.pot.ymc);
|
|
|
- }else{
|
|
|
- exportRoot.btn2.alpha = 1;
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+ if(dishIndex == 1){
|
|
|
+ menuIconInAnim2(exportRoot.pot.qcdf,function(){
|
|
|
+ oilIconAnim();
|
|
|
+ proAnim(function() {
|
|
|
+ exportRoot.btn2.alpha = 1;
|
|
|
+ btnAnim(exportRoot.btn2);
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ oilIconAnim();
|
|
|
+ proAnim(function() {
|
|
|
+ btnAnim(exportRoot.btn2);
|
|
|
+ if(dishIndex == 0){
|
|
|
+ menuIconInAnim(exportRoot.pot.hsr);
|
|
|
+ }else if(dishIndex == 3){
|
|
|
+ menuIconInAnim(exportRoot.pot.ymc);
|
|
|
+ }else{
|
|
|
+ exportRoot.btn2.alpha = 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
exportRoot.btn2.addEventListener("mousedown", function() {
|
|
|
exportRoot.btn2.removeAllEventListeners();
|
|
@@ -509,7 +545,6 @@ function handleComplete(evt, comp) {
|
|
|
materialEnterAnim(exportRoot.blackboard.material1,0.2);
|
|
|
materialEnterAnim(exportRoot.blackboard.material2,0.4);
|
|
|
materialEnterAnim(exportRoot.blackboard.material3,0.6);
|
|
|
- exportRoot.ball1.alpha = 1;
|
|
|
|
|
|
ballAnim(exportRoot.ball1);
|
|
|
})
|
|
@@ -630,7 +665,7 @@ function handleComplete(evt, comp) {
|
|
|
//获取加速度信息
|
|
|
//通过监听上一步获取到的x, y, z 值在一定时间范围内的变化率,进行设备是否有进行晃动的判断。
|
|
|
//而为了防止正常移动的误判,需要给该变化率设置一个合适的临界值。
|
|
|
- var SHAKE_THRESHOLD = 10000; //阈值越大,触发摇晃事件时手机摇晃的程度越剧烈
|
|
|
+ var SHAKE_THRESHOLD = 10000000; //阈值越大,触发摇晃事件时手机摇晃的程度越剧烈
|
|
|
var last_update = 0;
|
|
|
var x, y, z, last_x = 0,
|
|
|
last_y = 0,
|
|
@@ -638,6 +673,7 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
function deviceMotionHandler(eventData) {
|
|
|
var acceleration = eventData.accelerationIncludingGravity;
|
|
|
+ console.log(acceleration);
|
|
|
var curTime = new Date().getTime();
|
|
|
if ((curTime - last_update) > 10) {
|
|
|
var diffTime = curTime - last_update;
|
|
@@ -646,6 +682,7 @@ function handleComplete(evt, comp) {
|
|
|
y = acceleration.y;
|
|
|
z = acceleration.z;
|
|
|
var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
|
|
|
+ console.log('speed='+speed+',SHAKE_THRESHOLD='+SHAKE_THRESHOLD)
|
|
|
if (speed > SHAKE_THRESHOLD) {
|
|
|
$(".shake-mode2").hide();
|
|
|
$(".shake-mode").show();
|
|
@@ -681,7 +718,6 @@ function handleComplete(evt, comp) {
|
|
|
// exportRoot.btn3.removeAllEventListeners();
|
|
|
$(".poster-mode").fadeIn();
|
|
|
},3000)
|
|
|
-
|
|
|
}
|
|
|
//dosomething
|
|
|
$("#fire").addClass("anim-time");
|
|
@@ -694,8 +730,6 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
// 开始火的动画
|
|
|
$("#fire").removeClass("js-an");
|
|
|
- // $(".shake-dialog .icon").hide();
|
|
|
- // $(".shake-dialog .txt").hide();
|
|
|
}
|
|
|
}
|
|
|
|