feat: use AprilTag instead of QR code
This commit is contained in:
@@ -66,6 +66,22 @@ window.addEventListener("phx:download_file", (event) => {
|
||||
window.URL.revokeObjectURL(url)
|
||||
})
|
||||
|
||||
// Add AprilTag download functionality
|
||||
window.addEventListener("phx:download_apriltag", (event) => {
|
||||
const { filename, url } = event.detail
|
||||
|
||||
// Create download link using the static file URL
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = filename
|
||||
link.setAttribute('target', '_blank') // Open in new tab as fallback
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
|
||||
// Clean up
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
|
||||
// expose liveSocket on window for web console debug logs and latency simulation:
|
||||
// >> liveSocket.enableDebug()
|
||||
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
|
||||
|
||||
Reference in New Issue
Block a user