共享元素卡片展开为音频播放页
按住精选卡片会缩小,点击后卡片铺满屏幕上半部,首页内容淡出。播放钮形变为暂停,37 根波形柱起伏,播放头经过的柱子变绿。React Native 端用 expo-blur。
灵感来自 @jenidesignns 在 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 "sharedelement-card-expand-to-audio-player" to this project. The full source is attached at the end of this prompt. Put the files under components/sharedelement-card-expand-to-audio-player/, 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月2日
- 许可证
- 无限商业项目
- 原始设计
- @jenidesignns(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个深色的播客首页,有菜单按钮、徽标、一个故事样式环形头像、一张浅绿色的推荐卡片,以及下方的两张节目卡片,底部是悬浮的标签栏。推荐卡片上是一个戴着耳机、站在彩带前的人物,底部有一条磨砂条,显示标题、剩余时间、进度条和播放按钮。页面入场时,卡片上升,页眉下落,节目卡片向上滑入。按下卡片会稍微缩小,点按它会展开到屏幕顶部。照片放大,首页内容淡出,返回和心形按钮出现,人物背后出现大号标题,标题行和波形卡片上升。播放按钮变为暂停,37 根波形条持续摇摆,并在播放头经过时改变颜色。
实现方式
共享核心提供一个帧函数,根据一组驱动器返回显示列表,由 React Native 组件用 react-native-svg 绘制。expo-blur 提供磨砂条,expo-font 加载展示字体,PanResponder 处理拖动和点按。展开是一个共享元素过渡,卡片矩形插值到全宽,其内容随之缩放。组件接受 mode 参数(demo 或 live)、用于静态画面的冻结时间,以及跳过开场动画的标志。
适用场景
- 卡片可展开为播放器的播客、有声书或音乐应用
- 展开为详情页的精选内容大图
- 显示已播放部分的波形进度条
依赖
expo-blurexpo-fontreact-native-svgreact-native标签
声波可视化头像按钮卡片图表交叉淡化深色杂志排版展开收起渐变首页图标播放器音乐音频数字滚动彩色活泼进度条内容阅读社交弹簧错峰入场状态切换滑动手势