timer
This commit is contained in:
parent
d4d205ab46
commit
885a7fbf61
|
@ -83,6 +83,7 @@ const setControls = () => {
|
|||
|
||||
const d = targetDistance.max * 0.5
|
||||
camera.value?.position.set(d, d, d);
|
||||
camera.value?.updateMatrixWorld();
|
||||
(controls.value as any).target = new Vector3(0, 0, 0);
|
||||
(controls.value as any).autoRotate = false;
|
||||
|
||||
|
@ -234,12 +235,9 @@ const loadModels = async () => {
|
|||
const gotoCenterAndDistance = () => {
|
||||
targetDistance.min = mobileAndTabletCheck() ? raw_dataStore.data.min_distance * 0.5 : raw_dataStore.data.min_distance;
|
||||
targetDistance.max = raw_dataStore.data.max_distance;
|
||||
const d = raw_dataStore.data.max_distance * 0.5
|
||||
set_moveto(smooth_target, new Vector3(0, 0, 0))
|
||||
set_moveto(smooth_move, new Vector3(
|
||||
raw_dataStore.data.max_distance * 0.5,
|
||||
raw_dataStore.data.max_distance * 0.5,
|
||||
raw_dataStore.data.max_distance * 0.5
|
||||
))
|
||||
set_moveto(smooth_move, new Vector3(d, d, d))
|
||||
}
|
||||
|
||||
watch(() => props.source, () => {
|
||||
|
@ -377,7 +375,6 @@ timer.timer_func = () => {
|
|||
(controls.value as any).autoRotate = true;
|
||||
(controls.value as any).autoRotateSpeed = 0.5;
|
||||
|
||||
timer.startTimer()
|
||||
home_timer.startTimer()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,14 +19,16 @@ export const useTimer = defineStore('timer', {
|
|||
actions: {
|
||||
startTimer() {
|
||||
this.is_enabled = true
|
||||
clearInterval(this.timer_el)
|
||||
this.resetTimer()
|
||||
this.timer_el = this.countdownTimer()
|
||||
},
|
||||
stopTimer() {
|
||||
this.is_enabled = false
|
||||
clearInterval(this.timer_el)
|
||||
|
||||
if (this.timer_func) {
|
||||
this.timer_func()
|
||||
this.startTimer()
|
||||
}
|
||||
},
|
||||
resetTimer() {
|
||||
|
|
|
@ -18,14 +18,15 @@ export const useTimerHome = defineStore('timer_home', {
|
|||
actions: {
|
||||
startTimer() {
|
||||
this.is_enabled = true
|
||||
clearInterval(this.timer_el)
|
||||
this.resetTimer()
|
||||
this.timer_el = this.countdownTimer()
|
||||
},
|
||||
stopTimer() {
|
||||
this.is_enabled = false
|
||||
clearInterval(this.timer_el)
|
||||
if (this.timer_func) {
|
||||
this.timer_func()
|
||||
this.startTimer()
|
||||
}
|
||||
},
|
||||
resetTimer() {
|
||||
|
|
Loading…
Reference in New Issue