|
@@ -14,6 +14,27 @@ createjs.Sound.registerSound("sound/start/swy.mp3", "swy");
|
|
|
createjs.Sound.registerSound("sound/start/qcdf.mp3", "qcdf");
|
|
|
createjs.Sound.registerSound("sound/background_music.mp3", "bgm");
|
|
|
|
|
|
+createjs.Sound.registerSound("sound/cut.mp3", "cut");//切菜
|
|
|
+createjs.Sound.registerSound("sound/oil.mp3", "oil");//空锅倒油(肉、油麦菜)
|
|
|
+createjs.Sound.registerSound("sound/soup.mp3", "soup");//煮
|
|
|
+createjs.Sound.registerSound("sound/shake.mp3", "shake");//摇
|
|
|
+
|
|
|
+// 大屏适配
|
|
|
+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',//用户头像
|
|
@@ -30,7 +51,8 @@ for (i=0; i < params.length ; i++){
|
|
|
URLParams[aParam[0]] = aParam[1];
|
|
|
}
|
|
|
function init() {
|
|
|
- createjs.Sound.play("bgm", {loop: -1});
|
|
|
+ //createjs.Sound.play("bgm", {loop: -1});
|
|
|
+ just_play();
|
|
|
var comp = AdobeAn.getComposition("5529E26743974F469545223C44E61D22");
|
|
|
var lib = comp.getLibrary();
|
|
|
var loader = new createjs.LoadQueue(false);
|
|
@@ -67,7 +89,14 @@ function handleComplete(evt, comp) {
|
|
|
}
|
|
|
var exportRoot = new lib.assets();
|
|
|
$(".loading").fadeOut(function(){
|
|
|
- $(".select-dish-box").find(".animated").removeClass("js-an");
|
|
|
+ // $(".select-dish-box").find(".animated").removeClass("js-an");
|
|
|
+ $(".loading2").show();
|
|
|
+ $(".loading2").on("touchend",function(){
|
|
|
+ $(".loading2").fadeOut(function(){
|
|
|
+ $(".warp").show();
|
|
|
+ $(".select-dish-box").find(".animated").removeClass("js-an");
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
|
|
@@ -84,6 +113,15 @@ function handleComplete(evt, comp) {
|
|
|
dishIndex = $(".select-dish-box .item.active").index();
|
|
|
$(".select-dish-box").hide();
|
|
|
$(".game-box").show();
|
|
|
+ $(".cut-mode2").show();
|
|
|
+ setTimeout(function(){ $(".cut-mode2").hide(); }, 1500);
|
|
|
+ $(".cut-mode2").on("touchend",function(){
|
|
|
+ $(this).hide();
|
|
|
+ })
|
|
|
+
|
|
|
+ $(".move-mode2").on("touchend",function(){
|
|
|
+ $(this).hide();
|
|
|
+ })
|
|
|
|
|
|
// 判断是哪个菜
|
|
|
if(dishIndex == 0){
|
|
@@ -117,8 +155,7 @@ function handleComplete(evt, comp) {
|
|
|
})
|
|
|
$(".replay-btn").on("click",function(){
|
|
|
URLParams = new Array();
|
|
|
- window.location.href = "http://wx.ttkuaiban.com/minigame/";
|
|
|
- //location.reload()
|
|
|
+ window.location.href = "https://wx.ttkuaiban.com/minigame/";
|
|
|
})
|
|
|
//$(".secret-btn").on("click",function(){
|
|
|
//saveText();
|
|
@@ -130,22 +167,40 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
|
|
|
function ballAnim(dom) {
|
|
|
+ var video = "";
|
|
|
+ if(dishIndex == 0){
|
|
|
+ video = createjs.Sound.play("soup");//播放
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ video = createjs.Sound.play("soup");//播放
|
|
|
+ }else if(dishIndex == 3){
|
|
|
+ video = createjs.Sound.play("soup");//播放
|
|
|
+ }
|
|
|
+ video.volume = 1;
|
|
|
+ setTimeout(function(){
|
|
|
+ video.paused = true;
|
|
|
+ }, 3500);
|
|
|
var anim = new TimelineMax({ repeat: -1 });
|
|
|
anim.to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "-=30", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn });
|
|
|
+ .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.3, { rotation: "-=30", ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn });
|
|
|
return anim;
|
|
|
}
|
|
|
|
|
|
function materialAnim(dom, x, y, callback) {
|
|
|
var anim = new TimelineMax({ onComplete: callback });
|
|
|
- anim.to(dom, 0.5, { x: "+=" + x, y: "+=" + y, ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn });
|
|
|
+ anim.to(dom, 0.5, { x: "+=" + x, y: "+=" + y,scale:1.1, ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
|
|
|
+ .to(exportRoot.powder, 0.1, { alpha: 1, ease: Power0.easeIn },"-=0.1")
|
|
|
+ .to(exportRoot.powder, 0.3, { x: "-=15",y:"+=55",alpha:0, ease: Power0.easeIn },'-=0.2')
|
|
|
+ .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
|
|
|
+ .to(exportRoot.powder, 0.01, { x: "+=15",y:"-=55",alpha:0, ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
|
|
|
+ .to(exportRoot.powder, 0.1, { alpha: 1, ease: Power0.easeIn },"-=0.1")
|
|
|
+ .to(exportRoot.powder, 0.3, { x: "-=15",y:"+=55",alpha:0, ease: Power0.easeIn },'-=0.2')
|
|
|
+ .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
|
|
|
+ .to(exportRoot.powder, 0.1, { alpha:0, ease: Power0.easeIn });
|
|
|
return anim;
|
|
|
}
|
|
|
|
|
@@ -157,38 +212,55 @@ function handleComplete(evt, comp) {
|
|
|
}
|
|
|
var anim = new TimelineMax({ delay:0.8});
|
|
|
anim.to(dom, 0.4, { alpha: 1, ease: Power0.easeIn })
|
|
|
- .to(dom, 1, { scale: 1, ease: Power0.easeIn })
|
|
|
+ .to(dom, 1, { scale: 1, ease: Power0.easeIn })
|
|
|
return anim;
|
|
|
}
|
|
|
function bowlAnim(callback) {
|
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.3 });
|
|
|
anim.to(exportRoot.plate, 0.5, { y: "-=370", ease: Power0.easeIn })
|
|
|
- .to(exportRoot.bowl, 0.5, { alpha: 1, ease: Power0.easeIn });
|
|
|
+ .to(exportRoot.bowl, 0.5, { alpha: 1, ease: Power0.easeIn });
|
|
|
return anim;
|
|
|
}
|
|
|
|
|
|
function proAnim(callback) {
|
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.5 });
|
|
|
anim.to(exportRoot.pro.proImg, 0.5, { rotation: "-=25", ease: Power0.easeIn })
|
|
|
- .to(exportRoot.pro.oil_icon1, 0.3, {alpha:1})
|
|
|
- .to(exportRoot.pro.oil_icon2, 0.2, {alpha:1})
|
|
|
- .to(exportRoot.pro.proImg, 1, {})
|
|
|
- .to(exportRoot.pro, 0.3, { alpha: 0, ease: Power0.easeIn })
|
|
|
- .to(exportRoot.pro, 1, {})
|
|
|
+ .to(exportRoot.pro.oil_icon1, 0.3, {alpha:1})
|
|
|
+ .to(exportRoot.pro.oil_icon2, 0.2, {alpha:1})
|
|
|
+ .to(exportRoot.pro.proImg, 1, {})
|
|
|
+ .to(exportRoot.pro, 0.3, { alpha: 0, ease: Power0.easeIn })
|
|
|
+ .to(exportRoot.pro, 1, {})
|
|
|
return anim;
|
|
|
}
|
|
|
function oilIconAnim() {
|
|
|
oilAnim();
|
|
|
-
|
|
|
+ var video = "" , noice = "" , soup = "";
|
|
|
if(dishIndex == 0){
|
|
|
- createjs.Sound.play("hsr");//播放
|
|
|
+ noice = createjs.Sound.play("hsr");//播放
|
|
|
+ setTimeout(function(){
|
|
|
+ video = createjs.Sound.play("oil");//播放
|
|
|
+ }, 1000);
|
|
|
}else if(dishIndex == 1){
|
|
|
- createjs.Sound.play("qcdf");//播放
|
|
|
+ noice = createjs.Sound.play("qcdf");//播放
|
|
|
+ setTimeout(function(){
|
|
|
+ video = createjs.Sound.play("oil");//播放
|
|
|
+ }, 2000);
|
|
|
}else if(dishIndex == 2){
|
|
|
- createjs.Sound.play("swy");//播放
|
|
|
+ noice = createjs.Sound.play("swy");//播放
|
|
|
}else{
|
|
|
- createjs.Sound.play("ymc");//播放
|
|
|
+ noice = createjs.Sound.play("ymc");//播放
|
|
|
+ setTimeout(function(){
|
|
|
+ video = createjs.Sound.play("oil");//播放
|
|
|
+ }, 3000);
|
|
|
}
|
|
|
+ noice.volume = 1;
|
|
|
+ video.volume = 0.2;
|
|
|
+ //soup.volume = 0.8;
|
|
|
+ setTimeout(function(){
|
|
|
+ video.paused = true;
|
|
|
+ //soup.paused = true;
|
|
|
+ }, 6000);
|
|
|
+
|
|
|
var anim = new TimelineMax({ repeat:10,delay:1});
|
|
|
anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
|
|
|
return anim;
|
|
@@ -197,7 +269,7 @@ function handleComplete(evt, comp) {
|
|
|
function btnAnim(dom){
|
|
|
var anim = new TimelineMax({ repeat:-1 });
|
|
|
anim.to(dom, 0.3, { scale: "+=0.1", ease: Power0.easeIn })
|
|
|
- .to(dom, 0.3, { scale: "-=0.1", ease: Power0.easeIn })
|
|
|
+ .to(dom, 0.3, { scale: "-=0.1", ease: Power0.easeIn })
|
|
|
return anim;
|
|
|
}
|
|
|
function fadeInAnim(dom){
|
|
@@ -218,6 +290,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;
|
|
@@ -271,12 +352,12 @@ function handleComplete(evt, comp) {
|
|
|
]
|
|
|
// 红烧肉的位置
|
|
|
var hsr_iconArr = [{
|
|
|
- x: exportRoot.plate.x + exportRoot.plate.hsr_icon1.x,
|
|
|
- y: exportRoot.plate.y + exportRoot.plate.hsr_icon1.y,
|
|
|
- width: 202,
|
|
|
- height: 129,
|
|
|
- isClear: false
|
|
|
- },
|
|
|
+ x: exportRoot.plate.x + exportRoot.plate.hsr_icon1.x,
|
|
|
+ y: exportRoot.plate.y + exportRoot.plate.hsr_icon1.y,
|
|
|
+ width: 202,
|
|
|
+ height: 129,
|
|
|
+ isClear: false
|
|
|
+ },
|
|
|
{
|
|
|
x: exportRoot.plate.x + exportRoot.plate.hsr_icon2.x,
|
|
|
y: exportRoot.plate.y + exportRoot.plate.hsr_icon2.y,
|
|
@@ -301,12 +382,12 @@ function handleComplete(evt, comp) {
|
|
|
];
|
|
|
// 青菜豆腐的位置
|
|
|
var qcdf_iconArr = [{
|
|
|
- x: exportRoot.plate.x + exportRoot.plate.qcdf_icon1.x,
|
|
|
- y: exportRoot.plate.y + exportRoot.plate.qcdf_icon1.y,
|
|
|
- width: 169,
|
|
|
- height: 320,
|
|
|
- isClear: false
|
|
|
- },
|
|
|
+ x: exportRoot.plate.x + exportRoot.plate.qcdf_icon1.x,
|
|
|
+ y: exportRoot.plate.y + exportRoot.plate.qcdf_icon1.y,
|
|
|
+ width: 169,
|
|
|
+ height: 320,
|
|
|
+ isClear: false
|
|
|
+ },
|
|
|
{
|
|
|
x: exportRoot.plate.x + exportRoot.plate.qcdf_icon2.x,
|
|
|
y: exportRoot.plate.y + exportRoot.plate.qcdf_icon2.y,
|
|
@@ -387,6 +468,7 @@ function handleComplete(evt, comp) {
|
|
|
y: event.stageY,
|
|
|
};
|
|
|
lineArr.push(obj);
|
|
|
+ createjs.Sound.play("cut");//播放
|
|
|
})
|
|
|
exportRoot.addEventListener("pressmove", function(event) {
|
|
|
if (lineArr.length >= 15) {
|
|
@@ -476,17 +558,22 @@ 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 if(dishIndex == 1){
|
|
|
+ menuIconInAnim(exportRoot.pot.qcdf);
|
|
|
+ }else{
|
|
|
+ exportRoot.btn2.alpha = 1;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
})
|
|
|
exportRoot.btn2.addEventListener("mousedown", function() {
|
|
|
exportRoot.btn2.removeAllEventListeners();
|
|
@@ -495,45 +582,120 @@ 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);
|
|
|
+ if(dishIndex == 0){
|
|
|
+ exportRoot.pot.hsr.play();
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ exportRoot.pot.qcdf.play();
|
|
|
+ }else{
|
|
|
+ exportRoot.pot.ymc.play();
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
exportRoot.blackboard.material1.addEventListener("mousedown", function() {
|
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
|
+ chooseType = 3;
|
|
|
$(".poster-mode").addClass("poster-bg3");
|
|
|
+ exportRoot.ball1.alpha = 1;
|
|
|
+ if(dishIndex == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_lv.png');
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_lv.png');
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_lv.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_lv.png');
|
|
|
+ }
|
|
|
materialAnim(exportRoot.blackboard.material1, 300, 180, function() {
|
|
|
exportRoot.blackboard.material1.x -=300;
|
|
|
exportRoot.blackboard.material1.y -=180;
|
|
|
+ exportRoot.blackboard.material1.scale = 1;
|
|
|
// $(".shake-mode").show();
|
|
|
- shakeInit();
|
|
|
+ setTimeout(function(){ shakeInit(); }, 2000);
|
|
|
+ if(dishIndex == 0){
|
|
|
+ exportRoot.pot.hsr.play();
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ exportRoot.pot.qcdf.play();
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ exportRoot.bowl.oil.alpha = 0;
|
|
|
+ exportRoot.plate['swy_icon1'].play();
|
|
|
+ }else{
|
|
|
+ exportRoot.pot.ymc.play();
|
|
|
+ }
|
|
|
});
|
|
|
})
|
|
|
exportRoot.blackboard.material2.addEventListener("mousedown", function() {
|
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
|
+ chooseType = 2;
|
|
|
$(".poster-mode").addClass("poster-bg2");
|
|
|
+ exportRoot.ball1.gotoAndStop(1);
|
|
|
+ exportRoot.ball1.alpha = 1;
|
|
|
+ if(dishIndex == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_hei.png');
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_hei.png');
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_hei.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_hei.png');
|
|
|
+ }
|
|
|
materialAnim(exportRoot.blackboard.material2, 120, 180, function() {
|
|
|
exportRoot.blackboard.material2.x -=120;
|
|
|
exportRoot.blackboard.material2.y -=180;
|
|
|
+ exportRoot.blackboard.material2.scale = 1;
|
|
|
// $(".shake-mode").show();
|
|
|
- shakeInit();
|
|
|
+ setTimeout(function(){ shakeInit(); }, 2000);
|
|
|
+ if(dishIndex == 0){
|
|
|
+ exportRoot.pot.hsr.play();
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ exportRoot.pot.qcdf.play();
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ exportRoot.bowl.oil.alpha = 0;
|
|
|
+ exportRoot.plate['swy_icon1'].play();
|
|
|
+ }else{
|
|
|
+ exportRoot.pot.ymc.play();
|
|
|
+ }
|
|
|
});
|
|
|
})
|
|
|
exportRoot.blackboard.material3.addEventListener("mousedown", function() {
|
|
|
exportRoot.blackboard.material1.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material2.removeAllEventListeners();
|
|
|
exportRoot.blackboard.material3.removeAllEventListeners();
|
|
|
+ chooseType = 1;
|
|
|
$(".poster-mode").addClass("poster-bg1");
|
|
|
+ exportRoot.ball1.gotoAndStop(2);
|
|
|
+ exportRoot.ball1.alpha = 1;
|
|
|
+ if(dishIndex == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_fen.png');
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_fen.png');
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_fen.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_fen.png');
|
|
|
+ }
|
|
|
materialAnim(exportRoot.blackboard.material3, -30, 180, function() {
|
|
|
exportRoot.blackboard.material3.x +=30;
|
|
|
exportRoot.blackboard.material3.y -=180;
|
|
|
+ exportRoot.blackboard.material3.scale = 1;
|
|
|
// $(".shake-mode").show();
|
|
|
- shakeInit();
|
|
|
+ setTimeout(function(){ shakeInit(); }, 2000);
|
|
|
+
|
|
|
+ if(dishIndex == 0){
|
|
|
+ exportRoot.pot.hsr.play();
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ exportRoot.pot.qcdf.play();
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ exportRoot.bowl.oil.alpha = 0;
|
|
|
+ exportRoot.plate['swy_icon1'].play();
|
|
|
+ }else{
|
|
|
+ exportRoot.pot.ymc.play();
|
|
|
+ }
|
|
|
});
|
|
|
})
|
|
|
}
|
|
@@ -545,12 +707,16 @@ function handleComplete(evt, comp) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
stage.removeChild(lineShape);
|
|
|
clearInterval(lineTimr);
|
|
|
exportRoot.removeAllEventListeners();
|
|
|
|
|
|
|
|
|
bowlAnim(function() {
|
|
|
+
|
|
|
+ $(".move-mode2").show();
|
|
|
+ setTimeout(function(){ $(".move-mode2").hide(); }, 1500);
|
|
|
if(dishIndex == 0){
|
|
|
dishMove(exportRoot.plate.hsr_icon1,0,0);
|
|
|
dishMove(exportRoot.plate.hsr_icon2,0,0);
|
|
@@ -594,6 +760,7 @@ function handleComplete(evt, comp) {
|
|
|
var x, y, z, last_x = 0,
|
|
|
last_y = 0,
|
|
|
last_z = 0;
|
|
|
+ var createTime = false;
|
|
|
|
|
|
function deviceMotionHandler(eventData) {
|
|
|
var acceleration = eventData.accelerationIncludingGravity;
|
|
@@ -606,7 +773,13 @@ function handleComplete(evt, comp) {
|
|
|
z = acceleration.z;
|
|
|
var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
|
|
|
if (speed > SHAKE_THRESHOLD) {
|
|
|
+ if(!createTime) {
|
|
|
+ createTime = true;
|
|
|
+ var video = createjs.Sound.play("shake");//播放
|
|
|
+ setTimeout(function(){ video.paused = true;createTime = false; }, 2500);
|
|
|
+ }
|
|
|
$(".shake-mode2").hide();
|
|
|
+ $(".shake-mode").show();
|
|
|
shake_cnt++;
|
|
|
if(shake_cnt>2){
|
|
|
setTimeout(function(){
|
|
@@ -623,23 +796,22 @@ function handleComplete(evt, comp) {
|
|
|
if(document.location.href.indexOf('type') == -1){
|
|
|
var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
|
|
|
history.pushState("", "Title", href);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
if(dishIndex == 0){
|
|
|
- exportRoot.pot.hsr.gotoAndStop(1);
|
|
|
+ exportRoot.pot.hsr.gotoAndStop(3);
|
|
|
}else if(dishIndex == 1){
|
|
|
- exportRoot.pot.qcdf.gotoAndStop(1);
|
|
|
+ exportRoot.pot.qcdf.gotoAndStop(3);
|
|
|
}else if(dishIndex == 2){
|
|
|
exportRoot.bowl.oil.alpha = 0;
|
|
|
exportRoot.plate['swy_icon1'].gotoAndStop(2);
|
|
|
}else{
|
|
|
- exportRoot.pot.ymc.gotoAndStop(1);
|
|
|
+ exportRoot.pot.ymc.gotoAndStop(3);
|
|
|
}
|
|
|
$(".shake-mode").fadeOut();
|
|
|
- exportRoot.btn3.removeAllEventListeners();
|
|
|
+ // exportRoot.btn3.removeAllEventListeners();
|
|
|
$(".poster-mode").fadeIn();
|
|
|
},3000)
|
|
|
-
|
|
|
}
|
|
|
//dosomething
|
|
|
$("#fire").addClass("anim-time");
|
|
@@ -652,18 +824,11 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
// 开始火的动画
|
|
|
$("#fire").removeClass("js-an");
|
|
|
- $(".shake-dialog .icon").hide();
|
|
|
- $(".shake-dialog .txt").hide();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//Registers the "tick" event listener.
|
|
|
function fnStartAnimation() {
|
|
|
stage.addChild(exportRoot, lineShape);
|
|
@@ -676,12 +841,14 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
function getInfo() {
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
+ var isMobile = false;
|
|
|
if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
|
|
|
+ isMobile = true;
|
|
|
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
type = 0;
|
|
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
|
|
|
+"appid=wx749c84daac654e1e&"
|
|
|
- +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
|
|
|
+ +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
|
|
|
+"response_type=code&"
|
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
|
+"state=1#wechat_redirect";
|
|
@@ -692,7 +859,7 @@ function getInfo() {
|
|
|
url = "https://api.weibo.com/oauth2/authorize?"
|
|
|
+"client_id=2141531565&"
|
|
|
+"response_type=code&"
|
|
|
- +"redirect_uri=http://wx.ttkuaiban.com/minigame/index.html"
|
|
|
+ +"redirect_uri=https://wx.ttkuaiban.com/minigame/index.html"
|
|
|
}
|
|
|
} else {
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
@@ -700,14 +867,16 @@ function getInfo() {
|
|
|
type = 0;
|
|
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
|
|
|
+"appid=wx749c84daac654e1e&"
|
|
|
- +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
|
|
|
+ +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
|
|
|
+"response_type=code&"
|
|
|
+"scope=snsapi_userinfo&"//snsapi_userinfo
|
|
|
+"state=1#wechat_redirect";
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(URLParams['uid']) {
|
|
|
+ $('#edit').hide();
|
|
|
$('#nameInput').hide();
|
|
|
$('#nameText').show();
|
|
|
$('#textInput').hide();
|
|
@@ -719,18 +888,41 @@ function getInfo() {
|
|
|
chooseType = URLParams['type'];
|
|
|
dishType = URLParams['food'];
|
|
|
$(".poster-mode").addClass("poster-bg" + chooseType);
|
|
|
- if(dishType == 0){
|
|
|
- $('#poster').attr('src','./img/poster/hsr.png');
|
|
|
- }else if(dishType == 1){
|
|
|
- $('#poster').attr('src','./img/poster/qcdf.png');
|
|
|
- }else if(dishType == 2){
|
|
|
- $('#poster').attr('src','./img/poster/swy.png');
|
|
|
- }else{
|
|
|
- $('#poster').attr('src','./img/poster/ymc.png');
|
|
|
+ if(chooseType == 3) {
|
|
|
+ if(dishType == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_lv.png');
|
|
|
+ }else if(dishType == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_lv.png');
|
|
|
+ }else if(dishType == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_lv.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_lv.png');
|
|
|
+ }
|
|
|
+ } else if(chooseType == 2) {
|
|
|
+ if(dishType == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_hei.png');
|
|
|
+ }else if(dishType == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_hei.png');
|
|
|
+ }else if(dishType == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_hei.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_hei.png');
|
|
|
+ }
|
|
|
+ } else if(chooseType == 1) {
|
|
|
+ if(dishType == 0){
|
|
|
+ $('#poster').attr('src','./img/poster/hsr_fen.png');
|
|
|
+ }else if(dishType == 1){
|
|
|
+ $('#poster').attr('src','./img/poster/qcdf_fen.png');
|
|
|
+ }else if(dishType == 2){
|
|
|
+ $('#poster').attr('src','./img/poster/swy_fen.png');
|
|
|
+ }else{
|
|
|
+ $('#poster').attr('src','./img/poster/ymc_fen.png');
|
|
|
+ }
|
|
|
}
|
|
|
getMsg();
|
|
|
$(".poster-mode").fadeIn();
|
|
|
} else {
|
|
|
+ $('#edit').show();
|
|
|
$('#nameInput').show();
|
|
|
$('#nameText').hide();
|
|
|
$('#textInput').show();
|
|
@@ -740,7 +932,10 @@ function getInfo() {
|
|
|
$('.secret-btn').show();
|
|
|
|
|
|
init();
|
|
|
- getMsg();
|
|
|
+ if (isMobile && !window.ifDebug) {
|
|
|
+ getMsg();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -868,12 +1063,8 @@ function saveText() {
|
|
|
history.pushState("", "Title", href);
|
|
|
}
|
|
|
|
|
|
- $("#cover").show();
|
|
|
- //if(type == 1) {
|
|
|
- setTimeout(function(){
|
|
|
- window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
- }, 10000);
|
|
|
- //}
|
|
|
+ //海报页面的微信分享
|
|
|
+ shareWeixin(msg.data.message);
|
|
|
}else{
|
|
|
console.log("错误"+xhr.status)
|
|
|
}
|
|
@@ -883,7 +1074,7 @@ function saveText() {
|
|
|
|
|
|
$(".replay-btn").on("click",function(){
|
|
|
URLParams = new Array();
|
|
|
- window.location.href = "http://wx.ttkuaiban.com/minigame/";
|
|
|
+ window.location.href = "https://wx.ttkuaiban.com/minigame/";
|
|
|
})
|
|
|
|
|
|
function hiddenCover() {
|