06強調バナー — 表示状態になると枠の角度の値が増え続ける帯
バナーがビューポートに入った状態になると、ボタンの枠を巡るグラデーション角度の値が一定速度で増え続け、枠が回転しているように見えます。
使いどころランディングページ下部の行動喚起バナー、ニュースレター登録の訴求
--angleconic-gradient@property

<main class="stage" id="stage">
<section class="band">
<p class="band__text">今すぐ無料で始めましょう</p>
<div class="band__cta-wrap">
<div class="band__ring" aria-hidden="true"></div>
<button class="band__cta" type="button">無料トライアル開始</button>
</div>
</section>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop;
$easing: linear;
$color: $subject-ink;
@include stage($stage-yellow);
@property --angle {
syntax: "<angle>";
inherits: false;
initial-value: 0deg;
}
.band {
display: flex;
flex-direction: column;
align-items: center;
gap: $sp-6;
text-align: center;
}
.band__text {
margin: 0;
color: $color;
font-weight: 700;
font-size: clamp(16px, 5vmin, 22px);
line-height: 1.35;
}
.band__cta-wrap {
position: relative;
padding: 4px;
border-radius: $r-pill;
}
.band__ring {
position: absolute;
inset: 0;
border-radius: $r-pill;
background: conic-gradient(from var(--angle), $color, transparent 32%, $color);
animation: spin $duration $easing infinite;
}
.band__cta {
position: relative;
border: 0;
border-radius: calc(#{$r-pill} - 4px);
padding: $sp-3 $sp-8;
font-family: inherit;
font-weight: 600;
font-size: 13px;
line-height: 1;
color: $stage-yellow;
background: $color;
cursor: pointer;
}
@keyframes spin {
to { --angle: 360deg; }
}
@media (max-width: 340px) {
.band__cta { padding: $sp-2 $sp-6; }
}
@media (prefers-reduced-motion: reduce) {
.band__ring { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffd23f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
@property --angle {
syntax: "<angle>";
inherits: false;
initial-value: 0deg;
}
.band {
display: flex;
flex-direction: column;
align-items: center;
gap: 24px;
text-align: center;
}
.band__text {
margin: 0;
color: #17141a;
font-weight: 700;
font-size: clamp(16px, 5vmin, 22px);
line-height: 1.35;
}
.band__cta-wrap {
position: relative;
padding: 4px;
border-radius: 999px;
}
.band__ring {
position: absolute;
inset: 0;
border-radius: 999px;
background: conic-gradient(from var(--angle), #17141a, transparent 32%, #17141a);
animation: spin 2s linear infinite;
}
.band__cta {
position: relative;
border: 0;
border-radius: calc(999px - 4px);
padding: 12px 32px;
font-family: inherit;
font-weight: 600;
font-size: 13px;
line-height: 1;
color: #ffd23f;
background: #17141a;
cursor: pointer;
}
@keyframes spin {
to {
--angle: 360deg;
}
}
@media (max-width: 340px) {
.band__cta {
padding: 8px 24px;
}
}
@media (prefers-reduced-motion: reduce) {
.band__ring {
animation: none;
}
}import styles from "./CtaBand.module.scss";
// 회전하는 테두리의 각도 값(--angle)이 계속 늘어나며 conic-gradient 시작점을 돌린다.
// 계산 겹: 각도 값(--angle) -> conic-gradient 시작점 보간. 리스너 없음(자동 재생).
export default function CtaBand() {
return (
<main className={styles.stage}>
<section className={styles.band}>
<p className={styles.band__text}>지금 무료로 시작해보세요</p>
<div className={styles["band__cta-wrap"]}>
<div className={styles.band__ring} aria-hidden="true" />
<button className={styles.band__cta} type="button">
무료 체험 시작
</button>
</div>
</section>
</main>
);
}06 強調バナー — 表示状態になると枠の角度の値が増え続ける帯 — 計測 累積面積 1.011% · 動いたフレーム 23/23GODRICH オリジナル · SCSS と React は zip に同梱 · ファーストビュー アニメーション css 9選 — 統計カウンターまで
このデモが属する記事
ファーストビュー アニメーション css 9選 — 統計カウンターまでファーストビュー アニメーション cssは、9つのうち1つはカードの見える比率の値が基準を超えるたびに順番の値に間隔を掛けて現れる時点を求め直し、1つは開いた質問の回答の高さの値を内容の長さから求め直して広げ、もう1つは目標の数字までの値を この記事のデモをすべて見る


