|
|
@ -1,5 +1,6 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="shot">
|
|
|
|
<div class="shot">
|
|
|
|
|
|
|
|
<span class="tag" :style='{color: shotColor}'></span>
|
|
|
|
<button class="remove" @click="emit('remove')">x</button>
|
|
|
|
<button class="remove" @click="emit('remove')">x</button>
|
|
|
|
<img :src="img">
|
|
|
|
<img :src="img">
|
|
|
|
<div class="meta" v-if="!edit" @dblclick="edit=true">
|
|
|
|
<div class="meta" v-if="!edit" @dblclick="edit=true">
|
|
|
@ -7,9 +8,12 @@
|
|
|
|
<h3 class="title" >{{title}}</h3>
|
|
|
|
<h3 class="title" >{{title}}</h3>
|
|
|
|
<p class="description">{{description}}</p>
|
|
|
|
<p class="description">{{description}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form class="meta" v-else>
|
|
|
|
<form class="meta edit" v-else>
|
|
|
|
<input class="title" v-model="shotTitle">
|
|
|
|
<input class="title" v-model="shotTitle">
|
|
|
|
<textarea class="description" v-model="shotDescription"></textarea>
|
|
|
|
<textarea class="description" v-model="shotDescription"></textarea>
|
|
|
|
|
|
|
|
<div class="colors">
|
|
|
|
|
|
|
|
<span class="color" @click="setColor(c)" v-for='c in colors' :style="{color: c}"></span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<button @click.prevent="update">Confirm</button>
|
|
|
|
<button @click.prevent="update">Confirm</button>
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -18,20 +22,29 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
|
|
|
|
|
|
|
|
import {ref } from 'vue'
|
|
|
|
import {ref, watch } from 'vue'
|
|
|
|
|
|
|
|
import {palette} from '../composables/palette.js'
|
|
|
|
|
|
|
|
const {colors} = palette()
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps(['title', 'description', 'img', 'order'])
|
|
|
|
const props = defineProps(['title', 'description', 'img', 'order', 'color'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(props, ()=>{
|
|
|
|
|
|
|
|
shotColor.value = props.color
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const shotTitle = ref(props.title)
|
|
|
|
const shotTitle = ref(props.title)
|
|
|
|
const shotDescription = ref(props.description)
|
|
|
|
const shotDescription = ref(props.description)
|
|
|
|
|
|
|
|
const shotColor = ref(props.color || colors[0])
|
|
|
|
const emit = defineEmits(['remove', 'update'])
|
|
|
|
const emit = defineEmits(['remove', 'update'])
|
|
|
|
|
|
|
|
|
|
|
|
const edit = ref(false)
|
|
|
|
const edit = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const setColor = (c) => {
|
|
|
|
|
|
|
|
shotColor.value = c
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const update = () => {
|
|
|
|
const update = () => {
|
|
|
|
emit('update', {title: shotTitle.value, description: shotDescription.value, order: props.order})
|
|
|
|
emit('update', {title: shotTitle.value, description: shotDescription.value, order: props.order, color: shotColor.value})
|
|
|
|
edit.value = false
|
|
|
|
edit.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -42,12 +55,17 @@
|
|
|
|
.shot {
|
|
|
|
.shot {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.shot img {
|
|
|
|
.shot img {
|
|
|
|
width: 320px;
|
|
|
|
width: 320px;
|
|
|
|
height: 180px;
|
|
|
|
height: 180px;
|
|
|
|
object-fit: cover;
|
|
|
|
object-fit: cover;
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
z-index: 10;
|
|
|
|
|
|
|
|
padding: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.shot .meta {
|
|
|
|
.shot .meta {
|
|
|
@ -56,6 +74,30 @@
|
|
|
|
gap: 0;
|
|
|
|
gap: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.shot .tag {
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
background-color: currentColor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.colors {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
height: 16px;
|
|
|
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.color {
|
|
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
background-color: currentColor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.colors .color {
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.title, .description{
|
|
|
|
.title, .description{
|
|
|
|
margin-block: 0;
|
|
|
|
margin-block: 0;
|
|
|
|
margin-inline: 8px;
|
|
|
|
margin-inline: 8px;
|
|
|
@ -66,6 +108,21 @@
|
|
|
|
padding-right: 1rem;
|
|
|
|
padding-right: 1rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.meta.edit input,
|
|
|
|
|
|
|
|
.meta.edit textarea,
|
|
|
|
|
|
|
|
.meta.edit button {
|
|
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.meta.edit {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
|
|
padding: 8px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.description {
|
|
|
|
.description {
|
|
|
|
font-size: 0.85rem;
|
|
|
|
font-size: 0.85rem;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
margin-bottom: 8px;
|
|
|
@ -76,7 +133,6 @@
|
|
|
|
top: 0;
|
|
|
|
top: 0;
|
|
|
|
right: 4px ;
|
|
|
|
right: 4px ;
|
|
|
|
display: inline-block;
|
|
|
|
display: inline-block;
|
|
|
|
background-color: white;
|
|
|
|
|
|
|
|
z-index: 100;
|
|
|
|
z-index: 100;
|
|
|
|
padding: 4px;
|
|
|
|
padding: 4px;
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
@ -95,6 +151,7 @@
|
|
|
|
font-size: 1rem;
|
|
|
|
font-size: 1rem;
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
z-index: 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.shot:hover .remove {
|
|
|
|
.shot:hover .remove {
|
|
|
|