update: note card UI

main
TZGyn 3 years ago
parent e48045ae23
commit 3ff810e9b5

@ -1,11 +1,20 @@
<template> <template>
<div <div
class="bg-secondary flex w-96 cursor-pointer flex-col gap-4 rounded-lg p-4" class="bg-secondary group/note flex w-full cursor-pointer flex-col gap-4 p-2"
@click="noteDetail(props.uuid)"> v-auto-animate
@click="toggleDetail()">
<div class="flex items-center">
<div class="w-full text-center text-2xl font-bold"> <div class="w-full text-center text-2xl font-bold">
{{ props.title }} {{ props.title }}
</div> </div>
<div>
<ElementButton @click.stop="toggleOptions()">
<Icon
class="invisible group-hover/note:visible"
name="fa6-solid:ellipsis-vertical" />
</ElementButton>
</div>
<div v-if="showDetail">
{{ props.description }} {{ props.description }}
</div> </div>
</div> </div>
@ -20,9 +29,18 @@
} }
const props = defineProps<Props>(); const props = defineProps<Props>();
const router = useRouter(); const showDetail = ref<boolean>(false);
const showOptions = ref<boolean>(false);
const toggleOptions = () => {
showOptions.value = !showOptions.value;
};
const toggleDetail = () => {
showDetail.value = !showDetail.value;
};
const noteDetail = (id: string | number) => { const noteDetail = (id: string | number) => {
router.push(`/notes/${id}`); navigateTo(`/notes/${id}`);
}; };
</script> </script>

@ -22,10 +22,10 @@
</div> </div>
<div <div
class="mx-12 flex h-full w-full max-w-3xl flex-row justify-center gap-4"> class="mx-12 flex h-full w-full max-w-3xl flex-row justify-center gap-4 p-2">
<div <div
v-if="data" v-if="data"
class="flex flex-col gap-4"> class="flex w-full flex-col gap-4">
<div v-for="note in data.notes"> <div v-for="note in data.notes">
<LazyCardNote <LazyCardNote
:id="note.id" :id="note.id"

Loading…
Cancel
Save