日更栏目《999 个小技巧,让你 Vibe 的产品更有质感》 ✨ 013 有物理质感的冲击波(含扭曲与通道分离) iOS 27.3 加入了屏幕边缘的跑马灯光效,也让我想起用 Dia 时,每次打开主页都会出现的光环冲击效果,于是尝试把两者结合。 完整 Prompt 见下方评论,可直接复制使用 ⬇️ 该效果由 6 层组成: 1. 页面快照:将当前页面转为图像,作为后续各层的计算基础(可以借助 Chrome 新增的 HTML-in-Canvas) 2. 透镜扭曲:光环整体作为一个透镜,外侧拉伸、内侧压缩,表现空间被推开。 3. 通道分离:红、蓝通道的位移分别比绿色多、少 8%,在位移处形成轻微色散,同时保持文字清晰。 4. 色环:四道色环平滑过渡,随扩散逐渐淡出,决定光环的颜色与亮度。浅色模式为染色,深色模式为加光(screen 混合)。 5. 边缘折射:光环只在内容区内扩散。到达边缘时,内容如透过玻璃斜边向边缘轻微拉伸,窗框保持不变。 6. 边线反光:光环经过时,分割线与描边短暂提亮,深色模式下更弱,使页面结构也参与其中。 共 4 组配色:Aurora 蓝紫粉桃,Halo 橙黄,Frost 薄荷绿,Spark 紫金。
枯白啃设计

图标设计师 / 设计工程师

Prompt(2/4) 1. The input (only if I chose the pill) - At rest: a pill 300 x 44 px, radius 22, white (dark: rgb(30 30 33)), a 1px hairline, a sparkle icon, the placeholder "Ask AI about this project" in 14px and a shortcut hint on the right. It sits centered on the page's content, 48px above the page's bottom. - On click: the pill dips to 97% for 90ms, then springs open into a card 460 x 100, radius 16, growing from its center and keeping its bottom edge where it was. Spring: progress = 1 - exp(-8t) * cos(6t) over 580ms (barely past the end, settles by the end). The card's content is laid out at its final size from the start and is revealed as it grows; it fades in from 30% of the way. Height and radius follow the same progress. - The open card: one line of text at 15px on a 22px line, 16px from the left, the caret first and the placeholder right after it; a hairline; then a toolbar 52px tall: a round add button, a short divider, two pickers (model, mode), and on the right a voice button and the send button, all 32px. - Shadow: wide, soft and far, not heavy: 0 0 0 1px rgb(15 23 42 / 0.09), 0 2px 4px rgb(15 23 42 / 0.04), 0 28px 64px -16px rgb(15 23 42 / 0.22). No focus ring; focus shows only as the caret. - The metal edge: a 1px border painted with a light silver gradient, linear-gradient(120deg, rgb(238 240 243), rgb(196 202 210) 28%, rgb(241 243 245) 50%, rgb(188 195 204) 74%, rgb(233 236 239)) (dark: rgb(74 79 87) to rgb(51 55 61)), with a highlight on top: conic-gradient(from <angle>, transparent 0 280deg, rgb(255 255 255 / 0.8) 325deg, transparent 360deg). Turn the angle from -60deg to 300deg over 900ms (ease-out) as the card opens, and fade the whole edge in and out over that time (opacity sin(pi * t), at most 0.75). Mask the gradient to the border only (mask with content-box exclude). - Closing: back to the pill in 320ms, ease-in-out. 2. The halo's shape and timing - The halo is a circle that grows from the origin I chose. The defaults assume the origin is the AI input at the bottom of the page: the circle's center sits below the page, horizontally at the input's center and 650px below the page's bottom edge, so what shows is a wide arc rising from the bottom. - It starts with its middle at the page's bottom (radius 650) and grows by 800px over 1000ms, so it ends just past the page's top: radius = 650 + 800 * (1 - 2^(-9t)) / (1 - 2^(-9)). That is very fast at first and slow near the far edge. - For another origin, keep the same timing and set the start and the growth so the halo starts at the origin and ends just past the farthest edge of the area: from a point inside the area, center the circle on the point and start at a radius of 0 to 40px; from an edge, put the center beyond that edge, about two thirds of the area's width away. - Strength over the same time: min(1, t / 0.03) * (1 - t^2.2), so it is gone by the end and fades over its slow last stretch. - It starts on the trigger (40ms after the input starts opening, if it opens). - It stays in the area I chose: clip it to that area, with a straight edge under any toolbar and the area's own corner radius elsewhere (12px in the demo). It must never draw over a browser or app toolbar.
登录并发表评论

评论 · 0