Make qr code a vcard link

This commit is contained in:
Ian Gulliver
2024-11-22 22:43:54 -08:00
parent 8138b47738
commit 859a463915

View File

@@ -195,9 +195,11 @@ async function page() {
</div> </div>
<div class="contact" style="margin-top: 15px; justify-content: center;"> <div class="contact" style="margin-top: 15px; justify-content: center;">
<sl-qr-code id="qr" background="#242428" fill="white" size="300"></sl-qr-code> <a id="qr-a">
<sl-qr-code id="qr" background="#242428" fill="white" size="300"></sl-qr-code>
</a>
<script> <script>
document.getElementById('qr').value = ` const qr = `
BEGIN:VCARD BEGIN:VCARD
VERSION:4.0 VERSION:4.0
@@ -230,6 +232,8 @@ URL:mailto:{{.CONTACT_PAGE_EMAIL}}
END:VCARD END:VCARD
`; `;
document.getElementById('qr').value = qr;
document.getElementById('qr-a').href = URL.createObjectURL(new Blob([qr], { type: 'text/vcard' }));
</script> </script>
</div> </div>
</sl-card> </sl-card>