环形绕字
Circular Text
字母按均匀间距沿中心图案排成一圈,整圈文字缓慢旋转。
适用场景
给徽章、唱片封面或品牌印章排一圈短文案。 给短语留出足够大的圆环半径,并检查首尾相接处的间距。
应用示例
唱片厂牌把名字排在封套的圆形插画外侧,一圈文字围绕固定的中心标志慢慢转动。
也叫
- 环形文字
- 圆形排字
AI 提示词
把【短语】沿【徽章或图片】外围排成圆环。保持字距均匀,让文字环缓慢旋转。减少动态效果模式下保持圆环排版并停止旋转。
示例代码
保存为 HTML 文件后,用浏览器打开即可运行。代码与页面里的演示一致。
查看 HTML
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>环形绕字</title>
<style>
:root {
color-scheme: dark;
--demo-bg: #171629;
--demo-ink: #f8f5ff;
--demo-accent: #b9a6ff;
--demo-muted: #bfbbd3;
font-family: system-ui, sans-serif;
color: var(--demo-ink);
background: var(--demo-bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
.demo {
display: grid;
place-items: center;
align-content: center;
min-height: 100vh;
padding: 14px;
overflow: hidden;
background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
}
.demo-button {
border: 1px solid #ffffff3d;
border-radius: 7px;
background: #ffffff12;
color: var(--demo-ink);
padding: 6px 11px;
font-size: 12px;
cursor: pointer;
}
:focus-visible {
outline: 2px solid var(--demo-accent);
outline-offset: 3px;
}
.demo { background: radial-gradient(ellipse at 50% 32%, #2d4688, #101c39 78%); }
.seal { display: block; width: clamp(108px, 67vh, 196px); max-width: 100%; filter: drop-shadow(0 9px 20px #030a2290); }
.seal-lettering {
fill: #ffddad;
font: 720 13px/1 system-ui, sans-serif;
text-transform: uppercase;
transform-box: view-box;
transform-origin: center;
animation: rotate-seal 16s linear infinite;
}
@keyframes rotate-seal { to { transform: rotate(1turn); } }
.motion-example { display: grid; place-items: center; gap: 12px; }
.motion-example [data-motion] { animation-play-state: paused; }
.motion-example[data-playing] [data-motion] { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) {
.motion-example [data-motion] { animation: none; }
.motion-example button { display: none; }
}
</style>
</head>
<body>
<main class="demo">
<div class="motion-example">
<svg class="seal" viewBox="0 0 180 180" role="img" aria-label="让文字转起来">
<defs><path id="letter-ring" d="M90 21a69 69 0 1 1 0 138 69 69 0 1 1 0-138z"/></defs>
<circle cx="90" cy="90" r="84" fill="#101d42" stroke="#c5d7f3" stroke-opacity=".43"/>
<circle cx="90" cy="90" r="54" fill="#20366d" stroke="#c5d7f3" stroke-opacity=".52"/>
<circle cx="90" cy="90" r="43" fill="none" stroke="#bac8ff" stroke-opacity=".27" stroke-dasharray="1 5"/>
<path fill="#f9cfa0" d="M90 51q5 34 39 39-34 5-39 39-5-34-39-39 34-5 39-39z"/>
<circle cx="90" cy="90" r="6" fill="#20366d"/>
<text class="seal-lettering" data-motion><textPath href="#letter-ring" textLength="423" lengthAdjust="spacing">让文字转起来 ✦ 让文字转起来 ✦ 让文字转起来 ✦ </textPath></text>
</svg>
<button class="demo-button" type="button" data-testid="effect-demo-loop-toggle">播放演示</button>
</div>
</main>
<script>
const example = document.querySelector('.motion-example');
const toggle = example.querySelector('button');
toggle.addEventListener('click', () => {
const playing = example.toggleAttribute('data-playing');
toggle.textContent = playing ? "暂停演示" : "播放演示";
});
</script>
</body>
</html>UI Skills 原创示例