bx-1379-redesign #15

Merged
ksenia_mikhailova merged 124 commits from bx-1379-redesign into dev 2024-09-06 15:39:13 +03:00
3 changed files with 8 additions and 8 deletions
Showing only changes of commit 885a7fbf61 - Show all commits

View File

@ -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()
} }
} }

View File

@ -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() {

View File

@ -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() {