From e44907f283efa97fb9bffe0c4f7be68ce4a14468 Mon Sep 17 00:00:00 2001 From: Dauren777 Date: Wed, 24 Jun 2026 11:48:45 +0000 Subject: [PATCH] =?UTF-8?q?v5:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B2=D0=B8=D0=B3=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=81=D0=B5=D0=BB=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 3 +++ js/app.js | 30 +++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index e5dc326..ddee96f 100644 --- a/index.html +++ b/index.html @@ -29,6 +29,9 @@ body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,san .map-mode-btn.active{border-color:#0f172a;background:#0f172a;color:#fff} input,select{width:100%;padding:10px 14px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;background:#fff;outline:none} input:focus,select:focus{border-color:#0f172a} +select{max-height:200px;overflow-y:auto} +#village option,#rayon option{padding:4px 6px;font-size:13px} +#searchResults{max-height:300px;overflow-y:auto} table{width:100%;border-collapse:collapse;font-size:14px} table th{text-align:left;padding:10px 16px;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:#64748b;border-bottom:2px solid #e2e8f0} table td{padding:10px 16px;border-bottom:1px solid #f1f5f9} diff --git a/js/app.js b/js/app.js index 63f9cfb..5f68c25 100644 --- a/js/app.js +++ b/js/app.js @@ -148,8 +148,36 @@ function initSelectors() { if (center) map.setView(center, 10); }); + function findVillageData(name) { + const q = name.toLowerCase().trim(); + for (const o of KZ_DATA) { + for (const r of o.rayons) { + for (const v of r.villages) { + if (v.toLowerCase() === q) { + return { village: v, rayon: r.rayon, oblast: o.oblast, center: r.center || o.center }; + } + } + } + } + return null; + } + function goToVillage(name) { if (!name) return; + const found = findVillageData(name); + if (found) { + oblastSel.value = found.oblast; + updateRayons(); + rayonSel.value = found.rayon; + updateVillages(); + villageSel.value = found.village; + map.setView(found.center, 13); + L.popup() + .setLatLng(found.center) + .setContent(`${found.village}
${found.oblast}, ${found.rayon}`) + .openOn(map); + return; + } const oblast = KZ_DATA.find((o) => o.oblast === oblastSel.value); if (!oblast) return; const rayon = oblast.rayons.find((r) => r.rayon === rayonSel.value); @@ -195,7 +223,7 @@ function initSelectors() { list.innerHTML = "
  • Не найдено
  • "; return; } - results.slice(0, 30).forEach((r) => { + results.slice(0, 50).forEach((r) => { const li = document.createElement("li"); li.className = "px-3 py-2 cursor-pointer hover:bg-cyan-50"; li.textContent = `${r.village} — ${r.rayon}, ${r.oblast}`;