<!-- Copyright (c) 2026 Globefin. Released under the MIT License. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Padala — what your money home really costs, Houston to Manila</title>
<style>
:root { --royal: #0038a8; --deep: #0a1f5c; --red: #ce1126; --sun: #fcd116; --white: #fff; --cloud: #f3f6fc; --ink: #14213d; --slate: #5a6785; --line: #d9e1f2; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--cloud); color: var(--ink); font-family: "Futura", "Century Gothic", "Trebuchet MS", sans-serif; line-height: 1.5; }
.body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.sky { background: var(--deep); color: #fff; position: relative; overflow: hidden; }
.sky svg { display: block; width: 100%; height: 330px; }
.sky .copy { position: absolute; top: 0; left: 0; right: 0; max-width: 1100px; margin: 0 auto; padding: 1.6rem 1.4rem; }
.sky h1 { font-size: 3rem; margin: 0; letter-spacing: .02em; font-weight: 700; }
.sky p { margin: .3rem 0 0; max-width: 460px; color: #dfe6fb; font-size: 1rem; }
.sky .who { font-size: .85rem; color: var(--sun); margin-top: .6rem; }
.stripes { height: 10px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--sun) 40px 60px, var(--royal) 60px 100px, #fff 100px 108px); }
@media (prefers-reduced-motion: no-preference) { .plane-path { animation: dash 2.4s ease-out 1 both; } }
@keyframes dash { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
main { max-width: 1100px; margin: 0 auto; padding: 1.8rem 1.4rem 2rem; }
.send { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: center; background: #fff; border-radius: 18px; padding: 1.3rem 1.5rem; border: 1px solid var(--line); }
.send .side span { display: block; font-size: .9rem; color: var(--slate); }
.send .side b { display: block; font-size: 2.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.send .side.home b { color: var(--royal); }
.send .arrow { font-size: 2rem; color: var(--red); }
.send input[type=range] { width: 100%; accent-color: var(--red); margin-top: .4rem; }
.send .via { font-size: .9rem; color: var(--slate); margin-top: .2rem; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; margin: 1rem 0 0; }
.row3 label { font-size: .85rem; color: var(--slate); display: block; }
.row3 input { font: inherit; font-size: 1rem; width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hint { font-size: .82rem; color: var(--slate); margin: .35rem 0 0; }
h2 { font-size: 1.5rem; margin: 2rem 0 .2rem; }
.lanes { margin-top: .8rem; }
.lane { display: grid; grid-template-columns: 220px 1fr 140px; gap: 1rem; align-items: center; background: #fff; border: 2px solid transparent; border-radius: 14px; padding: .8rem 1rem; margin-bottom: .6rem; cursor: pointer; }
.lane.pick { border-color: var(--royal); }
.lane .nm input { font: inherit; font-size: 1rem; font-weight: 700; border: 0; border-bottom: 1px dashed var(--line); width: 100%; background: transparent; color: var(--ink); padding: .1rem 0; }
.lane .nm .ins { display: flex; gap: .5rem; margin-top: .35rem; }
.lane .nm .ins label { font-size: .72rem; color: var(--slate); }
.lane .nm .ins input { font: inherit; font-size: .9rem; font-weight: 400; width: 5.2rem; border: 1px solid var(--line); border-radius: 6px; padding: .2rem .35rem; }
.bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; background: #eef1f8; }
.bar div { height: 100%; transition: width .25s ease; }
.bar .keep { background: var(--royal); } .bar .fee { background: var(--red); } .bar .fx { background: var(--sun); }
.lane .cost { text-align: right; }
.lane .cost b { display: block; font-size: 1.25rem; }
.lane .cost .ct { font-size: .8rem; color: var(--slate); }
.lane .best { display: inline-block; font-size: .72rem; background: var(--sun); color: var(--ink); border-radius: 999px; padding: .05rem .5rem; margin-left: .3rem; font-weight: 700; }
.key { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--slate); }
.key i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.x { font: inherit; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--slate); cursor: pointer; padding: 0 .5rem; margin-left: .4rem; }
.add { font: inherit; border: 2px dashed var(--royal); color: var(--royal); background: none; border-radius: 14px; padding: .6rem 1rem; cursor: pointer; width: 100%; }
.year { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.5rem; background: var(--royal); color: #fff; border-radius: 18px; padding: 1.4rem 1.5rem; margin-top: 2rem; }
.year .big { font-size: 3rem; line-height: 1; color: var(--sun); }
.year p { margin: .4rem 0 0; color: #dfe6fb; }
.buys { display: grid; gap: .7rem; }
.buy { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; background: rgba(255,255,255,.08); border-radius: 10px; padding: .55rem .7rem; }
.buy .icons { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .3rem; }
.buy .icons svg { width: 16px; height: 16px; }
.buy input { font: inherit; width: 5.5rem; border: 0; border-radius: 6px; padding: .25rem .4rem; }
.buy .t { font-size: .92rem; }
.need { margin-top: 1.4rem; background: #fff; border-radius: 14px; padding: 1rem 1.2rem; border: 1px solid var(--line); }
.msg { font-size: .92rem; margin: .5rem 0; } .warn { color: var(--red); font-weight: 600; }
.work { margin-top: 1.4rem; font-size: .88rem; background: #fff; border-left: 5px solid var(--sun); border-radius: 8px; padding: .9rem 1.1rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.toolbar button { font: inherit; font-size: .92rem; border-radius: 999px; padding: .5rem 1.05rem; cursor: pointer; border: 2px solid var(--royal); background: #fff; color: var(--royal); }
.toolbar button.primary { background: var(--red); border-color: var(--red); color: #fff; }
button:focus-visible, input:focus-visible, .lane:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 1.4rem 2.4rem; font-size: .8rem; color: var(--slate); }
@media (max-width: 860px) {
.sky h1 { font-size: 2.2rem; } .sky svg { height: 380px; }
.send { grid-template-columns: 1fr; } .send .arrow { transform: rotate(90deg); justify-self: center; }
.row3 { grid-template-columns: 1fr; } .lane { grid-template-columns: 1fr; } .lane .cost { text-align: left; }
.year { grid-template-columns: 1fr; }
}
@media print { .toolbar, .add, .x, input[type=range] { display: none !important; } }
</style>
</head>
<body>
<header class="sky">
<!-- Houston to Manila, the long way over the Pacific. -->
<svg viewBox="0 0 1200 330" preserveAspectRatio="xMidYMax slice" aria-hidden="true">
<rect width="1200" height="330" fill="#0a1f5c"/>
<g transform="translate(0 70)">
<g fill="#fff" opacity=".7"><circle cx="80" cy="40" r="1.4"/><circle cx="240" cy="80" r="1"/><circle cx="420" cy="30" r="1.3"/><circle cx="610" cy="60" r="1"/><circle cx="760" cy="24" r="1.5"/><circle cx="990" cy="50" r="1.1"/><circle cx="1130" cy="90" r="1.2"/><circle cx="350" cy="120" r="1"/></g>
<!-- the Pacific, a curve of ocean along the bottom -->
<path d="M0 220 Q600 150 1200 220 L1200 260 L0 260Z" fill="#11307f"/>
<!-- Luzon, roughly, on the left; Texas coast on the right -->
<path d="M502 196 l14 -18 l8 6 l-2 14 l10 6 l-6 12 l-14 -2 l-4 10 l-10 -6z" fill="#2e5bd0"/>
<path d="M1010 196 q30 -20 70 -16 q40 4 80 -6 l40 4 l0 30 q-60 -6 -120 6 q-40 8 -70 -18z" fill="#2e5bd0"/>
<path class="plane-path" d="M1050 192 C 940 60, 640 60, 520 186" fill="none" stroke="#fcd116" stroke-width="2.5" stroke-dasharray="700" stroke-dashoffset="0"/>
<path d="M1050 192 C 940 60, 640 60, 520 186" fill="none" stroke="#fcd116" stroke-width="1" stroke-dasharray="3 9" opacity=".6"/>
<circle cx="1050" cy="192" r="6" fill="#ce1126"/><circle cx="520" cy="186" r="6" fill="#fcd116"/>
<text x="1050" y="216" fill="#fff" font-size="15" text-anchor="middle" font-family="Futura, Century Gothic, sans-serif">Houston</text>
<text x="520" y="238" fill="#fff" font-size="15" text-anchor="middle" font-family="Futura, Century Gothic, sans-serif">Manila</text>
<!-- the eight-rayed sun from the flag, small, over Manila -->
<g transform="translate(520 186)" fill="#fcd116" opacity=".9">
<path d="M0 -26 L3 -14 L-3 -14Z M0 26 L3 14 L-3 14Z M-26 0 L-14 3 L-14 -3Z M26 0 L14 3 L14 -3Z M18 -18 L12 -8 L8 -12Z M-18 18 L-12 8 L-8 12Z M-18 -18 L-8 -12 L-12 -8Z M18 18 L8 12 L12 8Z"/>
</g>
</g>
</svg>
<div class="copy">
<h1>Padala</h1>
<p>A "no fee" transfer isn't free if the exchange rate is worse. Put in today's quotes and see which service gets the most pesos home.</p>
<div class="who">Built for a nurse in Houston who sends money to her parents in Manila twice a month.</div>
</div>
</header>
<div class="stripes" aria-hidden="true"></div>
<main>
<section class="send" aria-live="polite">
<div class="side">
<span>You send each time</span>
<b id="sendV">$0</b>
<input id="amount" type="range" min="25" max="2000" step="5" aria-label="Amount you send each time, in US dollars">
</div>
<div class="arrow" aria-hidden="true">➜</div>
<div class="side home">
<span>Your family receives</span>
<b id="getV">₱0</b>
<div class="via" id="via"></div>
</div>
</section>
<div class="row3 body">
<div><label for="per">Times a month</label><input id="per" type="number" min="0" step="1"></div>
<div><label for="mid">Today's real rate (₱ per $1)</label><input id="mid" type="number" min="0" step="0.01"></div>
<div><label for="need">Pesos they need each time (optional)</label><input id="need" type="number" min="0" step="100"></div>
</div>
<p class="hint body">The real rate is the one you see when you search "USD to PHP" — no markup. Look it up at the same time as the quotes.</p>
<h2>Where your dollar goes</h2>
<div class="key body"><span><i style="background:#0038a8"></i>Reaches your family</span><span><i style="background:#ce1126"></i>Fee</span><span><i style="background:#fcd116"></i>Hidden in the exchange rate</span></div>
<p class="hint body">These quotes are <b>made-up samples</b>. Replace them with what each service shows you for this amount. Tap a service to use it above.</p>
<div class="lanes body" id="lanes"></div>
<button type="button" class="add body" id="addRow">+ Add a service</button>
<div id="msg" class="body"></div>
<section class="year body">
<div>
<div>Picking the cheapest instead of the most expensive puts</div>
<div class="big" id="yearPesos">₱0</div>
<p id="yearUsd"></p>
</div>
<div>
<div style="margin-bottom:.5rem;">That's enough, each year, for any one of these <span style="opacity:.75">(your prices — change them)</span></div>
<div class="buys" id="buys"></div>
</div>
</section>
<section class="need body" id="needBox"></section>
<section class="work body" id="work"></section>
<div class="toolbar body">
<button type="button" class="primary" id="saveBtn">Save my quotes</button>
<button type="button" id="openBtn">Open saved quotes</button>
<button type="button" id="printBtn">Print</button>
<button type="button" id="resetBtn">Start over</button>
<input type="file" id="fileIn" accept=".json,application/json" hidden>
</div>
<div id="fileMsg" class="msg body" role="status"></div>
</main>
<footer class="body">
<p><b>For education only.</b> Not financial advice, and not a recommendation of any service. Quotes change by the
minute and by amount, delivery and payment method — always check the final screen before you pay. Nothing you type
leaves this page: no rates are looked up, and nothing is sent anywhere. Made for the Globefin Demos gallery as an
example. No outside code was used.</p>
</footer>
<script>
(function () {
"use strict";
var APP = "globefin-padala", VERSION = 2;
var ICONS = {
rice: '<svg viewBox="0 0 16 16"><path d="M3 5h10l-1 10H4z" fill="#fff"/><path d="M5 2h6l2 3H3z" fill="#fcd116"/></svg>',
load: '<svg viewBox="0 0 16 16"><rect x="4" y="1" width="8" height="14" rx="2" fill="#fff"/><rect x="5.5" y="3" width="5" height="8" fill="#0038a8"/></svg>',
school: '<svg viewBox="0 0 16 16"><path d="M1 6l7-4 7 4-7 4z" fill="#fff"/><path d="M4 8v4c2 2 6 2 8 0V8l-4 2z" fill="#fcd116"/></svg>',
meds: '<svg viewBox="0 0 16 16"><rect x="2" y="5" width="12" height="7" rx="3.5" fill="#fff"/><rect x="8" y="5" width="6" height="7" rx="3.5" fill="#ce1126"/></svg>'
};
function sample() {
return { amount: 400, per: 2, mid: 58.20, need: 0, pick: 1,
quotes: [ { name: "Service A — bank deposit", fee: 0, rate: 56.90 }, { name: "Service B — bank deposit", fee: 3.99, rate: 57.95 },
{ name: "Service C — cash pickup", fee: 4.99, rate: 57.40 }, { name: "My bank's wire", fee: 35, rate: 56.10 } ],
buys: [ { icon: "rice", name: "25 kg sack of rice", price: 1400 }, { icon: "load", name: "a month of phone load", price: 300 },
{ icon: "school", name: "a school uniform", price: 900 }, { icon: "meds", name: "a month of maintenance medicine", price: 1200 } ] };
}
var state = sample(), dirty = false;
var $ = function (id) { return document.getElementById(id); };
var usd = function (n) { return "$" + n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); };
var usd0 = function (n) { return "$" + Math.round(n).toLocaleString("en-US"); };
var php = function (n) { return "₱" + Math.round(n).toLocaleString("en-US"); };
function num(v) { var n = parseFloat(v); return isFinite(n) ? n : 0; }
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return {"&":"&","<":"<",">":">","\"":"""}[c]; }); }
// pesos received = (amount − fee) × their rate; true cost = amount − pesos ÷ real rate.
function cost(q) {
var amt = Math.max(0, state.amount), mid = Math.max(0, state.mid), fee = Math.min(Math.max(0, q.fee), amt), rate = Math.max(0, q.rate);
var received = (amt - fee) * rate, worth = mid > 0 ? received / mid : 0, total = amt - worth;
return { received: received, total: total, fee: fee, fx: total - fee, keep: worth, pct: amt ? total / amt * 100 : 0,
perYear: total * Math.max(0, state.per) * 12, pesosYear: received * Math.max(0, state.per) * 12 };
}
function renderLanes() {
var box = $("lanes"); box.innerHTML = "";
state.quotes.forEach(function (q, i) {
var lane = document.createElement("div"); lane.className = "lane"; lane.tabIndex = 0; lane.setAttribute("role", "button");
lane.innerHTML = '<div class="nm"><input type="text" aria-label="Service name" value="' + esc(q.name) + '">' +
'<div class="ins"><label>Fee $<br><input type="number" min="0" step="0.01" value="' + q.fee + '" aria-label="Fee in dollars"></label>' +
'<label>₱ per $1<br><input type="number" min="0" step="0.01" value="' + q.rate + '" aria-label="Their rate"></label>' +
'<button type="button" class="x" aria-label="Remove service">✕</button></div></div>' +
'<div class="bar" aria-hidden="true"><div class="keep"></div><div class="fee"></div><div class="fx"></div></div>' +
'<div class="cost"><b></b><span class="ct"></span></div>';
var ins = lane.querySelectorAll("input");
ins[0].addEventListener("input", function () { q.name = this.value; dirty = true; update(); });
ins[1].addEventListener("input", function () { q.fee = num(this.value); dirty = true; update(); });
ins[2].addEventListener("input", function () { q.rate = num(this.value); dirty = true; update(); });
lane.querySelector(".x").addEventListener("click", function (e) { e.stopPropagation(); state.quotes.splice(i, 1); if (state.pick >= state.quotes.length) state.pick = 0; dirty = true; renderLanes(); update(); });
lane.addEventListener("click", function (e) { if (e.target.tagName === "INPUT") return; state.pick = i; dirty = true; update(); });
lane.addEventListener("keydown", function (e) { if ((e.key === "Enter" || e.key === " ") && e.target === lane) { e.preventDefault(); state.pick = i; dirty = true; update(); } });
box.appendChild(lane);
});
}
function renderBuys() {
var box = $("buys"); box.innerHTML = "";
state.buys.forEach(function (b) {
var row = document.createElement("div"); row.className = "buy";
row.innerHTML = '<div><div class="t"></div><div class="icons"></div></div><label>₱ <input type="number" min="0" step="10" value="' + b.price + '" aria-label="Price of ' + esc(b.name) + '"></label>';
row.querySelector("input").addEventListener("input", function () { b.price = num(this.value); dirty = true; update(); });
box.appendChild(row);
});
}
function update() {
var res = state.quotes.map(cost), valid = state.quotes.map(function (q) { return q.rate > 0; });
var best = -1, worst = -1;
res.forEach(function (r, i) { if (!valid[i]) return; if (best < 0 || r.total < res[best].total) best = i; if (worst < 0 || r.total > res[worst].total) worst = i; });
var pick = state.quotes[state.pick] ? state.pick : (best >= 0 ? best : 0);
$("sendV").textContent = usd0(state.amount);
if (state.quotes[pick] && valid[pick]) {
$("getV").textContent = php(res[pick].received);
$("via").textContent = "with " + (state.quotes[pick].name || "this service") + " — costs you " + usd(res[pick].total) + " (" + res[pick].pct.toFixed(1) + "%)";
} else { $("getV").textContent = "₱—"; $("via").textContent = "Add a service with its rate."; }
var lanes = $("lanes").querySelectorAll(".lane");
res.forEach(function (r, i) {
var l = lanes[i]; if (!l) return; var amt = Math.max(0.0001, state.amount);
l.classList.toggle("pick", i === pick);
l.setAttribute("aria-label", (state.quotes[i].name || "Service") + (i === pick ? ", shown above" : ", tap to show above"));
var bars = l.querySelectorAll(".bar div");
bars[0].style.width = valid[i] ? (r.keep / amt * 100) + "%" : "0";
bars[1].style.width = valid[i] ? (r.fee / amt * 100) + "%" : "0";
bars[2].style.width = valid[i] ? (Math.max(0, r.fx) / amt * 100) + "%" : "0";
l.querySelector(".cost b").innerHTML = valid[i] ? php(r.received) + (i === best && res.filter(function (_, k) { return valid[k]; }).length > 1 ? '<span class="best">cheapest</span>' : "") : "—";
l.querySelector(".cost .ct").textContent = valid[i] ? "costs " + usd(r.total) + " · " + r.pct.toFixed(1) + "%" : "enter their rate";
});
var gapP = best >= 0 && worst >= 0 ? res[best].pesosYear - res[worst].pesosYear : 0;
$("yearPesos").textContent = php(gapP);
$("yearUsd").textContent = best >= 0 && worst >= 0 ? "more in your family's hands each year — " + usd0(res[worst].perYear - res[best].perYear) + " a year you're no longer paying in fees and markups." : "";
var buys = $("buys").querySelectorAll(".buy");
state.buys.forEach(function (b, i) {
var n = b.price > 0 ? Math.floor(gapP / b.price) : 0, row = buys[i]; if (!row) return;
row.querySelector(".t").textContent = n + " × " + b.name;
row.querySelector(".icons").innerHTML = new Array(Math.min(n, 36) + 1).join(ICONS[b.icon] || ICONS.rice) + (n > 36 ? '<span style="font-size:.8rem;margin-left:.3rem">+' + (n - 36) + "</span>" : "");
});
var msgs = [];
if (state.mid <= 0) msgs.push("Enter today's real rate first — every cost is measured against it.");
state.quotes.forEach(function (q) {
if (q.rate > 0 && state.mid > 0 && q.rate > state.mid * 1.01) msgs.push((q.name || "A service") + " shows a rate above the real rate. That's unusual — check both were taken at the same time.");
if (q.fee >= state.amount && state.amount > 0) msgs.push((q.name || "A service") + "'s fee is as big as what you're sending.");
});
$("msg").innerHTML = msgs.map(function (m) { return '<p class="msg warn">' + esc(m) + "</p>"; }).join("");
var nb = $("needBox");
if (state.need > 0 && best >= 0) {
var q = state.quotes[best], send = state.need / Math.max(0.0001, q.rate) + Math.max(0, q.fee);
nb.style.display = "";
nb.innerHTML = res[best].received >= state.need
? "<b>" + php(state.need) + " arrives</b> with " + esc(q.name || "the cheapest service") + " — you could send as little as <b>" + usd(send) + "</b> each time."
: '<span class="warn">Short of the ' + php(state.need) + " they need.</span> With " + esc(q.name || "the cheapest service") + " you'd send about <b>" + usd(send) + "</b> each time.";
} else nb.style.display = "none";
var ex = res[pick], eq = state.quotes[pick];
$("work").innerHTML = "<b>How it's worked out.</b> The fee comes out of what you send; the rest is changed into pesos at the service's rate: <i>pesos = (amount − fee) × their rate</i>. " +
"The true cost is what you paid minus what those pesos are worth at the real rate: <i>cost = amount − pesos ÷ real rate</i>. That catches the markup hidden in the rate as well as the fee." +
(eq && valid[pick] ? " For " + esc(eq.name || "this service") + ": (" + usd(state.amount) + " − " + usd(ex.fee) + ") × " + eq.rate + " = " + php(ex.received) + ", worth " + usd(ex.keep) + " at " + state.mid +
", so it costs " + usd(ex.total) + " (" + usd(ex.fee) + " fee + " + usd(ex.fx) + " in the rate)." : "") +
" Yearly figures assume " + state.per + " transfer(s) a month at today's quotes.";
}
function fill() { $("amount").value = state.amount; ["per","mid","need"].forEach(function (k) { $(k).value = state[k]; }); renderLanes(); renderBuys(); update(); }
$("amount").addEventListener("input", function () { state.amount = num(this.value); dirty = true; update(); });
["per","mid","need"].forEach(function (k) { $(k).addEventListener("input", function () { state[k] = num(this.value); dirty = true; update(); }); });
$("addRow").addEventListener("click", function () { state.quotes.push({ name: "", fee: 0, rate: 0 }); dirty = true; renderLanes(); update(); });
$("saveBtn").addEventListener("click", function () {
var blob = new Blob([JSON.stringify({ app: APP, version: VERSION, saved: new Date().toISOString(), data: state }, null, 2)], { type: "application/json" });
var a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "padala-quotes.json";
document.body.appendChild(a); a.click(); a.remove(); setTimeout(function () { URL.revokeObjectURL(a.href); }, 1000);
dirty = false; $("fileMsg").textContent = "Saved. Next payday, open it and just update the quotes.";
});
$("openBtn").addEventListener("click", function () { $("fileIn").click(); });
$("fileIn").addEventListener("change", function () {
var f = this.files[0]; this.value = ""; if (!f) return;
var r = new FileReader();
r.onload = function () {
var d; try { d = JSON.parse(r.result); } catch (e) { d = null; }
function bad(why) { $("fileMsg").innerHTML = '<span class="warn">That file can\'t be opened here — ' + esc(why) + '.</span> Nothing on screen was changed.'; }
if (!d || d.app !== APP) return bad("it isn't a Padala file");
var s = d.data; if (!s || !Array.isArray(s.quotes)) return bad("the quotes are missing");
var c = sample();
c.amount = num(s.amount); c.per = num(s.per); c.mid = num(s.mid); c.need = num(s.need); c.pick = Math.max(0, parseInt(s.pick, 10) || 0);
c.quotes = s.quotes.slice(0, 20).map(function (q) { return { name: String((q && q.name) || "").slice(0, 80), fee: num(q && q.fee), rate: num(q && q.rate) }; });
if (Array.isArray(s.buys)) c.buys = c.buys.map(function (b, i) { var sb = s.buys[i]; return sb ? { icon: b.icon, name: b.name, price: num(sb.price) } : b; });
if (dirty && !confirm("Replace what's on screen with the saved quotes? Unsaved changes will be lost.")) return;
state = c; dirty = false; fill(); $("fileMsg").textContent = "Opened your saved quotes.";
};
r.onerror = function () { $("fileMsg").innerHTML = '<span class="warn">That file couldn\'t be read.</span> Nothing on screen was changed.'; };
r.readAsText(f);
});
$("printBtn").addEventListener("click", function () { window.print(); });
$("resetBtn").addEventListener("click", function () {
if (dirty && !confirm("Start over with the sample quotes? Unsaved changes will be lost.")) return;
state = sample(); dirty = false; fill(); $("fileMsg").textContent = "";
});
window.addEventListener("beforeunload", function (e) { if (dirty) { e.preventDefault(); e.returnValue = ""; } });
fill();
})();
</script>
</body>
</html>
Nothing. This page is entirely self-contained and contacts no other website when it runs.
Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.
Copyright © 2026 Shane Hadden. Licensed under the MIT License. Published on Globefin.
Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →
Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.