✨ 五种经典的卡片滚动交互——《999 个小技巧,让你 Vibe 的产品更有质感》019 今天分享五种效果出众的卡片滚动交互,适用于产品官网和个人作品集。 另附一条 Prompt,可将你产品中已有的长页面改造成同类滚动效果,直接复制即可 ⬇️ 这类交互的特别之处在于:用户滚动页面时,预期看到的是元素的纵向位移;而这些效果把滚动转化为横向、旋转甚至不规则的运动,因此给人耳目一新的感觉。 Apple 是这方面的高手,其官网常配合序列帧,实现许多令人印象深刻的效果。 这几类效果的细节如下: 1. 层叠卡片(Stacked cards):卡片随滚动逐层叠加,下层卡片依次变暗、缩小,顶部各保留一小段露出,以体现前后层次。 2. 卡组飞出(Card deck):顶部卡片沿弧线向左右两侧依次飞出,轨迹模拟真实的抛物线。 3. 横向展廊(Pinned Gallery):页面暂时固定,纵向滚动转化为横向移动,呈现与滚动方向完全不同的运动。 4. 封面轮播(Cover flow):经典的 3D 封面轮播,每张封面依次移到中间,两侧封面略微倾斜,收拢视线,使焦点更加集中。 5. 图片展开(Image Expand):小图随滚动铺满屏幕;标题与背景前后遮挡,再加上移动速度的差异,形成景深。 此外,这五种效果都由滚动位置直接驱动:停在一半,效果就停在一半;往回滚动,效果随之倒放。
枯白啃设计

图标设计师 / 设计工程师

Prompt(2/3) 3. Stacked cards (demo: 1000 x 896 viewport) - Cards 936 x 720 (all 12 columns, bled 24px so their 24px padding puts content back on the columns), corners 28px, 48px apart. - Each sticks 16px lower than the last: top = 40px + i * 16px (add a fixed header's height). Newer cards cover older ones, leaving a 16px strip of each. - A card recedes as later ones arrive: k = clamp((scrollY - when it stuck) / 752px, 0, cards after it); scale = 1 - k * 0.05 from its top center (0.85 under three), dark layer at k * 0.12. - Inside a card, the name and one line sit on columns 0 to 5 and wrap there, never into the picture; the name starts 48px below the card's top, the line 24px under it. - Give each card its own muted tint and picture (demo: stone, sage, clay, then one ink card). No shadows. - After the last card sticks, hold 320px, then the stack leaves together. - Optional opening: the section's title sized to span the grid exactly (not cropped), the first card covering its foot; it moves at half the scroll and fades out over the 280px before the first card sticks. 4. Card deck - Five cards in a pile, 432 x 456 (six columns, centred) under the title; each holds a picture 8px in, then a name and one line 24px in, nothing else. - Section 100vh + 1920px, pinned: 420px of scrolling throws each of the first four cards, then a 240px hold. The last card stays. - Card i: t = clamp((scrollY - start) / 420 - i, 0, 1). It flies to one side, alternating: x = side * t * t * 1000px, y = t * (160px * t - 40px), rotate = side * t * 16deg about its bottom center. Hidden once thrown; scrolling back returns it on the same path. - Cards below sit 18px lower and 0.05 smaller per place, dark layer 0.04 per place, at most three deep, rising a place as the top card goes. 5. Pinned gallery - 5 to 12 cards in a row: demo eight, 280 wide (four columns) and 24px apart, each a white card with its picture 8px in, then name and artist. Title above, 48px clear of the row; a 2px bar below (track 6% black, fill 30%). - Section 100vh + overflow (row width minus viewport width, 1520px in the demo); content sticky at top 0, 100vh tall. - p = (scrollY - start) / overflow; the row moves translateX(-p * overflow), no easing: scrolling turned sideways. It lets go at the last item. - Keep the pinned distance under about three screens; more items belong in a grid. 6. Cover flow - 5 to 9 square covers, 432 (six columns, centred), under the title, dots below, no text on the covers. - Section 100vh + 320px per step, pinned. r = clamp((scrollY - start) / 320, 0, count - 1); c = floor(r) + smoothstep(fract(r)), so each cover rests in the middle a moment. - For cover i, d = i - c: translateX = d * 260px, rotateY = clamp(d, -1, 1) * -30deg, scale = max(0.6, 1 - |d| * 0.2), dark layer min(|d|, 3) * 0.15, nearest on top. Perspective 1400px. Hide beyond 3.5 places. Dots light by 1 - |i - c|. 7. Image expand - Section 100vh + 1200px, pinned: 900px to grow, 300px to hold. - At the start the title and a 584 x 352 frame (columns 2 to 9, 48px below it) are centred together, corners 8px. - The picture always covers the viewport; clip-path: inset() shows the frame and opens to 0 with no corners, while the picture settles from scale 1.2 to 1, so it reads as growing. Both on e = ease(p), cubic-bezier(0.45, 0, 0.25, 1). The title fades at twice the speed and rises 60px. - Depth: cut the main shape out of the picture as its own layer (demo: the hills), set a title behind it with its foot hidden by the shape, and one small line in front. As it opens, each settles from its own scale (picture and shape 1.2, title 1.25, line 1.4). Once full, the picture and shape stay still while the title rises at 0.25 of the scroll and the line at 0.5. Something behind something, moving at another speed, reads as perspective. - Then the next section slides over it with 28px top corners that flatten over its last 120px, while the picture darkens to 35% black. A video works the same, muted and looping, only while on screen.
登录并发表评论

评论 · 0