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