bank landing: Generate own account instead of Get a fresh QR

Primary control creates a personal zero-balance account.
This commit is contained in:
Hernâni Marques 2026-07-10 15:07:00 +02:00
parent 04a07fb540
commit 763e5dc75a
No known key found for this signature in database

View file

@ -435,6 +435,15 @@
border-radius: 10px; border-radius: 10px;
font-weight: 600; font-weight: 600;
font-size: 0.92rem; font-size: 0.92rem;
background: transparent;
font: inherit;
cursor: pointer;
width: 100%;
max-width: 22rem;
box-sizing: border-box;
}
button.cta-sec:hover {
background: rgba(62, 207, 191, 0.1);
} }
.cta-sec.merchant { .cta-sec.merchant {
color: #f0d090; color: #f0d090;
@ -779,8 +788,8 @@
</a> </a>
<p class="meta" id="withdraw-demo-meta">Preparing withdraw…</p> <p class="meta" id="withdraw-demo-meta">Preparing withdraw…</p>
<p class="meta" id="withdraw-demo-amount" hidden></p> <p class="meta" id="withdraw-demo-amount" hidden></p>
<button type="button" class="cta-sec" id="withdraw-demo-refresh" style="margin-top:0.5rem"> <button type="button" class="cta-sec" id="generate-own-account" style="margin-top:0.5rem">
Get a fresh QR Generate own account
</button> </button>
<p class="balance-note" role="note"> <p class="balance-note" role="note">
<strong>Surprising balance?</strong> <strong>Surprising balance?</strong>
@ -1149,10 +1158,18 @@
} }
loadDemoWithdraw(); loadDemoWithdraw();
var refreshBtn = document.getElementById("withdraw-demo-refresh");
if (refreshBtn) refreshBtn.onclick = function () { loadDemoWithdraw(); };
/* Collapsible folds (like settlement QR fold) */ /* Collapsible folds (like settlement QR fold) */
function openFold(foldId, btnId, bodyId, onOpen) {
var fold = document.getElementById(foldId);
var btn = document.getElementById(btnId);
var body = document.getElementById(bodyId);
if (!fold || !body) return;
fold.classList.add("open");
if (btn) btn.setAttribute("aria-expanded", "true");
body.removeAttribute("hidden");
if (onOpen) onOpen();
}
function wireFold(foldId, btnId, bodyId, onOpen) { function wireFold(foldId, btnId, bodyId, onOpen) {
var fold = document.getElementById(foldId); var fold = document.getElementById(foldId);
var btn = document.getElementById(btnId); var btn = document.getElementById(btnId);
@ -1171,9 +1188,9 @@
}); });
} }
wireFold("how-fold", "how-fold-toggle", "how-fold-body"); wireFold("how-fold", "how-fold-toggle", "how-fold-body");
(function () { var paintWebuiQrOnce = (function () {
var webuiPainted = false; var webuiPainted = false;
wireFold("more-fold", "more-fold-toggle", "more-fold-body", function () { return function () {
if (webuiPainted) return; if (webuiPainted) return;
makeQr( makeQr(
document.getElementById("qr-webui"), document.getElementById("qr-webui"),
@ -1181,8 +1198,10 @@
document.getElementById("qr-webui-logo") document.getElementById("qr-webui-logo")
); );
webuiPainted = true; webuiPainted = true;
}); };
})();
wireFold("more-fold", "more-fold-toggle", "more-fold-body", paintWebuiQrOnce);
(function () {
function createAutoAccount() { function createAutoAccount() {
var btn = document.getElementById("auto-account-btn"); var btn = document.getElementById("auto-account-btn");
var box = document.getElementById("auto-account-box"); var box = document.getElementById("auto-account-box");
@ -1261,6 +1280,18 @@
createAutoAccount(); createAutoAccount();
}); });
} }
/* Withdraw step: open optional fold + create personal account */
var genOwn = document.getElementById("generate-own-account");
if (genOwn) {
genOwn.addEventListener("click", function () {
openFold("more-fold", "more-fold-toggle", "more-fold-body", paintWebuiQrOnce);
var fold = document.getElementById("more-fold");
if (fold && fold.scrollIntoView) {
fold.scrollIntoView({ behavior: "smooth", block: "start" });
}
createAutoAccount();
});
}
})(); })();
function fmtCest(unix, fallback) { function fmtCest(unix, fallback) {