diff --git a/src/components/NoteCard.tsx b/src/components/NoteCard.tsx index 7979d98..bd22e71 100644 --- a/src/components/NoteCard.tsx +++ b/src/components/NoteCard.tsx @@ -30,6 +30,7 @@ export function NoteCard({ key: itemKey, data: item }: NoteCard.NoteCardProps) { function updateLocalStorage(time?: number) { debounce(() => { localStorage.setItem("notes", JSON.stringify(notes.notes.value)) + saved.value = true }, time) } @@ -93,37 +94,47 @@ export function NoteCard({ key: itemKey, data: item }: NoteCard.NoteCardProps) { NotesSigal.default.updateNoteProperty(itemKey, 'contents', e.content) NotesSigal.default.notes.notify() updateLocalStorage() + saved.value = false + } + + function _handleClose(_e: Event) { + NotesSigal.default.removeNote(item.id) + NotesSigal.default.notes.notify() + updateLocalStorage() + } + + function _handleFocusCard() { + focusedItem.value = itemKey + } + + const cardPositionStyle = { + zIndex: `${focusedItem.value == itemKey ? LayerEnum.CARD_ELEVATED : LayerEnum.CARD}`, + width: `${item.dimensions.w}px`, + height: `${item.dimensions.h}px`, + top: `${item.position.y}px`, + left: `${item.position.x}px`, + } + + const saveIndicatorStyle = { + opacity: saved.value ? '0' : '100' } return (