Example
Eachexampleincludesui&videoexplanation&prettysourcecode
ctrl + f
天
气
预
报
Visible
- 千
- 里
- 之
- 行
- ,
- 始
- 于
- 足
- 下
- 。
video
TSX
export function TextRotation() {
const text = [ "千", "里", "之", "行", ",", "始", "于", "足", "下", "。" ];
const D = 360 / text.length;
return (
<div className="size-72 [--r:100px]">
<ul className="relative size-full rounded-full
animate-spin animate-duration-5000
shadow-2xl">
{
text.map((char, i) => (
<li className="absolute size-fit inset-0 m-auto"
style={ {
transform: `rotate(${ D * i }deg) translateY(var(--r))`,
} }
key={ i }>
{ char }
</li>
))
}
</ul>
</div>
)
}
Pretty
More Beautiful Ideas For You
Let's
Try
It
css-infinite-scroll
css 卡片无限滚动
001css-waterfall
图片瀑布流
002dnd-kit-sortable
元素拖拽排序
003motion-variants
多元素间隔延迟动画
004css-3d-carousel
3D图片轮播
005scroll-highlight
滚动触发视口特定区域动画
006scroll-progress
滚动进度条控制
007grid-background
渐变函数生成网格背景
008unique-button
多按钮唯一选择
009animate-text
文本动画控制
010gradient-text
文字渐变效果
011motion-layout-id
状态切换动画
012clip-path
快乐小裁缝
013margin-auto
外边距自动值技巧
014hash-encryption
哈希加密典型逻辑 [JAVA实现]
015skeleton-ui
骨架卡片实现
016exploding-text
图文爆炸效果
017