✨ 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(1/4) Prompt Review how my website behaves on phones and tablets, in four areas: opening it as an app from the home screen (PWA), what a tap leaves behind (the tap highlight and hover styles that stay after a tap), the page's tabs and its previous and next links, moved into bars at the foot of the screen that make way while the page scrolls, and the colours iOS Safari gives its status bar and toolbar. Then, if I want it, fix the ones I approve. Diagnose first, and change only what I approve. This is a change to my product, not a demo. Work inside my code, on my stack and with my styles. Do not add a dependency without asking. Use my product's own design language throughout: its colours, materials, radii, type, spacing, icon set and motion. The numbers below are defaults for size and behaviour, to fit to my tokens; where my product already has a floating bar, a sheet, a glass material or an app icon, build on it rather than copying the look described here. 0. Read the product first - Find every hover style: :hover in stylesheets, CSS modules and CSS-in-JS, Tailwind's hover: and group-hover: variants, and scripts that react to mouseenter, mouseover or element.matches(':hover'). - Find every element that is position: fixed or sticky and touches the top or bottom edge of the screen: headers, tab bars, toolbars, toasts, cookie bars, and full-screen layers (overlays, scrollbars drawn in script, decorative layers, sheets and drawers that cover the screen and scroll inside themselves). - Find the page's main tabs or views (often across the top), its previous and next links on pages read in order, and any bars already fixed at the foot of a phone's screen, with how each behaves while the page scrolls. - Find what makes it installable today: a web app manifest, its icons, the apple-touch-icon and the head's meta tags, and a service worker. - Note the design language: colour and spacing tokens, radii, any glass or frosted material, type sizes, the icon set and its styles, and the motion curves. - Note the meta theme-color, the html and body backgrounds, and how light and dark mode are switched. - Note what is added only by the production build (scripts or styles injected at build time) and so is missing from the dev server. - Tell me in a few lines what you found before going on. 1. Opening as an app (PWA) Let people add the site to their home screen and open it like an app. a. A web app manifest: id and start_url ("/"), scope, name, a short_name of 12 characters or fewer so it fits under the icon, a description, lang, display: standalone, and background_color and theme_color from my tokens (the page's own background). Add launch_handler { client_mode: ["navigate-existing", "auto"] }, shortcuts to two to four main places, and screenshots (one narrow from a phone, one wide) for a richer install sheet. b. Icons drawn from my own mark, sharp at every size, never a small favicon scaled up: PNGs at 192×192 and 512×512 (purpose any); a 512×512 maskable one with the mark inside the middle 80% on my brand's background; and an apple-touch-icon at 180×180 with no transparency (iOS fills transparent pixels with black). c. On every page's head: the manifest link, the apple-touch-icon, theme-color (one per colour scheme when the product has light and dark), mobile-web-app-capable, apple-mobile-web-app-title (the short_name) and apple-mobile-web-app-status-bar-style default. d. Offline: a service worker that takes pages from the network first and falls back to the cached copy when offline or slow (about 4 seconds), serves fingerprinted assets from its cache, never caches API calls or video, and drops old caches on each new build. Extend the one the product has; ask before adding one. e. Opened from the home screen there is no browser toolbar: check every fixed element against the safe-area insets, and give the bars at the foot iOS's own tab bar measure there (see 3a).
登录并发表评论

评论 · 0