✨ 景深环形卡片与流体渐变——《999 个小技巧,让你 Vibe 的产品更有质感》021 今天分享一组具有空间感的卡片效果。可以让你的卡片轮播更生动一些——带有景深、边缘扭曲与色散 Prompt 随附 ⬇️ ,可以直接抄,能获得与视频中同样的参数逻辑与滑块 实现这类效果,有以下几个要点: 1. 两种视角:卡片沿同一条弧线排开,改变曲率的正负即可在环内、环外之间切换,切换时整排卡片平滑弯曲。 2. 环内:透视 860px,两侧卡片更近、更大,向内包围,一屏可见五张。 3. 玻璃边:画面两侧各 160px,越靠外缘偏移越大,卡片边缘向外张开,并带有柔和的色散。 4. 环外:透视 1500px,正中清晰,两侧和后排逐渐模糊、淡化。 5. 流体与翻面:正面是缓慢流动的四色渐变;切到环外时,卡片从中间向两侧依次翻面,露出图片。 透视、玻璃边、色散、景深、流速和圆角都做成了滑块,默认值即视频中的效果,可以按需调整。 001–021 期均收录在主页 Highlights,栏目每日更新,期待你的推荐!🫶 非常感谢
枯白啃设计

图标设计师 / 设计工程师

Prompt(2/3) 4. The fluid gradient - Value noise in fBm, 3 octaves; after each octave turn the point by the matrix (0.8, -0.6; 0.6, 0.8), scale it by 2.02, add (1.7, 9.2), and halve the amplitude. - With p the point on the card in pixels from its middle: uv = p / w * 0.9 + seed (seed = i * 3.7 + 0.43, so every card differs). - The flow moves the field around a circle: o1 = rho * (cos(phi), sin(phi)), o2 = rho * (cos(phi + 2.1), sin(phi + 2.1)). phi grows with time so the field moves 0.2 noise cells a second (the Flow slider, 20%); rho is the circle's radius. Because the field comes back to where it began, a recording or a loop never jumps. In the demo one turn takes the length of the animation loop (17.07s). - Warp it twice: w1 = (fbm(uv + o1), fbm(uv + (5.2, 1.3) - o1)); w2 = (fbm(uv + 1.5 * w1 + (1.7, 9.2) + o2), fbm(uv + 1.5 * w1 + (8.3, 2.8) - o2)); f = fbm(uv * 0.9 + 1.7 * w2). - Color: mix(c0, c1, smoothstep(0.3, 0.7, f)), then toward c2 by smoothstep(0.42, 0.72, w2.x) * 0.9, then toward c3 by smoothstep(0.5, 0.8, w1.y) * 0.7; a soft light across the top (toward white by smoothstep(0.1, -0.6, y / h) * 0.12); film grain of ±1.75% that fades out under blur. - Palettes, four colors each, one per card, for example: Tangerine #ff7a3d #ff3d77 #ffc46b #7a2cff; Lagoon #00c2c7 #2f6bff #9ff3e0 #0b2a6f; Peony #ff8fb1 #ffd1dc #b84dff #ff5a5f; Citrus #ffe14d #7ee081 #ff9f1c #2ec4b6; Iris #6a5cff #b18cff #ff7ad9 #1b1464; Aurora #2af598 #009efd #b3ffab #12123a. Or derive them from my brand colors and show me. 5. Inside: the glass rim - Draw the cards into a texture first, then lay it on screen in a second pass. Along each side of the frame is a band of glass, rim = 160px wide. - A pixel at distance d from its side (d < rim) shows the picture from further in: k = (1 - d / rim)^2.4, and the offset is 0.4 * rim * k across, toward the middle, along the line toward the eye point (so it also moves toward the eye's height). The cards' top and bottom edges flare out under the glass, and the flare grows smoothly from nothing at the band's inner side. - Keep 0.4 * 2.4 under 1: the band then squeezes the picture toward the edge but never folds it back on itself. A fold repeats a card, or a gap between cards, inside the glass. - Dispersion: take the offset at seven strengths, red bending furthest and blue least: for t = i / 6, i = 0..6, the offset times 1 + spread * (1 - 2t), with spread = 0.25 * k (the Dispersion slider, 25%). Weight each sample by w(t) = clamp((1.5 - 3t, 1 - 1.5 * |2t - 1|, 3t - 1.5), 0, 1) and divide by the summed weights, so the fringe runs smoothly through the colors. - A faint light along the glass: toward white by k^3 * 0.12. - The rim belongs to Inside only: it fades out as bend goes to 0, and a 0 rim switches it off. 6. Outside: depth of field - Blur b, in screen pixels, is the larger of two: across the frame, blur * smoothstep(110, half the frame's width, |screen x|)^1.4, so the middle 220px stays sharp and the blur grows smoothly toward the sides; and with distance, blur * smoothstep(0.25, 0.8, back)^1.2, where back = -z / (2R) goes from 0 at the front card to 1 at the far side. Default blur 14px. - Work the blur out per pixel, never with a backdrop blur over moving content (it shimmers). For a card, take its coverage as a box blur in screen pixels, separately across and up: across = clamp((min(dl, b) + min(dr, b)) / (2b), 0, 1), where dl and dr are the screen distances to the card's left and right sides; the same for up and down; alpha = smoothstep(across) * smoothstep(down), capped by the corners softened by the same b. A card narrower than the blur never reaches full cover and fades, as a real blur would. - Draw each card with a margin of (the largest blur + 4) screen pixels around it, so a blurred edge always has room, however steeply the card is turned. - Blur the content too: fade out the noise octaves finer than the blur, and read the pictures from a smaller mipmap level, log2(max(1, b * texels per screen pixel)). - The far side fades toward the page: toward white by fade * smoothstep(0.3, 1, back). Default fade 50%.
登录并发表评论

评论 · 0