3D Arc Carousel new 立体弧形轮播 web
Items travel along a curved arc and rotate as they move; the one reaching the top centre comes into focus
条目沿一条弧线移动并随之旋转,转到正上方中央的那一个成为焦点
Discs travel along one arc; the one at the top is in focus.
标本可交互,可以直接操作。
Anatomy — every part, named解剖 —— 每个部件的名字
-
1 Arc path弧线路径
sin / cosItems are placed by angle on a large circle; the top is the focus point.
按角度把条目放到一个大圆上,最高点是焦点。
Prompt fragmentPrompt 片段items placed on a circle with x = R·sin θ and y = R·(1−cos θ)
用 x = R·sin θ、y = R·(1−cos θ) 把条目放到圆上
-
2 Focused item焦点条目
scale / z-indexThe item at the top is largest and in front; others shrink and drop behind.
最上方的条目最大、在最前;其它变小、落到后面。
Prompt fragmentPrompt 片段the top item at full size and in front, neighbours smaller and behind
顶部条目全尺寸在最前,相邻的更小更靠后
-
3 Travel spin移动自转
rotate()Each disc spins while it moves along the arc.
唱片沿弧线移动时同时自转。
Prompt fragmentPrompt 片段discs rotating in proportion to how far the carousel moves
唱片按轮播移动的距离成比例旋转
-
4 Controls操作
buttons / keys / dragPrev/next, arrow keys, wheel and drag all move one item at a time.
上一个/下一个、方向键、滚轮和拖动都一次移动一项。
Prompt fragmentPrompt 片段prev and next buttons, arrow keys, wheel and drag that snap to an item
上一个/下一个按钮、方向键、滚轮和吸附的拖动
Prompt — paste into your agentPrompt —— 直接粘贴给你的代理
Build a 3D arc carousel: place items on a large circle whose top point is the focus, using x = R·sin(θ) and y = R·(1−cos θ) for θ = (index − position)·step; items further from the focus drop lower, shrink and sit behind; each disc also rotates as it travels. Animate a continuous position toward the target with easing; support prev/next buttons, arrow keys, wheel and drag that snaps to the nearest item; auto-advance only when idle; announce the focused title. Under prefers-reduced-motion, jump without spinning.
做一个立体弧形轮播:把条目放在一个大圆上,圆的最高点是焦点,位置用 x = R·sin(θ)、y = R·(1−cos θ),θ = (序号 − 当前位置)·步长;离焦点越远越低、越小、越靠后;每张唱片移动时还会自转。用缓动让连续位置追向目标;支持上一个/下一个按钮、方向键、滚轮和拖动(松手吸附到最近一项);只在空闲时自动轮播;播报当前焦点的标题。prefers-reduced-motion 时直接切换、不旋转。
Debug prompt — when it misbehaves调试 Prompt —— 当它不听话时
Debug my arc carousel. Check that positions wrap around without a jump at the ends; the arc radius and step keep neighbours from overlapping; z-index follows distance from the focus; drag snaps to the nearest index on release; wheel input is throttled so one notch moves one item; auto-advance pauses during interaction; the caption updates with the target, not the in-between position; and reduced motion removes spinning. The symptom:
调试我的弧形轮播。检查:首尾循环时是否跳变;半径和步长是否让相邻条目不重叠;层级是否按离焦点的距离排列;拖动松手是否吸附到最近的序号;滚轮是否节流,滚一格只走一项;交互时自动轮播是否暂停;标题是否按目标序号更新,而不是中间位置;以及减少动态效果时是否去掉旋转。症状是:
In code代码里叫什么
| Framework框架 | Symbol符号 | Note说明 |
|---|---|---|
| CSS | transform: translate() rotate() scale() | place each item at an angle on a circle using sin/cos用 sin/cos 按角度把每个条目放到圆上 |
| JS | requestAnimationFrame + easing | animate a continuous position toward the target index让连续的位置值带缓动地追向目标序号 |
| Swiper | EffectCoverflow / EffectCreative | a library route for curved, rotating carousels做弧形、旋转轮播的现成库 |
| ARIA | aria-roledescription="carousel" | announce the focused item and keep arrow-key control播报当前焦点,并保留方向键操作 |