入力中インジケータ
3つの点が順番に跳ねる「入力中…」バブルと、相手のオンライン表示を常時ループさせたステータス演出です。返信を待つ間の安心感を演出します。
ライブデモ
コード
HTML
<!-- 入力中インジケータ: 3つの点が順番に跳ねる「入力中…」バブルと相手のオンライン表示。常時ループ -->
<div class="stage">
<section class="cti-panel" aria-label="佐々木みなみさんとのトーク">
<header class="cti-head">
<span class="cti-avatar" aria-hidden="true">み</span>
<div class="cti-head__info">
<p class="cti-head__name">佐々木 みなみ</p>
<p class="cti-head__status"><span class="cti-dot" aria-hidden="true"></span>オンライン</p>
</div>
</header>
<ul class="cti-list">
<li class="cti-row cti-row--in">
<span class="cti-avatar cti-avatar--sm" aria-hidden="true">み</span>
<p class="cti-bubble">明日のロケハン、何時集合だっけ?</p>
</li>
<li class="cti-row cti-row--out">
<p class="cti-bubble cti-bubble--out">たしか9時半集合だったはず!</p>
</li>
<li class="cti-row cti-row--in">
<span class="cti-avatar cti-avatar--sm" aria-hidden="true">み</span>
<p class="cti-typing" role="status" aria-label="佐々木みなみさんが入力中です">
<span class="cti-typing__dot"></span>
<span class="cti-typing__dot"></span>
<span class="cti-typing__dot"></span>
</p>
</li>
</ul>
</section>
</div>
CSS
/* 入力中インジケータ */
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
padding: 28px;
font-family: "Hiragino Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
background:
radial-gradient(circle at 90% 8%, rgba(45, 212, 191, .14) 0%, transparent 42%),
radial-gradient(circle at 6% 92%, rgba(56, 189, 248, .1) 0%, transparent 45%),
#0c1216;
color: #e6f2f0;
}
.cti-panel {
width: min(360px, 92vw);
border-radius: 22px;
background: rgba(255, 255, 255, .045);
border: 1px solid rgba(255, 255, 255, .09);
box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
overflow: hidden;
}
.cti-head {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 18px;
border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cti-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
display: grid;
place-items: center;
flex: none;
color: #06251f;
font-weight: 700;
font-size: 14px;
background: linear-gradient(135deg, #5eead4, #2dd4bf);
box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6);
}
.cti-avatar--sm { width: 28px; height: 28px; font-size: 11.5px; align-self: flex-end; }
.cti-head__info { display: grid; gap: 3px; }
.cti-head__name { margin: 0; font-size: 14.5px; font-weight: 700; }
.cti-head__status {
margin: 0;
display: flex;
align-items: center;
gap: 6px;
font-size: 11.5px;
color: rgba(230, 242, 240, .55);
}
.cti-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #34d399;
box-shadow: 0 0 0 0 rgba(52, 211, 153, .5);
animation: cti-pulse 2.2s ease-out infinite;
}
@keyframes cti-pulse {
0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .45); }
70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.cti-list {
list-style: none;
margin: 0;
padding: 18px 16px 22px;
display: grid;
gap: 12px;
}
.cti-row { display: flex; align-items: flex-end; gap: 8px; }
.cti-row--out { justify-content: flex-end; }
.cti-bubble {
margin: 0;
padding: 10px 14px;
font-size: 13.5px;
line-height: 1.55;
border-radius: 16px;
max-width: 78%;
width: fit-content;
background: rgba(255, 255, 255, .08);
border: 1px solid rgba(255, 255, 255, .07);
border-bottom-left-radius: 5px;
color: #e6f2f0;
}
.cti-bubble--out {
background: linear-gradient(135deg, #2dd4bf, #0891b2);
border-bottom-right-radius: 5px;
border-bottom-left-radius: 16px;
color: #04201d;
font-weight: 600;
box-shadow: 0 10px 22px -12px rgba(8, 145, 178, .6);
}
/* 入力中バブル: 3点が順番に跳ねる、常時ループ */
.cti-typing {
margin: 0;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 13px 16px;
border-radius: 16px;
border-bottom-left-radius: 5px;
background: rgba(255, 255, 255, .08);
border: 1px solid rgba(255, 255, 255, .07);
}
.cti-typing__dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: rgba(230, 242, 240, .65);
animation: cti-bounce 1.2s ease-in-out infinite;
}
.cti-typing__dot:nth-child(2) { animation-delay: .15s; }
.cti-typing__dot:nth-child(3) { animation-delay: .3s; }
@keyframes cti-bounce {
0%, 60%, 100% { transform: translateY(0); opacity: .55; }
30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.cti-dot, .cti-typing__dot { animation: none; }
}
@media (max-width: 380px) {
.cti-panel { border-radius: 18px; }
.cti-list { padding: 14px 12px 18px; }
}
JavaScript
// 入力中インジケータ: 跳ねるドットとオンラインの脈動はCSSアニメーションのみで完結
(() => {})();
🤖 AIエージェント用プロンプト
このままコピーしてAIに貼り付け「追加する場所」だけ書き換えればOK
あなたは熟練のフロントエンドエンジニアです。私のWebサイトに「入力中インジケータ」の効果を追加してください。
# 追加してほしい効果
入力中インジケータ(チャット & メディア)
3つの点が順番に跳ねる「入力中…」バブルと、相手のオンライン表示を常時ループさせたステータス演出です。返信を待つ間の安心感を演出します。
# 追加する場所
👉【ここに対象箇所を記入:例「トップのヒーローセクション」「お問い合わせボタン」「記事カードの一覧」など】
# 参考実装(この見た目・挙動を再現してください)
【HTML】
<!-- 入力中インジケータ: 3つの点が順番に跳ねる「入力中…」バブルと相手のオンライン表示。常時ループ -->
<div class="stage">
<section class="cti-panel" aria-label="佐々木みなみさんとのトーク">
<header class="cti-head">
<span class="cti-avatar" aria-hidden="true">み</span>
<div class="cti-head__info">
<p class="cti-head__name">佐々木 みなみ</p>
<p class="cti-head__status"><span class="cti-dot" aria-hidden="true"></span>オンライン</p>
</div>
</header>
<ul class="cti-list">
<li class="cti-row cti-row--in">
<span class="cti-avatar cti-avatar--sm" aria-hidden="true">み</span>
<p class="cti-bubble">明日のロケハン、何時集合だっけ?</p>
</li>
<li class="cti-row cti-row--out">
<p class="cti-bubble cti-bubble--out">たしか9時半集合だったはず!</p>
</li>
<li class="cti-row cti-row--in">
<span class="cti-avatar cti-avatar--sm" aria-hidden="true">み</span>
<p class="cti-typing" role="status" aria-label="佐々木みなみさんが入力中です">
<span class="cti-typing__dot"></span>
<span class="cti-typing__dot"></span>
<span class="cti-typing__dot"></span>
</p>
</li>
</ul>
</section>
</div>
【CSS】
/* 入力中インジケータ */
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
padding: 28px;
font-family: "Hiragino Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
background:
radial-gradient(circle at 90% 8%, rgba(45, 212, 191, .14) 0%, transparent 42%),
radial-gradient(circle at 6% 92%, rgba(56, 189, 248, .1) 0%, transparent 45%),
#0c1216;
color: #e6f2f0;
}
.cti-panel {
width: min(360px, 92vw);
border-radius: 22px;
background: rgba(255, 255, 255, .045);
border: 1px solid rgba(255, 255, 255, .09);
box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
overflow: hidden;
}
.cti-head {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 18px;
border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cti-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
display: grid;
place-items: center;
flex: none;
color: #06251f;
font-weight: 700;
font-size: 14px;
background: linear-gradient(135deg, #5eead4, #2dd4bf);
box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6);
}
.cti-avatar--sm { width: 28px; height: 28px; font-size: 11.5px; align-self: flex-end; }
.cti-head__info { display: grid; gap: 3px; }
.cti-head__name { margin: 0; font-size: 14.5px; font-weight: 700; }
.cti-head__status {
margin: 0;
display: flex;
align-items: center;
gap: 6px;
font-size: 11.5px;
color: rgba(230, 242, 240, .55);
}
.cti-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #34d399;
box-shadow: 0 0 0 0 rgba(52, 211, 153, .5);
animation: cti-pulse 2.2s ease-out infinite;
}
@keyframes cti-pulse {
0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .45); }
70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.cti-list {
list-style: none;
margin: 0;
padding: 18px 16px 22px;
display: grid;
gap: 12px;
}
.cti-row { display: flex; align-items: flex-end; gap: 8px; }
.cti-row--out { justify-content: flex-end; }
.cti-bubble {
margin: 0;
padding: 10px 14px;
font-size: 13.5px;
line-height: 1.55;
border-radius: 16px;
max-width: 78%;
width: fit-content;
background: rgba(255, 255, 255, .08);
border: 1px solid rgba(255, 255, 255, .07);
border-bottom-left-radius: 5px;
color: #e6f2f0;
}
.cti-bubble--out {
background: linear-gradient(135deg, #2dd4bf, #0891b2);
border-bottom-right-radius: 5px;
border-bottom-left-radius: 16px;
color: #04201d;
font-weight: 600;
box-shadow: 0 10px 22px -12px rgba(8, 145, 178, .6);
}
/* 入力中バブル: 3点が順番に跳ねる、常時ループ */
.cti-typing {
margin: 0;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 13px 16px;
border-radius: 16px;
border-bottom-left-radius: 5px;
background: rgba(255, 255, 255, .08);
border: 1px solid rgba(255, 255, 255, .07);
}
.cti-typing__dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: rgba(230, 242, 240, .65);
animation: cti-bounce 1.2s ease-in-out infinite;
}
.cti-typing__dot:nth-child(2) { animation-delay: .15s; }
.cti-typing__dot:nth-child(3) { animation-delay: .3s; }
@keyframes cti-bounce {
0%, 60%, 100% { transform: translateY(0); opacity: .55; }
30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.cti-dot, .cti-typing__dot { animation: none; }
}
@media (max-width: 380px) {
.cti-panel { border-radius: 18px; }
.cti-list { padding: 14px 12px 18px; }
}
【JavaScript】
// 入力中インジケータ: 跳ねるドットとオンラインの脈動はCSSアニメーションのみで完結
(() => {})();
# 外部ライブラリ
なし(追加ライブラリ不要)
# 守ってほしいこと
- 既存のHTML構造・レイアウト・デザインを壊さないこと。必要に応じてクラス名・色・サイズを私のサイトに合わせて調整してよい。
- クラス名やidが既存と衝突しないよう、必要なら接頭辞で名前空間を分けること。
- レスポンシブ対応と prefers-reduced-motion への配慮を入れること。
- 私のサイトのフレームワーク(React / Vue / 素のHTML など)に合わせて実装すること。不明な場合は素のHTML/CSS/JSで提示し、組み込み手順も説明すること。
- 変更後の確認手順も簡潔に教えてください。