008 Wiki Layout
Bố cục wiki cho máy tính và điện thoại
Cách sắp xếp thanh đầu trang, danh sách trang, phần dẫn hướng cuối bài, chân trang và thanh chuyển phần trên điện thoại cho wiki và trung tâm trợ giúp.
Khi sản phẩm phức tạp dần và website cần viết nhiều bài SEO, một bộ wiki đáng tin cậy vừa giải đáp thắc mắc của người dùng, vừa mang lại lượt truy cập từ tìm kiếm. Vấn đề thường gặp nhất là trên điện thoại không tìm thấy danh sách trang, đọc xong bài không biết đi đâu tiếp; về bố cục cần xử lý năm chỗ sau:
- Thanh chuyển phần trên điện thoại: điện thoại phần lớn là dạng thanh, màn hình hẹp, không đặt được danh sách trang ở bên cạnh. Giữ cố định một thanh chuyển phần ở cuối màn hình, chạm vào sẽ mở một menu toàn màn hình liệt kê mọi phần, mỗi phần một dòng, dễ chạm, không cần cuộn lên đầu trang.
- Danh sách trang: khi có nhiều phần, dài hơn một màn hình, danh sách trang dùng chiều cao riêng, cuộn tách biệt với bài viết, phần vượt ra được cắt ở hai đầu trên và dưới. Mép bị cắt thêm mặt nạ chuyển màu để báo phía trên và phía dưới vẫn còn nội dung, kèm một nút mũi tên ở giữa để tiện nhấp cuộn.
- Phần dẫn hướng cuối bài: dưới các bài giải đáp thắc mắc, đặt lối vào cộng đồng và tài khoản mạng xã hội; dù người đọc là người hay AI đều có thể mang lại chuyển đổi, giống như đặt miễn phí một quảng cáo theo ngữ cảnh cho mục tiêu chuyển đổi. Kiểu thẻ gần với các thành phần trong bài, trông như một phần của bài viết.
- Chân trang: dùng một ảnh nền đẹp làm chân trang cao hơn nửa màn hình, thu hút người đọc cuộn xuống tận cuối và dừng lại. Chân trang phải chứa thông tin thực sự hữu ích, giúp người đọc giải quyết vấn đề, nếu không chỉ gây khó chịu.
- Thanh đầu trang: logo (quay về website chính), menu thả xuống cho các trang quan trọng và nút CTA chủ chốt, cố định ở phía trên khi cuộn. Safari và một số trình duyệt khác tô màu thanh địa chỉ theo màu thanh đầu trang, nên màu nền cần hài hòa với thương hiệu.
Prompt đi kèm sẽ tìm bố cục dùng chung của các trang tài liệu, chỉ điều chỉnh vị trí, cách cuộn và cách phản hồi của thanh đầu trang, danh sách trang, dàn ý và khu vực cuối bài; nội dung, câu chữ, màu sắc và phông chữ giữ nguyên; sửa xong sẽ chụp màn hình ở đầu, giữa, cuối trang và ở độ rộng điện thoại để bạn kiểm tra.
Polish the layout of my docs or help center pages: the header, the page list, the outline and the end of each article. Keep the content, copy, colours and fonts. Change only how these parts sit, scroll and respond.
0. Start from what exists
- Find the shared docs layout, the site header, the page list (sidebar), the outline (table of contents) and the footer. Change those, so every page inherits the result.
- Use CSS and a little plain JS. Add no scroll or animation libraries.
1. Think of the page as three layers
- The article and the footer scroll with the page.
- The page list and the outline are position: sticky. They stop where they start, so they never jump when scrolling begins, and the end of the layout pushes them up at the bottom.
- The header becomes position: fixed only after the page's opening (banner or hero) has left the screen. Before that it belongs to the page and scrolls away with it.
2. Header: it scrolls away, then comes back floating
- At the top it is clear, with no background.
- Once the reader has scrolled and the banner's bottom edge is at or above the top of the screen (getBoundingClientRect().bottom <= 0), show it as a floating bar: position: fixed; a translucent white background; backdrop-filter: blur(18px); a soft shadow.
- It enters in 320ms ease-out, from translateY(-24px) with blur(8px) and opacity 0. It leaves in 120ms when the reader scrolls back up to the banner. If the reader scrolls down again during the exit, cancel it and keep the bar.
- Give headings a scroll-margin-top so anchor links never land under the bar.
3. Page list: it scrolls on its own, and shows where there is more
- Hide its scrollbar and let it scroll by itself.
- Fade an edge only while more of the list waits beyond it. Toggle data-more-above and data-more-below on scroll and resize, and drive a mask-image: linear-gradient(...) with them: about 40px at the top and 56px at the bottom, each with a short fully clear strip at the very edge, so a half-cut row never shows as a faint line.
- Add a small round arrow on each edge that has more. A click scrolls the list by 60% of its visible height, smoothly. Arrows are for the mouse only (tabindex="-1", aria-hidden="true"); keyboard focus already scrolls the list.
- On load, bring the current page into view. Keep the list's scroll position in sessionStorage, so moving to another page does not reset it.
- If there is a search box, let "/" focus it.
4. Outline: mark the section being read
- The current section is the last heading above a line 20% down the viewport.
- Mark its link with aria-current="location" and style that: border-left-color and text in the accent colour.
- Update it on scroll, at most once per animation frame.
5. End of the article: help first, then the next page
- If the reader is still stuck, a "Still need help?" card with one or two real channels (the issue tracker, the community, a contact).
- Then previous and next links, with each page's title. The first page links back to the home page.
- Then the footer.
6. Narrow screens
- Hide the outline on tablets and the page list on phones. Put both in one bar fixed at the bottom: the page list on its left half, the outline on its right half.
- The right half shows the name of the section being read, updated by the same 20% line, and truncated with an ellipsis when it is long.
- A tap on either half opens its list as a sheet from the bottom edge (a dialog opened with showModal()), sliding up 24px as it fades in, with no dimming behind it. Mark the current entry and scroll it into view (scrollIntoView({ block: "center" })).
- A tap on an entry, the close button, outside the sheet or Esc closes it; a section link then scrolls to its heading.
- Make the tap targets one size up from the desktop list.
7. Motion
- Under prefers-reduced-motion: reduce, turn off smooth scrolling and the header's enter and exit animations.
8. When done
- List every file and selector you changed.
- Check four states on my own pages: the top of a page, the middle, the end, and a phone-width window.
- Show a screenshot of each.




















