|
@@ -109,7 +109,7 @@ function handleComplete(evt, comp) {
|
|
$(".cut-mode2").show();
|
|
$(".cut-mode2").show();
|
|
setTimeout(function(){ $(".cut-mode2").hide(); }, 1500);
|
|
setTimeout(function(){ $(".cut-mode2").hide(); }, 1500);
|
|
$(".cut-mode2").on("touchend",function(){
|
|
$(".cut-mode2").on("touchend",function(){
|
|
- $(this).hide();
|
|
|
|
|
|
+ $(this).hide();
|
|
})
|
|
})
|
|
|
|
|
|
$(".move-mode2").on("touchend",function(){
|
|
$(".move-mode2").on("touchend",function(){
|
|
@@ -160,22 +160,34 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
|
|
|
|
function ballAnim(dom) {
|
|
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 });
|
|
var anim = new TimelineMax({ repeat: -1 });
|
|
anim.to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn })
|
|
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;
|
|
return anim;
|
|
}
|
|
}
|
|
|
|
|
|
function materialAnim(dom, x, y, callback) {
|
|
function materialAnim(dom, x, y, callback) {
|
|
var anim = new TimelineMax({ onComplete: callback });
|
|
var anim = new TimelineMax({ onComplete: callback });
|
|
anim.to(dom, 0.5, { x: "+=" + x, y: "+=" + y, ease: Power0.easeIn })
|
|
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 });
|
|
|
|
|
|
+ .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 });
|
|
return anim;
|
|
return anim;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,44 +199,54 @@ function handleComplete(evt, comp) {
|
|
}
|
|
}
|
|
var anim = new TimelineMax({ delay:0.8});
|
|
var anim = new TimelineMax({ delay:0.8});
|
|
anim.to(dom, 0.4, { alpha: 1, ease: Power0.easeIn })
|
|
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;
|
|
return anim;
|
|
}
|
|
}
|
|
function bowlAnim(callback) {
|
|
function bowlAnim(callback) {
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.3 });
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.3 });
|
|
anim.to(exportRoot.plate, 0.5, { y: "-=370", ease: Power0.easeIn })
|
|
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;
|
|
return anim;
|
|
}
|
|
}
|
|
|
|
|
|
function proAnim(callback) {
|
|
function proAnim(callback) {
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.5 });
|
|
var anim = new TimelineMax({ onComplete: callback, delay: 0.5 });
|
|
anim.to(exportRoot.pro.proImg, 0.5, { rotation: "-=25", ease: Power0.easeIn })
|
|
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;
|
|
return anim;
|
|
}
|
|
}
|
|
function oilIconAnim() {
|
|
function oilIconAnim() {
|
|
oilAnim();
|
|
oilAnim();
|
|
- var video = "" , noice = "";
|
|
|
|
|
|
+ var video = "" , noice = "" , soup = "";
|
|
if(dishIndex == 0){
|
|
if(dishIndex == 0){
|
|
noice = createjs.Sound.play("hsr");//播放
|
|
noice = createjs.Sound.play("hsr");//播放
|
|
- video = createjs.Sound.play("oil");//播放
|
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ video = createjs.Sound.play("oil");//播放
|
|
|
|
+ }, 1000);
|
|
}else if(dishIndex == 1){
|
|
}else if(dishIndex == 1){
|
|
noice = createjs.Sound.play("qcdf");//播放
|
|
noice = createjs.Sound.play("qcdf");//播放
|
|
- video = createjs.Sound.play("soup");//播放
|
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ soup = createjs.Sound.play("soup");//播放
|
|
|
|
+ }, 2000);
|
|
}else if(dishIndex == 2){
|
|
}else if(dishIndex == 2){
|
|
noice = createjs.Sound.play("swy");//播放
|
|
noice = createjs.Sound.play("swy");//播放
|
|
}else{
|
|
}else{
|
|
noice = createjs.Sound.play("ymc");//播放
|
|
noice = createjs.Sound.play("ymc");//播放
|
|
- video = createjs.Sound.play("oil");//播放
|
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ video = createjs.Sound.play("oil");//播放
|
|
|
|
+ }, 3000);
|
|
}
|
|
}
|
|
noice.volume = 1;
|
|
noice.volume = 1;
|
|
video.volume = 0.2;
|
|
video.volume = 0.2;
|
|
- setTimeout(function(){ video.paused = true; }, 4500);
|
|
|
|
|
|
+ soup.volume = 0.8;
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ video.paused = true;
|
|
|
|
+ soup.paused = true;
|
|
|
|
+ }, 4500);
|
|
|
|
|
|
var anim = new TimelineMax({ repeat:10,delay:1});
|
|
var anim = new TimelineMax({ repeat:10,delay:1});
|
|
anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
|
|
anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
|
|
@@ -234,7 +256,7 @@ function handleComplete(evt, comp) {
|
|
function btnAnim(dom){
|
|
function btnAnim(dom){
|
|
var anim = new TimelineMax({ repeat:-1 });
|
|
var anim = new TimelineMax({ repeat:-1 });
|
|
anim.to(dom, 0.3, { scale: "+=0.1", ease: Power0.easeIn })
|
|
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;
|
|
return anim;
|
|
}
|
|
}
|
|
function fadeInAnim(dom){
|
|
function fadeInAnim(dom){
|
|
@@ -317,12 +339,12 @@ function handleComplete(evt, comp) {
|
|
]
|
|
]
|
|
// 红烧肉的位置
|
|
// 红烧肉的位置
|
|
var hsr_iconArr = [{
|
|
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,
|
|
x: exportRoot.plate.x + exportRoot.plate.hsr_icon2.x,
|
|
y: exportRoot.plate.y + exportRoot.plate.hsr_icon2.y,
|
|
y: exportRoot.plate.y + exportRoot.plate.hsr_icon2.y,
|
|
@@ -347,12 +369,12 @@ function handleComplete(evt, comp) {
|
|
];
|
|
];
|
|
// 青菜豆腐的位置
|
|
// 青菜豆腐的位置
|
|
var qcdf_iconArr = [{
|
|
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,
|
|
x: exportRoot.plate.x + exportRoot.plate.qcdf_icon2.x,
|
|
y: exportRoot.plate.y + exportRoot.plate.qcdf_icon2.y,
|
|
y: exportRoot.plate.y + exportRoot.plate.qcdf_icon2.y,
|
|
@@ -730,7 +752,7 @@ function handleComplete(evt, comp) {
|
|
var x, y, z, last_x = 0,
|
|
var x, y, z, last_x = 0,
|
|
last_y = 0,
|
|
last_y = 0,
|
|
last_z = 0;
|
|
last_z = 0;
|
|
- var createTime = false;
|
|
|
|
|
|
+ var createTime = false;
|
|
|
|
|
|
function deviceMotionHandler(eventData) {
|
|
function deviceMotionHandler(eventData) {
|
|
var acceleration = eventData.accelerationIncludingGravity;
|
|
var acceleration = eventData.accelerationIncludingGravity;
|
|
@@ -744,10 +766,10 @@ function handleComplete(evt, comp) {
|
|
var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
|
|
var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
|
|
if (speed > SHAKE_THRESHOLD) {
|
|
if (speed > SHAKE_THRESHOLD) {
|
|
if(!createTime) {
|
|
if(!createTime) {
|
|
- createTime = true;
|
|
|
|
- var video = createjs.Sound.play("shake");//播放
|
|
|
|
- setTimeout(function(){ video.paused = true;createTime = false; }, 2500);
|
|
|
|
- }
|
|
|
|
|
|
+ createTime = true;
|
|
|
|
+ var video = createjs.Sound.play("shake");//播放
|
|
|
|
+ setTimeout(function(){ video.paused = true;createTime = false; }, 2500);
|
|
|
|
+ }
|
|
$(".shake-mode2").hide();
|
|
$(".shake-mode2").hide();
|
|
$(".shake-mode").show();
|
|
$(".shake-mode").show();
|
|
shake_cnt++;
|
|
shake_cnt++;
|
|
@@ -766,7 +788,7 @@ function handleComplete(evt, comp) {
|
|
if(document.location.href.indexOf('type') == -1){
|
|
if(document.location.href.indexOf('type') == -1){
|
|
var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
|
|
var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
|
|
history.pushState("", "Title", href);
|
|
history.pushState("", "Title", href);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
if(dishIndex == 0){
|
|
if(dishIndex == 0){
|
|
exportRoot.pot.hsr.gotoAndStop(3);
|
|
exportRoot.pot.hsr.gotoAndStop(3);
|
|
@@ -813,7 +835,7 @@ function getInfo() {
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
var isMobile = false;
|
|
var isMobile = false;
|
|
if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
|
|
if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
|
|
- isMobile = true;
|
|
|
|
|
|
+ isMobile = true;
|
|
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
type = 0;
|
|
type = 0;
|
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
|
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
|
|
@@ -901,7 +923,7 @@ function getInfo() {
|
|
|
|
|
|
init();
|
|
init();
|
|
if (isMobile && !window.ifDebug) {
|
|
if (isMobile && !window.ifDebug) {
|
|
- getMsg();
|
|
|
|
|
|
+ getMsg();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -988,7 +1010,6 @@ function getMsg(){
|
|
}
|
|
}
|
|
|
|
|
|
function saveText() {
|
|
function saveText() {
|
|
- var originUrl = location.href;
|
|
|
|
var value = $('#textInput').val(),
|
|
var value = $('#textInput').val(),
|
|
receiver = $('#nameInput').val();
|
|
receiver = $('#nameInput').val();
|
|
|
|
|
|
@@ -1031,10 +1052,9 @@ function saveText() {
|
|
if(href != document.location.href){
|
|
if(href != document.location.href){
|
|
history.pushState("", "Title", href);
|
|
history.pushState("", "Title", href);
|
|
}
|
|
}
|
|
- var shareUrl = location.href;
|
|
|
|
|
|
|
|
//海报页面的微信分享
|
|
//海报页面的微信分享
|
|
- shareWeixin(shareUrl, originUrl, msg.data.message);
|
|
|
|
|
|
+ shareWeixin(msg.data.message);
|
|
}else{
|
|
}else{
|
|
console.log("错误"+xhr.status)
|
|
console.log("错误"+xhr.status)
|
|
}
|
|
}
|