From 6e059c81157d892afa36595f451204d9e14cfbc7 Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Mon, 13 Apr 2026 15:03:37 +0700 Subject: [PATCH] Polish order modal and stepper UI --- server.js | 77 ++++++++++++++++++++++++++++++++++++++---------------- styles.css | 36 +++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 23 deletions(-) diff --git a/server.js b/server.js index f6b140c..fa4f451 100644 --- a/server.js +++ b/server.js @@ -179,6 +179,30 @@ function layout(title, body, { authenticated = false, activePath = "/", subtitle ` : body} + + `; } @@ -503,7 +527,11 @@ function renderOrderDetail(order) { return `
- ${panelHeader(`${order.patient} · ${order.id}`, "Order detail with the same structure as the proposed master-detail workflow.", `Pesan khusus`)} + ${panelHeader( + `${order.patient} · ${order.id}`, + "Order detail with the same structure as the proposed master-detail workflow.", + ``, + )}
Status
${statusBadge(order.status)}
Patient${escapeHtml(order.patient)}${escapeHtml(order.mode)} · ${escapeHtml(order.age)} years
@@ -613,7 +641,7 @@ function renderOrderForm(step, stepKey = "demografi") { ${steps .map( (item, index) => ` - + ${escapeHtml(item[1])} ${escapeHtml(item[2])} @@ -973,7 +1001,7 @@ function problemLoginPage() { function orderNewPage(path) { const step = path.split("/").filter(Boolean)[2] || "demografi"; - return layout("Create Order", renderOrderForm({}, step), { + return layout("Create Order", `
${renderOrderForm({}, step)}
`, { authenticated: true, activePath: "/orders", subtitle: "The new project collapses the old step-heavy flow into a cleaner shell while keeping the same workflow.", @@ -1557,27 +1585,30 @@ function fragmentOrderStep(step) { function fragmentPesanKhusus(orderId) { const order = mockOrders.find((item) => item.id === orderId) || mockOrders[0]; return ` -
- ${panelHeader("Pesan khusus", "Desktop can treat this as a modal-style panel; mobile reads it as a dedicated page.", `Back`)} -
-
- ${escapeHtml(order.patient)} -

${escapeHtml(order.id)}

-
${statusBadge(order.status)}
-

${escapeHtml(order.message)}

-
-
- -
- - Cancel + +
+
`; } diff --git a/styles.css b/styles.css index 67031c1..b4caa0f 100644 --- a/styles.css +++ b/styles.css @@ -798,6 +798,31 @@ tr:last-child td { display: none !important; } +.modal-shell { + position: fixed; + inset: 0; + z-index: 40; + display: grid; + place-items: center; + padding: 22px; +} + +.modal-backdrop { + position: absolute; + inset: 0; + background: rgba(15, 23, 42, 0.5); + backdrop-filter: blur(10px); +} + +.modal-card { + position: relative; + z-index: 1; + width: min(980px, 100%); + max-height: calc(100vh - 44px); + overflow: auto; + box-shadow: var(--shadow-lg); +} + .desktop-only { display: block; } @@ -872,6 +897,17 @@ tr:last-child td { .auth-screen { padding: 12px; } + + .modal-shell { + padding: 0; + place-items: stretch; + } + + .modal-card { + width: 100%; + max-height: 100vh; + border-radius: 0; + } } @media (max-width: 620px) {