03タイムセール残り時間バー
時・分・秒の3マスの数字がカットで切り替わり、その下のバーが右端を軸に縮んで、カウントダウン画像なしで残り時間を示します。
使いどころタイムセール告知、締切間近リマインド
transform-origin: rightgrid-template-columnssteps(1, end)

<main class="stage">
<div class="mk is-demo" id="mk">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" class="mk__table">
<tr><td align="center" class="mk__wrap">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" class="mk__card" style="max-width:400px">
<tr><td class="mk__brand">◆ Acme</td></tr>
<tr><td align="center" class="mk__hero">
<span class="mk__badge" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" class="mk__ico"><path d="M216,136a88,88,0,1,1-88-88A88,88,0,0,1,216,136Z" opacity="0.2"/><path d="M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z"/></svg></span>
</td></tr>
<tr><td align="center" class="mk__title">今日の深夜まで、ちょうど24時間</td></tr>
<tr><td align="center" class="mk__body">人気商品を最大40%オフにします。</td></tr>
<tr><td class="mk__countrow">
<div class="mk__count" role="timer" aria-label="残り5時間42分08秒">
<div class="mk__cell">
<span class="mk__digits">05</span>
<span class="mk__unit">時間</span>
</div>
<span class="mk__colon" aria-hidden="true">:</span>
<div class="mk__cell">
<span class="mk__digits">42</span>
<span class="mk__unit">分</span>
</div>
<span class="mk__colon" aria-hidden="true">:</span>
<div class="mk__cell mk__cellsec">
<span class="mk__digits" aria-hidden="true">
<span class="mk__d1">08</span><span class="mk__d2">07</span><span class="mk__d3">06</span>
</span>
<span class="mk__unit">秒</span>
</div>
</div>
<div class="mk__bar" aria-hidden="true"><span class="mk__fill"></span></div>
</td></tr>
<tr><td align="center" class="mk__ctawrap">
<a href="#" role="button" class="mk__cta">セールを見る</a>
<button type="button" class="mk__remind" id="remind" aria-pressed="false">締切通知を受け取る</button>
</td></tr>
<tr><td align="center" class="mk__footer">Acme Inc・ソウル・ <a href="#" class="mk__unsub">配信停止</a></td></tr>
</table>
</td></tr>
</table>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-base;
$easing: $ease-out;
$color: $stage-orange;
@include stage($stage-orange);
.stage { position: relative; }
.mk { width: min(100%, 400px); }
.mk__table { border-collapse: collapse; }
.mk__wrap { padding: 0; }
.mk__card {
border-collapse: collapse; background: $stage-paper; border-radius: $r-card;
box-shadow: $shadow-raised; overflow: hidden;
}
.mk__card td { padding: $sp-1 $sp-5; font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif; -webkit-text-size-adjust: 100%; line-height: 1; }
.mk__brand { font-weight: 800; font-size: 11px; line-height: 1; color: rgba(23,20,26,.62); letter-spacing: .02em; padding-top: $sp-2 !important; }
.mk__hero { padding-top: $sp-1 !important; padding-bottom: 0 !important; }
.mk__badge {
display: inline-flex; align-items: center; justify-content: center;
width: clamp(26px, 8vw, 34px); height: clamp(26px, 8vw, 34px); border-radius: 50%;
background: $stage-orange; color: $subject-ink;
}
.mk__ico { width: 60%; height: 60%; }
.mk__title { font-weight: 800; font-size: clamp(12px, 3.6vw, 14px); line-height: 1.25; color: $subject-ink; padding-top: $sp-1 !important; }
.mk__body { font-weight: 500; font-size: clamp(10px, 3vw, 11px); line-height: 1.4; color: rgba(23,20,26,.62); padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.mk__countrow { padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.mk__count {
display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: $sp-1;
background: $subject-ink; border-radius: $r-control; padding: $sp-2 $sp-3;
}
.mk__cell { display: flex; flex-direction: column; align-items: center; gap: 0; }
.mk__digits {
position: relative; font-weight: 800; font-size: clamp(18px, 6vw, 24px); line-height: 1;
color: $subject-cream; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.mk__unit { font-weight: 600; font-size: 8px; line-height: 1; color: rgba(255,247,230,.55); }
.mk__colon { font-weight: 800; font-size: 14px; line-height: 1; color: rgba($subject-cream, .72); padding-bottom: $sp-2; }
// 초 칸은 겹쳐 놓은 세 장을 steps 로 한 프레임에 교체한다 (교차 페이드 금지 — 유령 프레임)
.mk__cellsec .mk__digits { }
.mk__d1, .mk__d2, .mk__d3 { position: absolute; inset: 0; display: flex; justify-content: center; }
.mk__d2, .mk__d3 { visibility: hidden; }
.mk__bar {
margin-top: $sp-1; height: 4px; border-radius: $r-pill; background: rgba(23,20,26,.1); overflow: hidden;
}
.mk__fill { display: block; height: 100%; border-radius: $r-pill; background: $stage-orange; transform-origin: right; } // 규칙8: 카운트다운 막대 우측 감소
.mk__ctawrap { padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.mk__cta {
display: inline-block; padding: $sp-1 $sp-5; font-weight: 700; font-size: 11px; line-height: 1.6;
font-family: inherit; color: $subject-ink; text-decoration: none; border-radius: $r-control;
background: $stage-orange;
}
.mk__remind {
display: inline-block; padding: $sp-1 $sp-3; margin-left: $sp-2; font-weight: 700; font-size: 10px; line-height: 1.6;
font-family: inherit; color: rgba(23,20,26,.6); background: none; border: 1px solid rgba(23,20,26,.25);
border-radius: $r-pill; cursor: pointer;
}
.mk__remind.is-on { color: $subject-cream; background: $subject-ink; border-color: $subject-ink; }
.mk__footer { font-weight: 500; font-size: 8px; line-height: 1.4; color: rgba(23,20,26,.62); padding-top: $sp-1 !important; padding-bottom: $sp-2 !important; }
.mk__footer a { color: inherit; }
// ── 미리보기 루프: 초 숫자는 steps(1,end) 컷 교체, 막대는 transform-origin: right 기준으로 줄어든다 (2s 주기, 복귀 85%)
.mk.is-demo .mk__d1 { animation-name: fsD1; animation-duration: 2s; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.mk.is-demo .mk__d2 { animation-name: fsD2; animation-duration: 2s; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.mk.is-demo .mk__d3 { animation-name: fsD3; animation-duration: 2s; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.mk.is-demo .mk__fill { animation-name: fsBar; animation-duration: 2s; animation-timing-function: linear; animation-iteration-count: infinite; }
.mk.is-demo .mk__badge { animation-name: fsTick; animation-duration: 2s; animation-timing-function: $ease-pop; animation-iteration-count: infinite; }
@keyframes fsD1 {
0%, 32% { visibility: visible; }
33%, 100% { visibility: hidden; }
}
@keyframes fsD2 {
0%, 32% { visibility: hidden; }
33%, 65% { visibility: visible; }
66%, 100% { visibility: hidden; }
}
@keyframes fsD3 {
0%, 65% { visibility: hidden; }
66%, 84% { visibility: visible; }
85%, 100% { visibility: hidden; }
}
@keyframes fsBar {
0% { transform: scaleX(1); }
78% { transform: scaleX(.16); }
82% { opacity: 0; transform: scaleX(.16); }
84% { opacity: 0; transform: scaleX(1); }
90%, 100% { opacity: 1; transform: scaleX(1); }
}
@keyframes fsTick {
0%, 8% { transform: scale(1); }
14% { transform: scale(1.1); }
22%, 100% { transform: scale(1); }
}
// ── 320×200 폰 실측 대비 압축 (BD9)
@media (max-width: 340px), (max-height: 220px) {
.mk__card td { padding-left: $sp-3; padding-right: $sp-3; padding-top: 0; padding-bottom: 0; }
.mk__brand { padding-top: 0 !important; font-size: 9px !important; }
.mk__badge { width: 22px; height: 22px; }
.mk__title { font-size: 11px !important; padding-top: 0 !important; }
.mk__body { font-size: 8px !important; padding-bottom: 0 !important; }
.mk__digits { font-size: 15px !important; }
.mk__unit { font-size: 7px !important; }
.mk__count { padding: $sp-1 $sp-2 !important; }
.mk__cta { padding: 0 $sp-3 !important; font-size: 10px !important; }
.mk__remind { padding: 0 $sp-2 !important; margin-left: $sp-1 !important; font-size: 9px !important; }
.mk__footer { font-size: 7px !important; padding-top: 0 !important; padding-bottom: $sp-1 !important; }
}
@media (prefers-reduced-motion: reduce) {
.mk.is-demo .mk__d1,
.mk.is-demo .mk__d2,
.mk.is-demo .mk__d3,
.mk.is-demo .mk__fill,
.mk.is-demo .mk__badge { animation: none !important; }
.mk__d1 { visibility: visible; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ff4d1f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.stage {
position: relative;
}
.mk {
width: min(100%, 400px);
}
.mk__table {
border-collapse: collapse;
}
.mk__wrap {
padding: 0;
}
.mk__card {
border-collapse: collapse;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
overflow: hidden;
}
.mk__card td {
padding: 4px 20px;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
-webkit-text-size-adjust: 100%;
line-height: 1;
}
.mk__brand {
font-weight: 800;
font-size: 11px;
line-height: 1;
color: rgba(23, 20, 26, 0.62);
letter-spacing: 0.02em;
padding-top: 8px !important;
}
.mk__hero {
padding-top: 4px !important;
padding-bottom: 0 !important;
}
.mk__badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: clamp(26px, 8vw, 34px);
height: clamp(26px, 8vw, 34px);
border-radius: 50%;
background: #ff4d1f;
color: #17141a;
}
.mk__ico {
width: 60%;
height: 60%;
}
.mk__title {
font-weight: 800;
font-size: clamp(12px, 3.6vw, 14px);
line-height: 1.25;
color: #17141a;
padding-top: 4px !important;
}
.mk__body {
font-weight: 500;
font-size: clamp(10px, 3vw, 11px);
line-height: 1.4;
color: rgba(23, 20, 26, 0.62);
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.mk__countrow {
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.mk__count {
display: grid;
grid-template-columns: 1fr auto 1fr auto 1fr;
align-items: center;
gap: 4px;
background: #17141a;
border-radius: 12px;
padding: 8px 12px;
}
.mk__cell {
display: flex;
flex-direction: column;
align-items: center;
gap: 0;
}
.mk__digits {
position: relative;
font-weight: 800;
font-size: clamp(18px, 6vw, 24px);
line-height: 1;
color: #fff7e6;
font-variant-numeric: tabular-nums;
letter-spacing: 0.02em;
}
.mk__unit {
font-weight: 600;
font-size: 8px;
line-height: 1;
color: rgba(255, 247, 230, 0.55);
}
.mk__colon {
font-weight: 800;
font-size: 14px;
line-height: 1;
color: rgba(255, 247, 230, 0.72);
padding-bottom: 8px;
}
.mk__d1, .mk__d2, .mk__d3 {
position: absolute;
inset: 0;
display: flex;
justify-content: center;
}
.mk__d2, .mk__d3 {
visibility: hidden;
}
.mk__bar {
margin-top: 4px;
height: 4px;
border-radius: 999px;
background: rgba(23, 20, 26, 0.1);
overflow: hidden;
}
.mk__fill {
display: block;
height: 100%;
border-radius: 999px;
background: #ff4d1f;
transform-origin: right;
}
.mk__ctawrap {
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.mk__cta {
display: inline-block;
padding: 4px 20px;
font-weight: 700;
font-size: 11px;
line-height: 1.6;
font-family: inherit;
color: #17141a;
text-decoration: none;
border-radius: 12px;
background: #ff4d1f;
}
.mk__remind {
display: inline-block;
padding: 4px 12px;
margin-left: 8px;
font-weight: 700;
font-size: 10px;
line-height: 1.6;
font-family: inherit;
color: rgba(23, 20, 26, 0.6);
background: none;
border: 1px solid rgba(23, 20, 26, 0.25);
border-radius: 999px;
cursor: pointer;
}
.mk__remind.is-on {
color: #fff7e6;
background: #17141a;
border-color: #17141a;
}
.mk__footer {
font-weight: 500;
font-size: 8px;
line-height: 1.4;
color: rgba(23, 20, 26, 0.62);
padding-top: 4px !important;
padding-bottom: 8px !important;
}
.mk__footer a {
color: inherit;
}
.mk.is-demo .mk__d1 {
animation-name: fsD1;
animation-duration: 2s;
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__d2 {
animation-name: fsD2;
animation-duration: 2s;
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__d3 {
animation-name: fsD3;
animation-duration: 2s;
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__fill {
animation-name: fsBar;
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
.mk.is-demo .mk__badge {
animation-name: fsTick;
animation-duration: 2s;
animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
animation-iteration-count: infinite;
}
@keyframes fsD1 {
0%, 32% {
visibility: visible;
}
33%, 100% {
visibility: hidden;
}
}
@keyframes fsD2 {
0%, 32% {
visibility: hidden;
}
33%, 65% {
visibility: visible;
}
66%, 100% {
visibility: hidden;
}
}
@keyframes fsD3 {
0%, 65% {
visibility: hidden;
}
66%, 84% {
visibility: visible;
}
85%, 100% {
visibility: hidden;
}
}
@keyframes fsBar {
0% {
transform: scaleX(1);
}
78% {
transform: scaleX(0.16);
}
82% {
opacity: 0;
transform: scaleX(0.16);
}
84% {
opacity: 0;
transform: scaleX(1);
}
90%, 100% {
opacity: 1;
transform: scaleX(1);
}
}
@keyframes fsTick {
0%, 8% {
transform: scale(1);
}
14% {
transform: scale(1.1);
}
22%, 100% {
transform: scale(1);
}
}
@media (max-width: 340px), (max-height: 220px) {
.mk__card td {
padding-left: 12px;
padding-right: 12px;
padding-top: 0;
padding-bottom: 0;
}
.mk__brand {
padding-top: 0 !important;
font-size: 9px !important;
}
.mk__badge {
width: 22px;
height: 22px;
}
.mk__title {
font-size: 11px !important;
padding-top: 0 !important;
}
.mk__body {
font-size: 8px !important;
padding-bottom: 0 !important;
}
.mk__digits {
font-size: 15px !important;
}
.mk__unit {
font-size: 7px !important;
}
.mk__count {
padding: 4px 8px !important;
}
.mk__cta {
padding: 0 12px !important;
font-size: 10px !important;
}
.mk__remind {
padding: 0 8px !important;
margin-left: 4px !important;
font-size: 9px !important;
}
.mk__footer {
font-size: 7px !important;
padding-top: 0 !important;
padding-bottom: 4px !important;
}
}
@media (prefers-reduced-motion: reduce) {
.mk.is-demo .mk__d1,
.mk.is-demo .mk__d2,
.mk.is-demo .mk__d3,
.mk.is-demo .mk__fill,
.mk.is-demo .mk__badge {
animation: none !important;
}
.mk__d1 {
visibility: visible;
}
}var mk = document.getElementById('mk');
var remind = document.getElementById('remind');
remind.addEventListener('click', function () {
mk.classList.remove('is-demo');
var on = remind.classList.toggle('is-on');
remind.setAttribute('aria-pressed', String(on));
remind.textContent = on ? '通知オン' : '締切通知を受け取る';
});import { useState } from "react";
import styles from "./FlashSaleCountdown.module.scss";
export type FlashSaleCountdownProps = { duration?: number; easing?: string; color?: string };
export default function FlashSaleCountdown({ duration = 300, easing = "ease-out", color = "#ff4d1f" }: FlashSaleCountdownProps) {
const [demo, setDemo] = useState(true);
const [on, setOn] = useState(false);
return (
<main className={styles.stage}>
<div className={styles.mk}>
<div className={styles.card}>
<div className={styles.brand}>◆ Acme</div>
<div className={styles.hero}>
<span className={styles.badge} style={{ background: color }} aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" className={styles.ico}><path d="M216,136a88,88,0,1,1-88-88A88,88,0,0,1,216,136Z" opacity="0.2"/><path d="M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z"/></svg>
</span>
</div>
<div className={styles.title}>오늘 자정까지, 딱 24시간</div>
<div className={styles.body}>베스트 상품을 최대 40% 깎아 드려요.</div>
<div className={styles.countrow}>
<div className={styles.count} role="timer" aria-label="남은 시간 5시간 42분 08초">
<div className={styles.cell}>
<span className={styles.digits}>05</span>
<span className={styles.unit}>시간</span>
</div>
<span className={styles.colon} aria-hidden="true">:</span>
<div className={styles.cell}>
<span className={styles.digits}>42</span>
<span className={styles.unit}>분</span>
</div>
<span className={styles.colon} aria-hidden="true">:</span>
<div className={styles.cell}>
<span className={styles.digits} aria-hidden="true">
<span className={styles.d1} style={demo ? { animationName: "fsD1", animationDuration: "2s", animationTimingFunction: "steps(1, end)", animationIterationCount: "infinite" } : undefined}>08</span>
<span className={styles.d2} style={demo ? { animationName: "fsD2", animationDuration: "2s", animationTimingFunction: "steps(1, end)", animationIterationCount: "infinite" } : undefined}>07</span>
<span className={styles.d3} style={demo ? { animationName: "fsD3", animationDuration: "2s", animationTimingFunction: "steps(1, end)", animationIterationCount: "infinite" } : undefined}>06</span>
</span>
<span className={styles.unit}>초</span>
</div>
</div>
<div className={styles.bar} aria-hidden="true">
<span className={styles.fill} style={{ background: color, ...(demo ? { animationName: "fsBar", animationDuration: "2s", animationTimingFunction: easing, animationIterationCount: "infinite", transformOrigin: "right" } : { transformOrigin: "right", transitionDuration: `${duration}ms` }) }}></span>
</div>
</div>
<div className={styles.ctawrap}>
<a href="#" role="button" className={styles.cta} style={{ background: color }} onClick={(e: { preventDefault: () => void }) => { e.preventDefault(); }}>세일 보러 가기</a>
<button type="button" className={`${styles.remind} ${on ? styles.isOn : ""}`} aria-pressed={on} onClick={() => { setDemo(false); setOn((v) => !v); }}>{on ? "알림 켜짐" : "마감 알림 받기"}</button>
</div>
<div className={styles.footer}>Acme Inc · 서울 · <a href="#" className={styles.unsub}>수신거부</a></div>
</div>
</div>
</main>
);
}03 タイムセール残り時間バー — 計測 累積面積 1.715% · 動いたフレーム 22/23GODRICH オリジナル · SCSS と React は zip に同梱 · メルマガ デザイン 9種 — Outlookでも崩れない
このデモが属する記事
メルマガ デザイン 9種 — Outlookでも崩れないメルマガ デザインとは、売るために送るメール — ニュースレター、クーポン、タイムセール、リマインド — の見た目を組み立てる仕事です。この9つはテーブル(table)の縦罫を骨組みにしたHTMLとCSSだけで作ってあり、Outlookでも この記事のデモをすべて見る


