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;
font-weight: 600;
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 {
color: #f0d090;
@ -779,8 +788,8 @@
</a>
<p class="meta" id="withdraw-demo-meta">Preparing withdraw…</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">
Get a fresh QR
<button type="button" class="cta-sec" id="generate-own-account" style="margin-top:0.5rem">
Generate own account
</button>
<p class="balance-note" role="note">
<strong>Surprising balance?</strong>
@ -1149,10 +1158,18 @@
}
loadDemoWithdraw();
var refreshBtn = document.getElementById("withdraw-demo-refresh");
if (refreshBtn) refreshBtn.onclick = function () { loadDemoWithdraw(); };
/* 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) {
var fold = document.getElementById(foldId);
var btn = document.getElementById(btnId);
@ -1171,9 +1188,9 @@
});
}
wireFold("how-fold", "how-fold-toggle", "how-fold-body");
(function () {
var paintWebuiQrOnce = (function () {
var webuiPainted = false;
wireFold("more-fold", "more-fold-toggle", "more-fold-body", function () {
return function () {
if (webuiPainted) return;
makeQr(
document.getElementById("qr-webui"),
@ -1181,8 +1198,10 @@
document.getElementById("qr-webui-logo")
);
webuiPainted = true;
});
};
})();
wireFold("more-fold", "more-fold-toggle", "more-fold-body", paintWebuiQrOnce);
(function () {
function createAutoAccount() {
var btn = document.getElementById("auto-account-btn");
var box = document.getElementById("auto-account-box");
@ -1261,6 +1280,18 @@
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) {