landings: QR center logo as PNG for Android (full Taler wordmark)

Android WebView often failed the official Penpot SVG: root fill=none
and wordmark paths only inherited black from a parent <g>, so the blue
T showed without the "taler" letters. Serve taler-assets qr-logo.png,
keep fixed SVG as fallback, explicit logo size/alt.
This commit is contained in:
Hernâni Marques 2026-07-10 22:12:00 +02:00
parent 6e808c2ab1
commit 96c37cae3c
No known key found for this signature in database
9 changed files with 46 additions and 15 deletions

View file

@ -1437,18 +1437,33 @@ tw balance</pre>
var WITHDRAW_EXCHANGE = "taler://withdraw-exchange/exchange.hacktivism.ch/";
/* QR_Taler: off-DOM encode → PNG img + center logo (same as shop-pay / merchant) */
/* Prefer PNG: Android WebView often fails the official Penpot SVG
(root fill="none" + wordmark paths inherit black from a parent <g>
→ blue T only, missing "taler"). PNG matches taler-assets qr-logo.png. */
function logoSrc() {
try {
var b = document.querySelector("base");
if (b && b.href) return new URL("qr-logo.svg", b.href).href;
if (b && b.href) return new URL("qr-logo.png", b.href).href;
} catch (e) {}
return "/intro/qr-logo.svg";
return "/intro/qr-logo.png";
}
function setQrLogo(imgEl) {
if (!imgEl) return;
imgEl.alt = "Taler";
imgEl.width = 100;
imgEl.height = 50;
imgEl.decoding = "async";
imgEl.src = logoSrc();
imgEl.onerror = function () {
imgEl.style.display = "none";
/* fallback to fixed SVG if PNG missing */
try {
var b = document.querySelector("base");
imgEl.src = b && b.href
? new URL("qr-logo.svg", b.href).href
: "/intro/qr-logo.svg";
} catch (e2) {
imgEl.style.display = "none";
}
};
imgEl.style.display = "";
}