check page: add share button (parity with Next) + shared share row styles

- ui/share.js: one handler for all pages (id=share-btn / id=share-status),
  short link = origin+path+hash, navigator.share + clipboard, LINE link,
  re-binds after router swaps the view (MutationObserver), skips buttons that
  a page already bound itself
- checkSchedule.html: share row inside .mu-container (same position as Next)
- _shared.css: .mu-share-* moved here from home.html, values copied from Next
  (ghost button, radius 8, 44px, tokens) so light/dark match
- home.init.js marks its own binding so the shared handler does not double-bind
- index.html + sw PRECACHE: share.js · VERSION 2026.09.27.124
This commit is contained in:
Bkk1234 committed 2026-11-04 02:05:47 +07:00
1 parent 1adc2a6cd0
commit b6ccb66ce2
8 files changed
+189 -39

No files matched your search

+63
View File
@@ -681,3 +681,66 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
.mu-loadbar { display: none; }
}
/* ============================================================
ปุ่ม "แชร์หน้านี้" — พอร์ตจาก web-at-transit (variant ghost)
ใช้ได้ทุกหน้า: ปุ่ม id="share-btn" + ข้อความ id="share-status"
============================================================ */
.mu-share-row {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
margin: 22px 0 44px;
}
.mu-share-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 44px;
padding: 10px 18px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-surface);
color: var(--c-brand-ink);
font-family: inherit;
font-size: .85rem;
font-weight: 700;
line-height: 1;
cursor: pointer;
transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.mu-share-btn:hover { border-color: #d8c9f2; background: var(--c-surface-2); }
.mu-share-btn:active { transform: translateY(1px); }
.mu-share-btn:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.mu-share-btn .ic { width: 16px; height: 16px; }
.mu-share-status {
margin: 0;
font-size: .85rem;
line-height: 1.7;
color: var(--c-ink-2);
text-align: right;
}
.mu-share-status:empty { display: none; }
.mu-share-url {
display: inline-block;
padding: 2px 8px;
border: 1px solid var(--c-border);
border-radius: 8px;
background: var(--c-surface-2);
font-family: ui-monospace, "IBM Plex Mono", monospace;
font-size: .8rem;
}
.mu-share-line {
display: inline-block;
margin-left: 6px;
font-weight: 700;
color: #06c755;
text-decoration: none;
}
.mu-share-line:hover { text-decoration: underline; }
@media (max-width: 560px) {
.mu-share-row { align-items: stretch; }
.mu-share-btn { justify-content: center; }
.mu-share-status { text-align: left; }
}