|
@@ -526,6 +526,8 @@ function handleComplete(evt, comp) {
|
|
|
|
|
|
|
|
|
function shakeInit() {
|
|
|
+ var shake_cnt = 0;
|
|
|
+ $(".shake-mode2").show();
|
|
|
if (window.DeviceMotionEvent) {
|
|
|
window.addEventListener('devicemotion', deviceMotionHandler, false);
|
|
|
} else {
|
|
@@ -553,30 +555,36 @@ function handleComplete(evt, comp) {
|
|
|
var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
|
|
|
if (speed > SHAKE_THRESHOLD) {
|
|
|
$(".shake-mode").show();
|
|
|
- setTimeout(function(){
|
|
|
- window.removeEventListener('devicemotion', deviceMotionHandler, false);
|
|
|
- exportRoot.pot.hsr.play();
|
|
|
- exportRoot.btn3.alpha = 1;
|
|
|
- btnAnim(exportRoot.btn3);
|
|
|
- exportRoot.btn3.addEventListener("mousedown",function(){
|
|
|
+ $(".shake-mode2").hide();
|
|
|
+ shake_cnt++;
|
|
|
+ if(shake_cnt>2){
|
|
|
+ setTimeout(function(){
|
|
|
+ window.removeEventListener('devicemotion', deviceMotionHandler, false);
|
|
|
+ exportRoot.pot.hsr.play();
|
|
|
+ // exportRoot.btn3.alpha = 1;
|
|
|
+ // btnAnim(exportRoot.btn3);
|
|
|
+ // exportRoot.btn3.addEventListener("mousedown",function(){
|
|
|
+ // exportRoot.btn3.removeAllEventListeners();
|
|
|
+ // $(".poster-mode").fadeIn();
|
|
|
+ // })
|
|
|
+
|
|
|
+
|
|
|
+ if(dishIndex == 0){
|
|
|
+ exportRoot.pot.hsr.gotoAndStop(1);
|
|
|
+ }else if(dishIndex == 1){
|
|
|
+ exportRoot.pot.qcdf.gotoAndStop(1);
|
|
|
+ }else if(dishIndex == 2){
|
|
|
+ exportRoot.bowl.oil.alpha = 0;
|
|
|
+ exportRoot.plate['swy_icon1'].gotoAndStop(2);
|
|
|
+ }else{
|
|
|
+ exportRoot.pot.ymc.gotoAndStop(1);
|
|
|
+ }
|
|
|
+ $(".shake-mode").fadeOut();
|
|
|
exportRoot.btn3.removeAllEventListeners();
|
|
|
$(".poster-mode").fadeIn();
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- if(dishIndex == 0){
|
|
|
- exportRoot.pot.hsr.gotoAndStop(1);
|
|
|
- }else if(dishIndex == 1){
|
|
|
- exportRoot.pot.qcdf.gotoAndStop(1);
|
|
|
- }else if(dishIndex == 2){
|
|
|
- exportRoot.bowl.oil.alpha = 0;
|
|
|
- exportRoot.plate['swy_icon1'].gotoAndStop(2);
|
|
|
- }else{
|
|
|
- exportRoot.pot.ymc.gotoAndStop(1);
|
|
|
- }
|
|
|
- $(".shake-mode").fadeOut();
|
|
|
- },3000)
|
|
|
+ },3000)
|
|
|
|
|
|
+ }
|
|
|
//dosomething
|
|
|
$("#fire").addClass("anim-time");
|
|
|
}else{
|