旋转唱片头像变身播放卡
点旋转的 CD 头像后,毛玻璃播放卡带轻微过冲滑入,下方顶栏糊成残影,唱片变大并以 190°/s 转动。暂停时唱片停转、标题左移。有 Demo 循环和 Interactive 两种模式。
灵感来自 @proskuaaa 在 X 上发布的设计由 Now In Code 从零重建
import { Piece } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "spinning-disc-to-now-playing-card" to this project. The full source is attached at the end of this prompt. Put the files under components/spinning-disc-to-now-playing-card/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Pro 作品。提示词包含完整源码。开始使用
详情
- 平台
- iOS、Android
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年11月4日
- 许可证
- 无限商业项目
- 原始设计
- @proskuaaa(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个标题行,包含位置标签、地图图标、搜索按钮,以及一个缓慢旋转的圆形黑胶风格头像。点击头像后,一张磨砂的正在播放卡片从右侧滑入并覆盖在标题行上,卡片后方的文字和图标会透过玻璃模糊。唱片随卡片移动,从头像尺寸放大为更大的唱片,锚定在卡片顶边,并被卡片圆角的左侧裁切。播放时唱片旋转。按下暂停会放大按钮、停止唱片、把唱片向卡片边缘收拢,标题左移,暂停图标交叉淡化为播放图标。按下播放则反向执行。关闭按钮使卡片滑走,头像以弹簧回弹。
实现方式
共享的纯 JavaScript 核心提供一个函数,接收当前时间和点击事件记录,返回该帧中每个位置、缩放、不透明度和旋转值。React Native 组件运行 requestAnimationFrame 循环,把结果交给 react-native-svg 绘制唱片、图标和文字,并在卡片后方放置 expo-blur 的 BlurView 以实现磨砂玻璃效果。时序是弹簧与短促缓动补间的组合,在核心中计算,而不是使用原生动画库。
适用场景
- 音乐或播客应用中从标题栏或标签栏展开的迷你播放器
- 任何从顶栏打开临时卡片的控件,例如通话或计时器状态
- 暂停与播放需要在封面上显示明显状态变化的播放控制
依赖
expo-blurreact-native-svgreact-native标签
模糊过渡卡片图标液态玻璃播放器音乐音频按压反馈旋转弹簧状态切换