+25
-3
@@ -44,7 +44,12 @@ function handleApply(payload) {
|
||||
// payload: { dataUrl, transform }
|
||||
const { dataUrl, transform } = payload
|
||||
if (editorIndex.value >= 0) {
|
||||
const original = (store.photos[editorIndex.value] && (store.photos[editorIndex.value].src || store.photos[editorIndex.value])) || (previewPhotos.value[editorIndex.value] && (previewPhotos.value[editorIndex.value].src || previewPhotos.value[editorIndex.value])) || null
|
||||
const original =
|
||||
(store.photos[editorIndex.value] &&
|
||||
(store.photos[editorIndex.value].src || store.photos[editorIndex.value])) ||
|
||||
(previewPhotos.value[editorIndex.value] &&
|
||||
(previewPhotos.value[editorIndex.value].src || previewPhotos.value[editorIndex.value])) ||
|
||||
null
|
||||
const obj = { src: original, preview: dataUrl, transform }
|
||||
previewPhotos.value[editorIndex.value] = obj
|
||||
// persist to store as well
|
||||
@@ -84,7 +89,19 @@ function handleApply(payload) {
|
||||
<ThemeSelector />
|
||||
<RouterLink class="primary" to="/result">Generate strip</RouterLink>
|
||||
</section>
|
||||
<ImageEditor v-if="editorIndex >= 0" :src="(store.photos[editorIndex] && (store.photos[editorIndex].src || store.photos[editorIndex])) || previewPhotos[editorIndex]" :initialTransform="(store.photos[editorIndex] && store.photos[editorIndex].transform) || null" :outputWidth="440" :outputHeight="290" @cancel="handleCancel" @apply="handleApply" />
|
||||
<ImageEditor
|
||||
v-if="editorIndex >= 0"
|
||||
:src="
|
||||
(store.photos[editorIndex] &&
|
||||
(store.photos[editorIndex].src || store.photos[editorIndex])) ||
|
||||
previewPhotos[editorIndex]
|
||||
"
|
||||
:initialTransform="(store.photos[editorIndex] && store.photos[editorIndex].transform) || null"
|
||||
:outputWidth="440"
|
||||
:outputHeight="290"
|
||||
@cancel="handleCancel"
|
||||
@apply="handleApply"
|
||||
/>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -129,7 +146,12 @@ function handleApply(payload) {
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.edit-thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px }
|
||||
.edit-thumb img {
|
||||
width: 84px;
|
||||
height: 64px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.options-panel {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user