remove scenes

main
km0 2 years ago
parent 5ad8db6efb
commit 3456371e39

@ -20,9 +20,12 @@
</div> </div>
<SceneEntry
v-for="(scene, index) in scenes"
<SceneEntry v-for="scene in scenes" :title="scene.title" :series="scene.series"/> :title="scene.title"
:series="scene.series"
@remove="remove(index)"
/>
</main> </main>
</template> </template>
@ -45,6 +48,10 @@ const add = () => {
title.value = "" title.value = ""
} }
const remove = (index) => {
scenes.value.splice(index, 1)
}
const load = (e) => { const load = (e) => {
let files = e.target.files let files = e.target.files
files.forEach((file) =>{ files.forEach((file) =>{

@ -1,7 +1,10 @@
<template> <template>
<section class="scene"> <section class="scene">
<div class="header">
<h2>{{title}}</h2> <h2>{{title}}</h2>
<button class="remove" @click="removeScene">remove</button>
</div>
<draggable <draggable
tag="transition-group" tag="transition-group"
@ -61,6 +64,8 @@ const props = defineProps({
series: Array series: Array
}) })
const emit = defineEmits(['remove'])
const shots = ref(props.series || []) const shots = ref(props.series || [])
const drag = ref(false) const drag = ref(false)
@ -82,6 +87,10 @@ const remove = (index) => {
shots.value.splice(index, 1) shots.value.splice(index, 1)
} }
const removeScene = () => {
emit('remove')
}
const serialize = async () => { const serialize = async () => {
let series = await Promise.all(shots.value.map(async (shot) => { let series = await Promise.all(shots.value.map(async (shot) => {
@ -113,6 +122,8 @@ const serialize = async () => {
gap: 16px; gap: 16px;
} }
.ghost { .ghost {
opacity: 0.5; opacity: 0.5;
} }
@ -121,8 +132,28 @@ const serialize = async () => {
margin-block: 32px; margin-block: 32px;
} }
.scene h2 { .header {
margin-block: 32px; margin-block: 32px;
display: flex;
gap: 8px;
}
.header h2 {
margin: 0;
}
.header .remove {
position: relative;
color: currentColor;
opacity: 0.5;
font-size: 0.8rem;
}
.header .remove:hover {
opacity: 1;
background: none;
color: currentColor;
} }
@media print { @media print {

Loading…
Cancel
Save