Communitygithub.com

kubai-holo-card

Turn identity or collectible cards (membership cards, tickets, badges, profile cards) in your product into holographic cards that tilt in 3D toward the pointer, with iridescent foil and glare moving with the light, depth-based parallax inside, a subtle idle sway, and a click-to-flip reveal with visible thickness. Includes recommended parameters for Prism, Rainbow, Pearl, Sparkle, Chrome, and Etched finishes, plus presets for feel, thickness, flip, and depth layers.

What is kubai-holo-card?

This AI agent skill automatically transforms a single card element (like a membership card, ticket, badge, or profile card) in the user's product into a sophisticated holographic card with interactive 3D effects. It works by asking the user a series of guided questions (the card to enhance, finish type, feel, interactions, flip behavior, depth, and background) before generating the code. The skill supports six finishes (Prism, Rainbow, Pearl, Sparkle, Chrome, Etched) with detailed CSS gradients and blending parameters, and includes presets for tilt strength, idle sway, flip spring, and parallax depth. It builds the card inside the user's existing code and design system (DOM, native views, or GPU renderer), preserving all existing functionality while adding the holographic effects. The skill is designed for use with web and mobile platforms that support pointer/touch input, CSS transforms, and spring-based animations.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/kubai087/vibedesign-skills/tree/HEAD/skills/kubai-holo-card

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Tilt & Flip Holographic Card

999 Tips to Make Your Vibe Product More Premium – Issue 018 · @kubai087

Modify the user's project as described below. The description is written from the user's perspective: "I", "me", "my" refer to the user; where it says "ask first", stop and ask the user before proceeding.

Modification Requirements

Turn a card in my product into a holographic card: it tilts toward the pointer in 3D, a foil finish and a glare follow the light across it, the artwork inside has depth, it sways a little when left alone, and (if I want) it turns over on click to show its back, with a visible edge. Build it inside my code and design system; do not change what the card says or does.

Every value in this prompt is a recommendation, not a requirement. Sections 1 to 7 give a full set that works together (the "Standard" values, tested in a demo); section 9 gives presets around them. I choose; you build what I choose.

