diff --git a/src/BubblingGalaxies.vue b/src/BubblingGalaxies.vue index a9ff2fa..550cf78 100644 --- a/src/BubblingGalaxies.vue +++ b/src/BubblingGalaxies.vue @@ -155,19 +155,34 @@ > About - { aboutMode = false; showInfoSheet = !showImageCard; }" + class="label-stack" > - { aboutMode = false; showInfoSheet = !showImageCard; }" /> - + + openGalleryInfo(foregroundGalleryItem)" + /> + openGalleryInfo(backgroundGalleryItem)" + /> + + --> - { aboutMode = false; showInfoSheet = !showImageCard; }" + class="label-stack" > - { aboutMode = false; showInfoSheet = !showImageCard; }" /> - + + openGalleryInfo(foregroundGalleryItem)" + /> + openGalleryInfo(backgroundGalleryItem)" + /> + + {{ simulationTime.toFixed(1) }} million years - + + + + + {{ item.title }} + + + + + + + + + + {{ item.title }} + + + + + + + + + {{ label }} opacity + + + + + + + + diff --git a/src/components/ForegroundBackgroundPicker.vue b/src/components/ForegroundBackgroundPicker.vue new file mode 100644 index 0000000..f2903bc --- /dev/null +++ b/src/components/ForegroundBackgroundPicker.vue @@ -0,0 +1,518 @@ + + + + + Choose Views + + + setOpacity(place, opacity)" + /> + + + + + + + Choose Views + + + + foreground && setOpacity(foreground, opacity)" + /> + background && setOpacity(background, opacity)" + /> + + + + + + + + diff --git a/src/components/Gallery.vue b/src/components/Gallery.vue index 14e5f26..2a27624 100644 --- a/src/components/Gallery.vue +++ b/src/components/Gallery.vue @@ -130,6 +130,8 @@ export interface GalleryProps { defaultStarting?: string | null; /** prevent the gallery from being opened by user interaction */ disabled?: boolean; + /** order layers by selection order */ + useLayerSelectionOrder?: boolean; } @@ -152,6 +154,7 @@ const props = withDefaults(defineProps(), { collapseOnSelect: false, defaultStarting: null, disabled: false, + useLayerSelectionOrder: false, }); const defaultThumbnailUrl = "https://cdn.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=test"; @@ -394,11 +397,38 @@ function setSelectedImagesetVisibility(places: Place[], selectedPlaces: Place[]) } } +function syncSelectedLayerOrder() { + if (!props.useLayerSelectionOrder) return; + if (props.persist !== null) { + const persistedPlace = places.value.find(p => isPersistantLayer(p)); + if (persistedPlace) { + const layer = getImagesetLayerForPlace(persistedPlace); + if (layer) { + store.setImageSetLayerOrder({ + id: layer.id.toString(), + order: 0, + }); + } + } + } + + const topOrder = Object.keys(store.imagesetLayers).length; + selectedPlaces.value.forEach((place, index) => { + const layer = getImagesetLayerForPlace(place); + if (!layer) return; + store.setImageSetLayerOrder({ + id: layer.id.toString(), + order: topOrder + index, + }); + }); +} + function syncSelectedLayerVisibility() { if (props.hideGalleryLayers) return; nextTick(async () => { await setSelectedImagesetVisibility(places.value, selectedPlaces.value); selectedPlaces.value.forEach(applySelectedPlaceOpacity); + syncSelectedLayerOrder(); }); } diff --git a/src/components/GalleryItemSelector.vue b/src/components/GalleryItemSelector.vue new file mode 100644 index 0000000..16f66ba --- /dev/null +++ b/src/components/GalleryItemSelector.vue @@ -0,0 +1,205 @@ + + + + + {{ place ? place.get_name() : `Select ${label}` }} + + + {{ label }} opacity + + + + + + + +