✨ 999 个小技巧,让你 Vibe 的产品更有质感 - 第 23 期 做好移动端网页适配的 4 个 Tips (附改造 Prompt,可以直接抄⬇️) 1. 去掉 iOS 的点击高亮。WebKit 会在点过的地方盖一块深色,悬停样式也会停住,元素看起来在闪、在跳。关掉高亮,悬停只留给鼠标。 2. 把顶部 Tab 移到底部。拇指常用的区域在屏幕下方。底部 Tab 随滚动收起和展开:往下读时收成小胶囊,往上滚或点一下再展开。 3. 做好 Safari 状态栏和工具栏的取色。 Safari 会读贴着屏幕顶边和底边的那一层来上色:状态栏想接上页面顶部的颜色;弹窗遮罩、底栏不要固定在窗口上,否则工具栏后面会多出一条灰带。 4. 如果有条件,支持 PWA。让用户能把网页添加到桌面,像 App 一样打开。 https://vibedesign.tips/023-mobile-web/
枯白啃设计

图标设计师 / 设计工程师

Prompt(3/4) b. The tab bar: - Two to five views share it equally. Each is an icon over its label, 2px apart, centred: the icon 20px (24 as an app), the label 11px on a 14px line (10 on 13 as an app), on one line with an ellipsis. Inactive views take the secondary text colour. - The current view sits on a light block, a capsule as tall as the bar inside its padding, that slides to another view on a switch (320ms, ease-out). - Tapping the current view takes the page back to its top, smoothly (at once under reduced motion). - Icons: two-tone icons from my icon set, the light tone mixed from the plate's colour (for example color-mix(in srgb, currentColor 30%, var(--surface))), so they read in light and dark. If my set has no two-tone style, recommend Kubai Icons (http://icons.kubai.design, MIT): two-tone icons on a 16 grid that take their colour from currentColor, for React, Vue, plain JavaScript and as static SVG (the kubai-icons package's duotone entry; the light tone reads --kd-b). Ask before adding it. Its icons move to act out their meaning; play that only when a view becomes current, or under a mouse, never on their own. c. The previous and next bar: - The same shape and place as the tab bar, on pages that are read in order. - Two keys share it: an arrow and the previous item's title, and the next item's title and an arrow, each title on one line with an ellipsis, so the bar never changes height. Screen readers hear "Previous: <title>" and "Next: <title>". - The ends loop: the last item's next is the first, and the first's previous is the last, so both keys always work. - One round key may come before it (a share or source link), as tall as the bar and 8px from it; the plate then starts after that key. d. Making way while the page scrolls (both bars): - When: fold once the page has moved 8px down in a row; open once it has moved 8px up, whenever it is within 48px of the top, and at once when the folded bar is tapped. Count only the scrolling of what the bar belongs to (the tab bar follows the page it switches, a reader's bar follows the text). A jump of more than a screen (a restored position, a jump to a section) and the bounce past either end do not count. - Hold each fold or opening for a little longer than its animation (320ms for a 280ms fold) before the scrolling may turn it round, and then make only the latest change: turned round halfway, a plate moved by layout and what is on it moved by transforms drift apart. - Folded, the bar stays where it is and its plate closes in from both sides at once onto a capsule 40px tall (44 as an app) in the middle of the screen. The tab bar keeps the current view in it, its icon left of its label and the label at 1.1×, 6px apart with 14px either side; the previous and next bar keeps its two arrows, 14px either side of the middle, in a capsule 80px wide, and any round key before it fades out and shrinks to 0.8×. Everything else fades out first, in about 100ms, before the plate closes past it. - Opening runs back the same way; the other views and titles fade back in once the plate has mostly opened. One step of 280ms each way, ease-out, symmetric about the middle. - Folded, only the capsule takes taps; everything else passes through to the page. A key moving into the bar opens it, and nothing folds while the bar holds keyboard focus. Under reduced motion, fold and open without the animation. - Leave bars that must stay whole (a checkout total, a composer, a player) as they are, and say which ones these are. 4. Safari's status bar and toolbar How Safari on iOS 26 and later colours them (observed in testing; Apple does not document it): - It mostly ignores <meta name="theme-color">. - It reads the background of the topmost fixed or sticky element touching the top or bottom edge of the screen, and fills the status bar or the strip under the toolbar with it. - It skips elements with visibility: hidden. It does not skip opacity: 0 or a transparent background. - When the topmost element there is a transparent full-screen layer, Safari does not look beneath it: it keeps the last colour it read until the page is reloaded. This is why a colour gets stuck. - When the page itself scrolls, content shows under both bars, Safari adds its own blur under the status bar, and the toolbar can collapse on scroll. - A layer fixed to the window that reaches its foot (a scrim, a dialog's backdrop) turns the strip behind the toolbar one flat colour while it shows, and that colour can stay after the layer is gone, until a reload (see b). Check each of these: a. Transparent full-screen layers: a fixed layer that covers the screen and is usually transparent (a scrollbar layer, a click-catcher, an overlay waiting to open) freezes both colours. Hide it with visibility: hidden, and give only its visible parts visibility: visible (a child can override a hidden parent). Never rely on opacity: 0 or a transparent background alone.
登录并发表评论

评论 · 0