diff --git a/src/components/project/virtual-sample/DynamicView.vue b/src/components/project/virtual-sample/DynamicView.vue index 8918e70..3166b41 100644 --- a/src/components/project/virtual-sample/DynamicView.vue +++ b/src/components/project/virtual-sample/DynamicView.vue @@ -5,31 +5,32 @@ -
- -
- -
+
@@ -45,7 +46,9 @@ const tracks = computed( () => page.value.steps[page.value.steps.length - 1].files.dynamic ); -const activeTrack = ref(tracks.value[0]); +const isCompareModeEnabled = ref(false); + +const activeTracks = ref([tracks.value[0]]); function getFrontViewUrl(track) { if (track.files.length > 1) { @@ -54,6 +57,20 @@ function getFrontViewUrl(track) { return track.files[0].url; } } + +function selectTrack(track) { + if (isCompareModeEnabled.value) { + if (activeTracks.value.includes(track)) { + activeTracks.value = activeTracks.value.filter( + (item) => item.title !== track.title + ); + } else { + activeTracks.value.push(track); + } + } else { + activeTracks.value = [track]; + } +}