First look at my product (section 0). Then ask me these one at a time. For each, show the options in a short list with their key values, mark the recommended one, and wait for my answer; I may pick an option, change single values, or give my own:

  1. Which card: the one element that stands for status or ownership (a member or loyalty card, a ticket or pass, a badge or achievement, a profile or collectible card, a plan tier). Holographic effects lose their meaning when everything shines, so one card per screen.

  2. Finish: one of the six in section 3 (Prism recommended), several to choose from (for tiers or rarity), or my brand colors (then derive the base, foil, glare, rim and edge from them and show me the values).

  3. Feel: Quiet, Standard (recommended) or Lively (section 9), or my own tilt angle, springs and sway.

  4. Interactions: tilt toward the pointer (on), the idle sway (on), turning over on click (needs a back: say what goes on it, such as a QR code or terms), tilting with the phone's motion on mobile (off; needs permission on iOS).

  5. If it turns over: the thickness (Thin, Standard recommended, Thick) and the flip spring (section 9).

  6. Depth: which parts of the card's artwork get their own layer, and how deep (None, Subtle, Standard recommended; section 9).

  7. Background: leave the page behind the card as it is (recommended for most products), or add the slow fluid behind it (section 7). Then sum up my choices with their values in one table, propose how you will build it on my platform (section 8 is a starting point), with the cost and any fallback, and wait for my go-ahead.

  8. Start from what exists

  • Find the card: its component, size, corner radius, artwork and content, where it sits, and what is around it. Check whether a back already exists (terms, a code, details).
  • Find how the screen draws (DOM, a native view tree, a GPU renderer), the platform version range, whether there is a dark mode, and how pointer and touch input reach the card.
  • Tell me in a few lines what you found before asking.
  1. Tilt and light (Standard)
  • With the pointer at (fx, fy) in 0..1 across the card, nx = fx * 2 - 1 and ny = fy * 2 - 1, the target is rotateY = nx * 12deg and rotateX = -ny * 12deg. Perspective 1600px on the card's parent.
  • The tilt follows its target on a spring, so it overshoots a little when the pointer leaves: acceleration = 140 * (target - angle) - 15 * velocity, per second.
  • The light sits where the pointer is (lx = fx * 100%, ly = fy * 100%) and follows on a spring without overshoot (stiffness 160, damping 2 * sqrt(160) ≈ 25.3). With no pointer on the card, it rests up and to the left (34%, 22%), like a lamp in the room.
  • Hover strength on goes from 0 to 1 while the pointer is on the card, easing at 1 - exp(-7 * dt) per frame; it brightens the foil and the glare.
  • Left alone, the card sways as if held: rotateX = 2.2deg * sin(0.9t + 0.6) + 0.8deg * sin(2.3t), rotateY = 3.2deg * sin(0.7t) + 0.9deg * sin(1.9t + 1.2), t in seconds, and the light moves with it (lx = 34% + rotateY * 3, ly = 22% - rotateX * 3).
  • Touch: dragging on the card tilts it the same way (touch-action: none on the card only). Phone motion, if chosen, maps the device's tilt to the same target, clamped to the same angles.
  • The shadow under the card: a blurred ellipse (black at 60%, blur 24px, 84% of the card's width, 70px tall, 30px below it) that slides away from the side that lifts: x = -rotateY * 1.8px, y = rotateX * 1.2px.
  1. The layers of a face, back to front
  • Art: the card's own base color or picture.
  • Foil: the finish (section 3), blended over the art, brightest near the light.
  • Print: everything printed on the card (text, logo, artwork window), above the foil so it stays readable.
  • Glare: a radial gradient centered on the light, white at 60% in the middle, 14% at 28%, then black at 30% at 95% (farthest corner), blended with overlay; opacity 0.35 + on * 0.65.
  • Rim: a 1.5px ring around the edge (mask with content-box exclude): a faint base color all round, plus a radial gradient at the light in the rim's light color, fading out by 42%; opacity 0.6 + on * 0.4. It should come and go as the card moves, never read as a solid outline.
  • A hologram seal, if the card has a place for one: a 44px disc, conic-gradient(from , rgb(255 154 200), rgb(255 224 138), rgb(164 255 207), rgb(143 220 255), rgb(183 155 255), repeated twice), with fine rings over it (white at 35%, 1px every 3.5px) and a 1px white rim at 60%. The angle = atan2(ly - 50%, lx - 50%) * 1.5 + rotateY * 6.
  • Corners: 32px on a 440 x 616 card (scale with the card), on a continuous curve where the platform has one.
  1. Finishes (recommended values; pick, mix or derive from my brand) Each lists: base, foil, glare and rim if they differ from section 2, ink, edge color (for the thickness), and the glow behind the card (section 7).
  • Prism (recommended): deep blue glass lit from inside.
    • Base: radial-gradient(60% 40% at 50% 0%, rgb(90 150 255 / 0.55), transparent), linear-gradient(170deg, rgb(13 35 168), rgb(8 18 102) 55%, rgb(22 15 92)). Ink rgb(244 244 246).
    • The artwork window holds the light: radial-gradient(46% 50% at the light, rgb(255 175 235) at 0.55, 0.4 at 18%, 0.22 at 38%, 0.09 at 60%, 0.02 at 82%, transparent), radial-gradient(54% 56% at (100% - lx, 74%), rgb(125 225 255) at 0.45, 0.32 at 18%, 0.17 at 38%, 0.07 at 60%, 0.015 at 82%, transparent), radial-gradient(70% 55% at 30% 100%, rgb(150 255 210 / 0.3), transparent 75%), over linear-gradient(170deg, rgb(59 98 230), rgb(42 63 191) 55%, rgb(58 47 168)). Many stops, so it reads as glow, not spots. Its frame: rgb(140 170 255 / 0.1) with a 1px line at rgb(170 200 255 / 0.28).
    • Foil: a 2px lit rim, radial-gradient(at the light, rgb(170 220 255 / 0.9), transparent 60%), masked to the ring; opacity 0.15 + on * 0.45. Glare opacity 0.25 + on * 0.45.
    • Edge rgb(26 42 138). Glow hue 228.
  • Rainbow: bands of color that slide as it tilts.
    • Base: radial-gradient(130% 80% at 25% 0%, rgb(59 62 76), rgb(27 28 35) 62%). Ink rgb(245 245 247).
    • Foil: repeating-linear-gradient(115deg, rgb(255 95 126) 0%, rgb(255 184 107) 2.6%, rgb(244 255 107) 5.2%, rgb(107 255 181) 7.8%, rgb(95 210 255) 10.4%, rgb(139 123 255) 13%, rgb(255 107 214) 15.6%, rgb(255 95 126) 18%), background-size 200%, background-position at the light, under a grating repeating-linear-gradient(125deg, transparent 0 2px, rgb(0 0 0 / 0.3) 2px 3px); mix-blend-mode color-dodge, filter brightness(0.72) saturate(1.25), opacity 0.3 + on * 0.6, masked by radial-gradient(farthest-corner at the light, rgb(0 0 0) 5%, rgb(0 0 0 / 0.16) 72%).
    • Edge rgb(42 44 53). Glow hue 285.
  • Pearl: a white card with a pastel sheen, strongest toward its edges like a frame.
    • Base: linear-gradient(160deg, rgb(253 252 255), rgb(241 238 248)). Ink rgb(23 21 46).
    • Foil: linear-gradient(115deg, rgb(255 196 225) 0%, rgb(201 184 255) 12%, rgb(180 233 255) 24%, rgb(194 255 216) 36%, rgb(255 243 184) 48%, then the same again), background-size 260%, position at the light, multiply, opacity 0.7 + on * 0.3, masked by radial-gradient(70% 60% at 50% 45%, rgb(0 0 0 / 0.35) 30%, rgb(0 0 0) 100%).
    • Glare: soft-light, white at 90% fading out by 55%, opacity 0.5 + on * 0.5. Rim: base rgb(60 50 120 / 0.06), light white at 95%.
    • Edge rgb(230 226 242). Glow hue 300.
  • Sparkle: fine glitter.
    • Base: radial-gradient(120% 80% at 75% 5%, rgb(40 51 106), rgb(16 20 43) 65%). Ink rgb(238 240 255).
    • Glitter: a 240px tile of about 950 dots, radius 0.45 to 1.85px (most small), alpha 0.35 to 1, used as an alpha mask.
    • Foil, blended with screen, two layers, each masked by the glitter (the second offset by 117px, 71px) and by radial-gradient(at the light, rgb(0 0 0), rgb(0 0 0 / 0.3) 45%, rgb(0 0 0 / 0.12)): first: repeating-linear-gradient(60deg, rgb(255 139 210) 0 3%, transparent 5% 8%, rgb(139 243 255) 10% 13%, transparent 15% 18%, rgb(255 243 139) 20% 23%, transparent 25% 28%), size 260%, position (lx * 1.6, ly); second: repeating-linear-gradient(-35deg, rgb(169 139 255) 0 3%, transparent 5% 9%, rgb(139 255 196) 11% 14%, transparent 16% 20%, rgb(255 255 255) 22% 24%, transparent 26% 30%), size 260%, position (100% - lx, ly * 1.4). The dark gaps make each fleck light at its own angle and go out again.
    • Edge rgb(26 32 72). Glow hue 235.
  • Chrome: a silver mirror whose highlights travel against the tilt.
    • Base: linear-gradient(125deg, rgb(228 230 234) 0%, rgb(141 147 158) 16%, rgb(246 247 249) 30%, rgb(124 130 141) 46%, rgb(217 220 225) 60%, rgb(148 154 165) 76%, rgb(241 242 244) 100%), background-size 220%, background-position (100% - lx, 100% - ly). Ink rgb(27 29 36).
    • Foil: linear-gradient(115deg, rgb(255 143 199), rgb(255 226 143) 14%, rgb(149 255 208) 28%, rgb(143 214 255) 42%, rgb(192 155 255) 56%, then again), size 240%, position at the light, overlay, opacity 0.3 + on * 0.35.
    • Glare: soft-light, white at 85%, 10% at 30%, black at 18% at 95%. Rim: base white at 18%, light white at 95%. An engraved look for printed lines: text-shadow 0 -1px 0 rgb(60 64 76 / 0.55), 0 1px 0 rgb(255 255 255 / 0.95).
    • Edge rgb(180 184 194). Glow hue 200.
  • Etched: a pattern you only see in the light.
    • Base: matte rgb(18 18 20) with fine concentric rings, repeating-radial-gradient(circle at the artwork's center, rgb(255 255 255 / 0.05) 0 1.2px, transparent 1.6px 7px). Ink rgb(237 237 238).
    • Foil: linear-gradient(115deg, rgb(255 95 126), rgb(255 184 107) 10%, rgb(244 255 107) 20%, rgb(107 255 181) 30%, rgb(95 210 255) 40%, rgb(139 123 255) 50%, then again), size 300%, position at the light, masked by the same rings and by radial-gradient(at the light, rgb(0 0 0), rgb(0 0 0 / 0.5) 18%, transparent 42%); opacity 0.25 + on * 0.75. Glare opacity 0.2 + on * 0.4.
    • Keep the artwork window a plain matte panel (radial-gradient(70% 60% at 50% 35%, rgb(29 29 33), rgb(15 15 17))) so the rings stop at it.
    • Edge rgb(27 27 30). Glow hue 190.
  • On every finish, the rim's base color is white at 5% unless listed, and its light color white at 50%. Text stays readable at every angle: check the lightest and darkest moment of the foil under it.
  1. Turning over (only if chosen; Standard values)
  • A click (or tap, or Enter and Space when focused) turns the card 180deg around its vertical axis on a spring (stiffness 70, damping 11), so it settles with a small overshoot in about 0.8s; the same again turns it back.
  • It lifts toward the viewer while it turns: translateZ(|sin(angle)| * 40px); the shadow narrows by up to 45% and drops 14px at edge-on.
  • Thickness 10px: the front sits 5px in front of the card's middle and the back 5px behind it, turned 180deg, both with backface-visibility hidden; between them, 10 copies of the card's outline in the finish's edge color, evenly spaced. Draw the edge only while turning.
  • The back carries the same finish, glare and rim, with the light mirrored (lx becomes 100% - lx). Lay it out on the same margins as the front.
  • Anything that changes the front (another finish, new content) changes while the card is edge-on, so it is never seen switching.
  1. Depth inside the artwork (Standard values)
  • Give each part of the artwork its own depth d behind the card's face (negative: in front of it), and move it by d * sin(angle): x = -d * sin(rotateY + turn), y = d * sin(rotateX). This is what real 3D would do.
  • In the demo: the picture behind it 90px, the compass dial 50px, its middle ring 34px, the dashed ring 20px, the needle 12px in front (-12); the print in the corners sits on the surface and does not move. Draw the backmost layer larger than its window (100px on each side) so its edges never show.
  • If the artwork can respond, let it: the compass needle springs toward the pointer (acceleration = 60 * angle difference - 5.5 * velocity, the short way round) and drifts by 12deg * sin(0.77t) + 6deg * sin(2.16t) when left alone; the dial turns 9deg a second and the dashed ring 18deg a second the other way. Small, slow, and one moving idea.
  1. Rhythm and accessibility
  • Hover in and out, tilt and light are continuous; the flip settles in about 0.8s.
  • Switching finishes: cross-fade the faces over 420ms, or swap them while edge-on during a flip.
  • Reduced motion: no tilt, no sway and no flip animation (the flip becomes an instant swap or a 200ms cross-fade); the light may still follow the pointer; the background stands still.
  • The card keeps its role: a link or button stays one, the back is reachable by keyboard and announced, and nothing important is only visible at one angle.
  1. The background (only if chosen)
  • A glow behind the card: radial-gradient(closest-side, hsl(<finish's hue> 85% 64% / 0.3), transparent), 860px across, its opacity (0.04 + 0.12 * on) / 0.3.
  • A slow fluid behind it: value noise in fBm (4 octaves, each turned by the matrix (1.6, 1.2; -1.2, 1.6), amplitude halving), warped twice: p = position / height * 1.25 + flow; q = (fbm(p), fbm(p + (5.2, 1.3) - flow.yx)); r = (fbm(p + 3.5q + (1.7, 9.2) + 1.3 * flow), fbm(p + 3.5q + (8.3, 2.8) - flow)); f = fbm(p + 3r). Color = mix(a, b, clamp(2.4f²)), then mix toward c by clamp(0.95 * |q| - 0.35), times 0.5 + 1.1f². Fade to the page color with smoothstep. The palette a (#1a0a2e), b (#0f3460), c (#16213e) by default; from the finish's hue: a = hsl( + 15 50% 8%), b = hsl( 60% 18%), c = hsl( - 20 45% 12%). Speed 0.08 (scale by frame). Use a canvas or a shader.
  1. Platform hints
  • DOM with a GPU-backed compositor (every browser since 2016): CSS perspective and transform-style: preserve-3d; springs in a requestAnimationFrame loop. Cards lay out normally; the card element becomes the face. The back and edge are children of a wrapper. Web Animations API for the idle sway. Clip the light gradient to the card via overflow: hidden. Reduced motion: prefers-reduced-motion media query.
  • If the platform is React (JavaScript or TypeScript): a useSpring wrapper around the tilt state and the flip state; the finishes are CSS class names with custom properties for the light position; the depth layers are a map of translate3d transforms. Do not add any dependency – use the DOM directly.
  • If the platform is a native mobile view tree (SwiftUI or Jetpack Compose): Compute the perspective projection on the parent, apply rotation3DEffect (SwiftUI) or rotateY/rotateX on graphicsLayer (Compose); light position as a clip on a RadialGradient; springs with Animation.spring (SwiftUI) or animateFloatAsState with spring spec (Compose). The back and edge are overlays or sibling views.
  • If the platform is a GPU renderer (Unity or Godot): a Billboard shader that tiles the static layers (base, foil, print, rim, seal) into one material, with the light gradient as a uniform; the card is a 3D quad. The tilt and flip are Quaternion.Slerp toward the target. The edge is a separate extruded mesh.
  • Every platform: limit to 60 fps. Skip the seal or the depth if it would be heavier than it is worth. Time the spring steps with the frame's delta.
  1. Presets All presets use the section 1 tilt and light unless noted.
  • Quiet: max tilt 8deg, perspective 2000px; tilt spring acceleration 80 * diff - 11 * velocity; sway reduced to 1/3 amplitude; idle light stays at (34%, 22%) without following the pointer when the pointer is off the card; no hover strength; glare opacity fixed at 0.25; rim opacity 0.5.
  • Lively: max tilt 18deg, perspective 1000px; tilt spring acceleration 200 * diff - 18 * velocity; sway increased by 1.6×; hover strength brightens to the max twice as fast (1 - exp(-14 * dt)); spin: a 0.02% chance per frame the card twirls 360deg around the vertical axis in 12 frames (how: use the existing spring, set the target 360deg away for one frame, then back).
  • Thickness presets (only for flip): Thin: 4px total (front 2px in front, back 2px behind, 4 edge copies); Standard: 10px (as in section 4); Thick: 20px total (front 10px in front, back 10px behind, 20 edge copies). Reduce the edge copy count to one every 2px if 20 copies is too many.
  • Flip spring presets: Snappy: stiffness 120, damping 16 (flip in about 0.5s). Standard: stiffness 70, damping 11 (about 0.8s). Relaxed: stiffness 40, damping 9 (about 1.2s).
  • Depth presets: None: all artwork stays on the surface. Subtle: maximum depth 45px (the picture 30px, the main layer 16px, the highlight detail 8px, the fine detail 4px). Standard: maximum depth 90px (as in section 5). Deep: maximum depth 160px (the picture 110px, the main layer 60px, the highlight detail 30px, the fine detail 15px).
  1. Parameters all in one place | Parameter | Standard | Quiet | Lively | |-----------|----------|-------|--------| | max tilt | 12deg | 8deg | 18deg | | perspective | 1600px | 2000px | 1000px | | tilt spring acc | 140 | 80 | 200 | | tilt spring damp | 15 | 11 | 18 | | sway amplitude | 1× | ⅓× | 1.6× | | idle light follow | on (spring) | off | on (spring) | | hover strength | 1 - exp(-7 dt) | 0 (no effect) | 1 - exp(-14 dt) | | glare base | 0.35 + on * 0.65 | 0.25 | 0.35 + on * 0.85 | | rim base | 0.6 + on * 0.4 | 0.5 | 0.6 + on * 0.4 | | spin | none | none | 0.02%/frame | | thickness (flip) | 10px | – | – | | flip acc | 70 | – | – | | flip damp | 11 | – | – | | depth max | 90px | 45px | 160px | | fluid palette | a: #1a0a2e, b: #0f3460, c: #16213e | – | – | | fluid speed | 0.08 | – | – |

  2. Terms

  • The finish's ink is the color for printed text when the printed content is placed on top of the finish and there is a visible print layer. For finishes that have an explicit "Ink" field, use it as the text color on the card.
  • "On" means the hover strength, a smoothed 0..1 value that rises while the pointer is on the card.
  • A card's artwork window: the area inside a card where an image or illustration is inset, often framed in a cutout or rectangle.
  • Edge: the visible side of the card's thickness (only drawn while flipping).
  • Base: the main background layer of the finish.
  • Rim: the edge glow ring around the card face.
  • Foil: the reflective coating.
  • Glare: the glossy reflection.
  • Seal: a round holographic sticker.
  • Sway: the small idle motion when the pointer is off the card.
  • Reduced motion: a system or user setting that replaces animations with static or minimal transitions.
  • Intersection Observer: a browser API used to detect when an element enters or leaves the viewport.
  • DOM: Document Object Model.
  • GPU: Graphics Processing Unit.
  • Spring: a physics-based animation model with stiffness and damping.
  • CSS: Cascading Style Sheets.
  • fBm: fractional Brownian motion, a noise generation technique.
  • Octave: a layer of noise at a specific frequency and amplitude.
  • Quad: a quadrilateral mesh in 3D rendering.
  • BillBoard shader: a shader that always faces the camera.
  • prefers-reduced-motion: a CSS media query for reduced motion preference.
  • touch-action: none: a CSS property to disable default touch behaviors on an element.
  • requestAnimationFrame: a browser API for smooth per-frame animations.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

kubai-book-cards

卡片在悬停或聚焦时像书一样翻开一定角度,显示里面的内页,静止时外观保持不变。提供普通卡片、拟物精装书和极简文档三种风格。适用于文档、知识库、作品集和模板市场(book hover cards)。

kubai-easing-curves

按使用场景为项目中的动画设置缓动曲线和时长:入场用 ease-out,离场用 ease-in,位置变化用 ease-in-out,小的确认反馈用 overshoot,拖动松手后用 spring,并统一为动效 token(easing, motion curves)。

kubai-liquid-glass

为图片、壁纸或视频上方的卡片和面板添加液态玻璃材质:背景模糊与提亮、边缘折射与色散、根据背景自动调整的着色和文字颜色,深色和浅色模式下文字都清晰可读,布局保持不变(liquid glass, glassmorphism)。

kubai-scroll-cards

改造现有长页面:选出值得讲的段落,用五种由滚动驱动的卡片交互呈现——层叠卡片(新卡片逐张盖住旧卡片,旧卡片缩小、变暗)、卡组飞出(顶部卡片向一侧甩出,下一张顶上来)、横向展廊(页面固定,纵向滚动推动横向作品集)、封面轮播(中间一张最大,两侧缩小、转开、变暗)、图片展开(小图铺满屏幕,标题从景物后升起形成景深)。效果全部由滚动位置驱动,读者控制节奏,回滚即倒放,不劫持滚动;尺寸按不同屏幕和视窗高度计算,手机工具栏不会挡住内容,矮屏自动退回普通段落。附多档预设,开始前逐项询问,由你选择或调整,确认后按现有技术栈实现(scroll-driven animation, sticky, cover flow, svh)。

Related Skills