From cf1b06b5c9c6e10659306fcb495fda2768e4321f Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 25 Mar 2026 09:52:22 +0100 Subject: [PATCH] feat: Monero coin favicon with paid indicator - Official Monero coin logo as SVG favicon - Dynamic green dot badge on favicon when invoice is paid - Paid status shown both in page content and browser tab --- app.js | 40 ++++++++++++++++++++++++++++++++++++---- favicon.svg | 4 ++++ index.html | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 favicon.svg diff --git a/app.js b/app.js index 32c4f50..dd44b51 100644 --- a/app.js +++ b/app.js @@ -550,6 +550,7 @@ }) }); } + showPaidStatus({ amount: xmrAmount, tx_hash: txHash }); } else { proofResult.className = 'proof-result active error'; proofResult.textContent = I18n.t('proof_no_match'); @@ -567,12 +568,43 @@ .then(function (res) { return res.json(); }) .then(function (data) { if (data.verified) { - paymentStatus.className = 'payment-status paid'; - paymentStatus.innerHTML = ''; + showPaidStatus(data); } }) .catch(function () {}); } + + function showPaidStatus(data) { + paymentStatus.className = 'payment-status paid'; + paymentStatus.innerHTML = ''; + setPaidFavicon(); + } + + function setPaidFavicon() { + var canvas = document.createElement('canvas'); + canvas.width = 32; + canvas.height = 32; + var ctx = canvas.getContext('2d'); + + // Draw Monero logo + var img = new Image(); + img.onload = function () { + ctx.drawImage(img, 0, 0, 32, 32); + // Green dot (bottom-right) + ctx.beginPath(); + ctx.arc(25, 25, 7, 0, Math.PI * 2); + ctx.fillStyle = '#fff'; + ctx.fill(); + ctx.beginPath(); + ctx.arc(25, 25, 5.5, 0, Math.PI * 2); + ctx.fillStyle = '#4caf50'; + ctx.fill(); + // Set favicon + var link = document.getElementById('favicon'); + link.href = canvas.toDataURL('image/png'); + }; + img.src = 'favicon.svg'; + } })(); diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..8818c18 --- /dev/null +++ b/favicon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/index.html b/index.html index 42b5b15..bf2ee66 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ xmrpay.link — Monero Invoice Generator - +