feat: fullscreen image lightbox on image/diagram click
All checks were successful
CI / verify (push) Successful in 2m2s
All checks were successful
CI / verify (push) Successful in 2m2s
Click a note image or a mermaid/tikz diagram to view it fullscreen over a blurred dim backdrop, with a fade/scale animation and rounded white frame. Works on desktop and mobile; diagram SVGs are serialized to a data URL via svgToDataUrl. Closes on click or Escape.
This commit is contained in:
19
src/hooks/useImageLightbox.hook.ts
Normal file
19
src/hooks/useImageLightbox.hook.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ref } from "vue"
|
||||
|
||||
const isOpen = ref(false)
|
||||
const src = ref("")
|
||||
const alt = ref("")
|
||||
|
||||
export const useImageLightbox = () => {
|
||||
const open = (imageSrc: string, imageAlt = "") => {
|
||||
src.value = imageSrc
|
||||
alt.value = imageAlt
|
||||
isOpen.value = true
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
isOpen.value = false
|
||||
}
|
||||
|
||||
return { isOpen, src, alt, open, close }
|
||||
}
|
||||
Reference in New Issue
Block a user