// ===== demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx ===== // radial-ripple-phone-chips — Radial Ripple Chips 同心波纹手机(motion-lab 定稿转原生 Remotion) // 浅灰底同心圆多层错相呼吸如水波,中央手机 mockup 屏内 feed 缓慢自动滚动, // 两侧白色 chip 先后 spring pop 入场并悬浮。配色是灰阶骨架 + 单一强调色 //(ACCENT 变量),落地时按项目品牌色替换。 // 设计坐标 480×270(DesignStage 等比放大),参数表数值以此坐标系标定。 import React from 'react'; import { DesignStage, E, lerp, rand, seg, useT } from '../../_fixtures/Motion'; export const RADIAL_RIPPLE_PHONE_CHIPS_DURATION = 168; // 5600ms @30fps // 模板强调色:实际使用时按项目品牌色替换这一个变量 const ACCENT_RGB = '122,134,153'; // = #7a8699,中性蓝灰做默认演示色 const SANS = '-apple-system,BlinkMacSystemFont,sans-serif'; // 同心圆(深灰→浅灰,从大到小叠放),phase 错相 const RCOL = ['#d7dbe1', '#e0e4e9', '#e8ebef', '#eef0f3']; const RSZ = [560, 440, 320, 210]; const RINGS = RSZ.map((size, i) => ({ size, color: RCOL[i], phase: i * 1.7 })); // feed 卡片骨架:渐变图占位 + 两条 rand 定宽的文字条(种子与 effect.js 一致) const CARDS = Array.from({ length: 8 }, (_, i) => ({ imgGrad: `linear-gradient(120deg,rgba(${ACCENT_RGB},${(0.5 - i * 0.04).toFixed(2)}),rgba(${ACCENT_RGB},${(0.8 - i * 0.05).toFixed(2)}))`, l1w: `${62 + rand(i) * 28}%`, l2w: `${34 + rand(i + 40) * 30}%`, })); export const RadialRipplePhoneChips: React.FC = () => { const t = useT(); // chip 先后 pop:scale 0.8→1 过冲 + 淡入,随后轻浮动 const chipStyle = (t0: number, ph: number): React.CSSProperties => { const p = seg(t, t0, t0 + 0.12, E.outBack); const fl = Math.sin(t * Math.PI * 2 * 2 + ph) * 3 * seg(t, t0 + 0.12, t0 + 0.3); return { opacity: seg(t, t0, t0 + 0.08), transform: `scale(${lerp(p, 0.8, 1)}) translateY(${fl}px)`, }; }; const chipBase: React.CSSProperties = { position: 'absolute', padding: '10px 18px', borderRadius: 999, background: '#fff', color: '#2c3038', font: `600 13px ${SANS}`, whiteSpace: 'nowrap', boxShadow: '0 10px 26px rgba(58,64,74,.22)', }; return (
{/* 同心圆各层错相极缓呼吸 */} {RINGS.map(({ size, color, phase }, i) => (
))} {/* 手机 mockup:屏内 feed 缓慢自动滚动 */}
{CARDS.map(({ imgGrad, l1w, l2w }, i) => (
))}
{/* 两侧 chip:左先右后 spring pop */}
Feature one
Feature detail
); };