日更栏目《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(3/4) 3. The rings and the palettes - Across the halo's width sit four broad rings, one color each, inside to outside. With w = 110px and x = (distance from the center - radius) / w, ring i is centered at x = i - 1.5 with weight exp(-((x - c) / 0.8)^2); the color is the weighted average of the four, so neighbors blend softly. One fade covers all four: alpha = strength * exp(-1.1 * (x / 2)^2). - Light mode tints the page: color = mix(page, ring, alpha * 0.24) + ring * alpha * 0.24 * 0.2. - Dark mode adds light (screen): color = 1 - (1 - page) * (1 - ring * alpha * 0.3 * 1.5). - Palettes, rings inside to outside. Each is tuned twice: brighter and more saturated on dark, softer on light. Aurora (blue through violet and pink to peach) dark: rgb(80 140 255), rgb(160 110 255), rgb(255 110 180), rgb(255 190 140) light: rgb(110 150 255), rgb(180 130 255), rgb(255 130 190), rgb(255 180 120) Halo (orange through amber to gold, like low sun through a lens) dark: rgb(255 150 60), rgb(255 190 70), rgb(255 225 120), rgb(255 245 210) light: rgb(255 140 50), rgb(255 175 60), rgb(245 200 80), rgb(255 225 150) Frost (mint and aqua with a touch of lime) dark: rgb(80 220 175), rgb(70 195 225), rgb(180 240 150), rgb(235 255 245) light: rgb(40 190 150), rgb(50 170 210), rgb(140 210 90), rgb(180 235 215) Spark (violet into gold) dark: rgb(140 100 255), rgb(200 130 255), rgb(255 200 110), rgb(255 235 170) light: rgb(130 95 240), rgb(185 125 245), rgb(245 185 80), rgb(250 215 120) 4. The bend - The whole halo bends the page as one lens, never ring by ring (ring by ring reads as water ripples). With z = x * 0.75: push = 7px * 2.33 * z * exp(-z^2), along the direction away from the circle's center; read the page at position - push. Outside the halo's middle the page stretches, inside it squeezes, over about the width of the rings and no wider. - Color split: at most a trace. Read red at 1.08 times the offset and blue at 0.92 times; text must stay clean. - The frame holds the page: fade the lens to nothing over the last 56px before the page's edge, so the edge stays straight. - The page's lines catch the light: where the halo passes, its rules, borders and the outlines of chips, cards and nodes brighten toward the ring color (mixed 20% toward white), at the halo's strength times exp(-1.4 * (x / 2)^2) times 0.3 on light and 0.14 on dark (a faint glint, not a redrawn border), read at their bent position so the glint follows them. Text and icons never light up. To find the lines, use a second capture of the page with every rule and border drawn white at its own width on black, and nothing else (no text, icons, pictures, fills or shadows); light the page where that capture is white, so a 1px border glints as 1px. Without a capture (a retrofit in the DOM), give each bordered element and divider a CSS variable from 0 to 1 by its distance to the halo's front each frame, and mix its border color toward the ring color by it. - The edge as a glass bevel: at the sides and the bottom (not under a toolbar), where the halo reaches the edge, read the last 60px of the page from up to 22px further in (22 * (1 - d/60)^2 * the halo's strength there), so content beside the edge stretches toward it. Where the halo meets the edge, add a thin line of light (exp(-d / 7)) in the ring color mixed 45% toward white. 5. Rhythm - On the trigger: if the input opens, it dips to 97% for 90ms, springs open (580ms) and its edge highlight turns (900ms); the halo leaves 40ms after the opening starts and runs 1000ms. Without the input, the halo runs on the trigger. - Switching between dark and light cross-fades the halo's colors with the page; never cut. - Reduced motion: no bend, no split and no glints; the halo fades in and out in place at half strength over 600ms. - Draw only while the halo runs; nothing at rest.
登录并发表评论

评论 · 0