Skip to content

Commit 8626bf2

Browse files
committed
Hide the stamp toast fully after it slides away and make wide article tables keyboard-scrollable
On phones the hidden toast stopped 112px short of the top edge, so its lower half stayed over the header and caught taps on the passport button. It now moves out of view and turns invisible once hidden. Tables wider than the article column scroll inside their wrapper; the wrapper now takes focus so keyboard users can scroll it too.
1 parent c26b3cf commit 8626bf2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎assets/css/hub.css‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ dialog.station::backdrop { background: rgba(10, 14, 20, .55); }
666666
.prose blockquote { border-left: 4px solid var(--rule); padding-left: 16px; color: var(--muted); }
667667
.prose img { border-radius: 10px; }
668668
.prose .table-wrap { overflow-x: auto; margin: 0 0 20px; }
669+
.prose .table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
669670
.prose table { border-collapse: collapse; font-size: 14.5px; min-width: 520px; width: 100%; }
670671
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
671672
.prose th { background: var(--surface-2); }
@@ -817,6 +818,8 @@ button.btn.sm { font-size: 14px; }
817818
.stamp.sm { width: 36px; height: 36px; font-size: 15px; }
818819
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: flex; align-items: center; gap: 12px; width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: 0 12px 32px rgba(0, 0, 0, .25); transform: translate(-50%, 140%); transition: transform .3s ease; }
819820
.toast.show { transform: translate(-50%, 0); }
821+
/* once it slides away it must not sit over the header or catch taps */
822+
.toast:not(.show) { visibility: hidden; pointer-events: none; transition: transform .3s ease, visibility 0s linear .3s; }
820823
.toast b { display: block; font-size: 14px; }
821824
.toast span span { font-size: 12.5px; opacity: .75; }
822825
.toast button { font: inherit; font-size: 13px; font-weight: 700; margin-left: 4px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: inherit; cursor: pointer; white-space: nowrap; }
@@ -938,7 +941,7 @@ button.btn.sm { font-size: 14px; }
938941
.lab-legend { margin-top: 4px; font-size: 12px; }
939942
}
940943
.toast > span:nth-child(2) { flex: 1; min-width: 0; }
941-
@media (max-width: 900px) { .toast { bottom: auto; top: 96px; transform: translate(-50%, -180%); } .toast.show { transform: translate(-50%, 0); } }
944+
@media (max-width: 900px) { .toast { bottom: auto; top: 96px; transform: translate(-50%, calc(-100% - 112px)); } .toast.show { transform: translate(-50%, 0); } }
942945
.lab-ctl.off input[type=range] { opacity: .45; }
943946
.lab-ctl.off small { color: var(--live); font-weight: 600; }
944947
.lab-note { font-size: 12.5px; color: var(--muted); }
@@ -2004,6 +2007,7 @@ dialog.sheet[open] { animation: sheet-in .28s cubic-bezier(.2, .7, .2, 1); }
20042007
dialog.sheet .toast, dialog.sheet .toast.show { position: absolute; top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; width: auto; transform: none; transition: opacity .25s ease; }
20052008
dialog.sheet .toast { opacity: 0; pointer-events: none; }
20062009
dialog.sheet .toast.show { opacity: 1; pointer-events: auto; }
2010+
dialog.sheet .toast:not(.show) { transition: opacity .25s ease, visibility 0s linear .25s; }
20072011
@media (min-width: 861px) {
20082012
.event-past ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
20092013
.event.past + .event.past { border-top: 0; }

‎assets/js/article.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
body.querySelectorAll("table").forEach((t) => {
5151
const w = document.createElement("div");
5252
w.className = "table-wrap";
53+
/* wide tables scroll sideways on phones, so the scroll area has to be reachable by keyboard */
54+
w.tabIndex = 0; w.setAttribute("role", "region"); w.setAttribute("aria-label", "표, 가로로 스크롤할 수 있습니다");
5355
t.parentNode.insertBefore(w, t);
5456
w.appendChild(t);
5557
});

0 commit comments

Comments
 (0)