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:
@@ -101,6 +101,9 @@ const buildExportableSvgString = (svg: SVGSVGElement): string => {
|
||||
return new XMLSerializer().serializeToString(clone)
|
||||
}
|
||||
|
||||
export const svgToDataUrl = (svg: SVGSVGElement): string =>
|
||||
`data:image/svg+xml;charset=utf-8,${encodeURIComponent(buildExportableSvgString(svg))}`
|
||||
|
||||
const triggerBlobDownload = (blob: Blob, filename: string): void => {
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement("a")
|
||||
|
||||
Reference in New Issue
Block a user