|
@@ -130,6 +130,24 @@
|
|
|
</el-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
+<style>
|
|
|
+.as {
|
|
|
+ animation: myfirst 1s linear infinite;
|
|
|
+}
|
|
|
+
|
|
|
+.asn {
|
|
|
+ transform: rotate(0deg);
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes myfirst {
|
|
|
+ 0% {
|
|
|
+ transform: rotate(0deg);
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ transform: rotate(360deg);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<script>
|
|
|
//import tracking from "@/assets/js/tracking-min.js";
|
|
|
//import "@/assets/js/face-min.js";
|
|
@@ -224,11 +242,19 @@ export default {
|
|
|
this.isZuan = true;
|
|
|
this.isCamera = true;
|
|
|
let video = this.$refs["video"];
|
|
|
- setInterval(() => {
|
|
|
- this.handsFind(video);
|
|
|
+ let that = this
|
|
|
+ var f = window.requestAnimationFrame(function () {
|
|
|
+ window.cancelAnimationFrame(f);
|
|
|
+ setTimeout(function () {
|
|
|
+ that.handsFind(video);
|
|
|
+ that.start();
|
|
|
+ }, 3000);
|
|
|
+ });
|
|
|
+ // setInterval(() => {
|
|
|
+ // this.handsFind(video);
|
|
|
|
|
|
- // window.requestAnimationFrame(this.start);
|
|
|
- }, 1000);
|
|
|
+ // // window.requestAnimationFrame(this.start);
|
|
|
+ // }, 1000);
|
|
|
},
|
|
|
zhuan(num) {
|
|
|
var _fan = this.$refs.fan;
|
|
@@ -308,40 +334,55 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.hand = 1;
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.timer = null;
|
|
|
- this.zhuan(buNum);
|
|
|
+
|
|
|
+ if (buNum) {
|
|
|
+ this.$refs.fan.style = `animation: myfirst ${50/buNum}s linear infinite`;
|
|
|
} else {
|
|
|
- this.zhuan(buNum);
|
|
|
+ this.$refs.fan.style = "";
|
|
|
}
|
|
|
+ // if (this.timer) {
|
|
|
+ // clearInterval(this.timer);
|
|
|
+ // this.timer = null;
|
|
|
+ // this.zhuan(buNum);
|
|
|
+ // } else {
|
|
|
+ // this.zhuan(buNum);
|
|
|
+ // }
|
|
|
} else if (_58y < 1 && _912y < 1 && _1316y < 1 && _1720y < 1) {
|
|
|
console.log("石头");
|
|
|
if (this.hand == 2) {
|
|
|
return;
|
|
|
}
|
|
|
this.hand = 2;
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.timer = null;
|
|
|
- this.zhuan(sNum);
|
|
|
+ if (sNum) {
|
|
|
+ this.$refs.fan.style = `animation: myfirst ${50/sNum}s linear infinite`;
|
|
|
} else {
|
|
|
- this.zhuan(sNum);
|
|
|
+ this.$refs.fan.style = "";
|
|
|
}
|
|
|
+ // if (this.timer) {
|
|
|
+ // clearInterval(this.timer);
|
|
|
+ // this.timer = null;
|
|
|
+ // this.zhuan(sNum);
|
|
|
+ // } else {
|
|
|
+ // this.zhuan(sNum);
|
|
|
+ // }
|
|
|
} else if (_58y > 1 && _912y > 1 && _1316y < 1 && _1720y < 1) {
|
|
|
console.log("剪刀");
|
|
|
if (this.hand == 3) {
|
|
|
return;
|
|
|
}
|
|
|
this.hand = 3;
|
|
|
-
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.timer = null;
|
|
|
- this.zhuan(jNum);
|
|
|
+ if (jNum) {
|
|
|
+ this.$refs.fan.style = `animation: myfirst ${50/jNum}s linear infinite`;
|
|
|
} else {
|
|
|
- this.zhuan(jNum);
|
|
|
+ this.$refs.fan.style = "";
|
|
|
}
|
|
|
+ // if (this.timer) {
|
|
|
+ // clearInterval(this.timer);
|
|
|
+ // this.timer = null;
|
|
|
+ // this.zhuan(jNum);
|
|
|
+ // } else {
|
|
|
+ // this.zhuan(jNum);
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -409,6 +450,7 @@ export default {
|
|
|
|
|
|
this.isZuan = false;
|
|
|
clearInterval(this.timer);
|
|
|
+ this.$refs.fan.style = ""
|
|
|
this.timer = null;
|
|
|
this.hand = 0;
|
|
|
},
|