-
🌐
-
-
+
+
+
+
100%
+
+
+ 🌐
+
+
+
@@ -452,12 +465,33 @@ function boot() {
document.getElementById("loading").style.display = "none";
}
+// ── Font-size accessibility ────────────────────────────────────────────────────
+const ZOOMS = [0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3];
+const ZOOM_LABELS = ["80%", "85%", "90%", "95%", "100%", "110%", "120%", "130%"];
+let zoomIdx = +(localStorage.getItem("zoomIdx") ?? 4);
+
+function applyZoom() {
+ const fr = document.getElementById("form-root");
+ if (fr) fr.style.zoom = ZOOMS[zoomIdx];
+ const lbl = document.getElementById("sz-label");
+ if (lbl) lbl.textContent = ZOOM_LABELS[zoomIdx];
+ document.getElementById("sz-down").disabled = zoomIdx === 0;
+ document.getElementById("sz-up").disabled = zoomIdx === ZOOMS.length - 1;
+}
+
+function bumpZoom(dir) {
+ zoomIdx = Math.max(0, Math.min(ZOOMS.length - 1, zoomIdx + dir));
+ localStorage.setItem("zoomIdx", zoomIdx);
+ applyZoom();
+}
+
// ── Language bar ──────────────────────────────────────────────────────────────
function buildLangBar() {
+ applyZoom();
const langs = cfg.languages || [{ code: cfg["default-code"], name: cfg["default-name"] }];
if (langs.length < 2) return;
- const bar = document.getElementById("lang-bar");
- bar.style.display = "flex";
+ const part = document.getElementById("lang-part");
+ if (part) part.style.display = "flex";
document.getElementById("lbl-language").textContent = t("language");
const sel = document.getElementById("lang-sel");
sel.innerHTML = langs.map(l =>
@@ -840,8 +874,7 @@ function calcFxFromPer(i) {
const per = pn(document.getElementById(`fper-${i}`)?.value);
const rate = pn(document.getElementById(`frate-${i}`)?.value) || 1;
const prEl = document.getElementById(`price-${i}`);
- // rate = "1 foreign = rate local", so local price = per * rate
- if (prEl) prEl.value = (per * rate).toFixed(6);
+ if (prEl) prEl.value = (per / rate).toFixed(6);
calcLine(i);
}
@@ -1128,7 +1161,7 @@ function buildPreviewHTML() {
const linesHTML = rows.map(row => {
const fxLine = row.fxNote
? `
${h(row.fxNote.td("converted-from"))} ${h(row.fxNote.cur)}: `
- + `1 ${h(row.fxNote.cur)} = ${(+row.fxNote.rate).toFixed(5)} ${h(iCur)}. `
+ + `${(+row.fxNote.rate).toFixed(5)} ${h(row.fxNote.cur)} = 1 ${h(iCur)}. `
+ `${h(row.fxNote.td("per-item"))}: ${h(row.fxNote.cur)} ${fmt(row.fxNote.per)}, `
+ `${h(row.fxNote.td("line-total")).toLowerCase()}: ${h(row.fxNote.cur)} ${fmt(row.fxNote.foreignTot)}
`
: "";
@@ -1363,7 +1396,7 @@ function buildPDF() {
const descH = Math.max(0, (dLines.length - 1) * 3.8);
let fxH = 0;
if (row.fxNote) {
- const fxStr = `${td("converted-from")} ${row.fxNote.cur}: 1 ${row.fxNote.cur} = ${(+row.fxNote.rate).toFixed(5)} ${iCur}. `
+ const fxStr = `${td("converted-from")} ${row.fxNote.cur}: ${(+row.fxNote.rate).toFixed(5)} ${row.fxNote.cur} = 1 ${iCur}. `
+ `${td("per-item")}: ${row.fxNote.cur} ${fmt(row.fxNote.per)}, `
+ `${td("line-total").toLowerCase()}: ${row.fxNote.cur} ${fmt(row.fxNote.foreignTot)}`;
const fxLines = sp(fxStr, CD + CP - 4);
@@ -1398,7 +1431,7 @@ function buildPDF() {
if (row.fxNote) {
const fxStr = `${td("converted-from")} ${row.fxNote.cur}: `
- + `1 ${row.fxNote.cur} = ${(+row.fxNote.rate).toFixed(5)} ${iCur}. `
+ + `${(+row.fxNote.rate).toFixed(5)} ${row.fxNote.cur} = 1 ${iCur}. `
+ `${td("per-item")}: ${row.fxNote.cur} ${fmt(row.fxNote.per)}, `
+ `${td("line-total").toLowerCase()}: ${row.fxNote.cur} ${fmt(row.fxNote.foreignTot)}`;
fn(7); tc(107,114,128);