02Discount coupon email
Tapping the code inside the dashed box flips its label to Copied in a single frame, and in the loop the box swells once and settles back.
Best forSeasonal sale announcements, first-purchase coupons
navigator.clipboard.writeTextsteps(1, end)aria-live

<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="M200,128a32,32,0,0,0,32,32v32a8,8,0,0,1-8,8H96V56H224a8,8,0,0,1,8,8V96A32,32,0,0,0,200,128Z" opacity="0.2"/><path d="M232,104a8,8,0,0,0,8-8V64a16,16,0,0,0-16-16H32A16,16,0,0,0,16,64V96a8,8,0,0,0,8,8,24,24,0,0,1,0,48,8,8,0,0,0-8,8v32a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V160a8,8,0,0,0-8-8,24,24,0,0,1,0-48ZM32,167.2a40,40,0,0,0,0-78.4V64H88V192H32Zm192,0V192H104V64H224V88.8a40,40,0,0,0,0,78.4Z"/></svg></span>
</td></tr>
<tr><td align="center" class="mk__title">Summer sale, 30% off</td></tr>
<tr><td align="center" class="mk__body">Tap the code to copy, then paste it at checkout.</td></tr>
<tr><td class="mk__couponrow">
<button type="button" class="mk__coupon" id="coupon" aria-label="Copy coupon code SUMMER30">
<span class="mk__codelabel" id="codelabel">SUMMER30</span>
<span class="mk__donelabel" aria-hidden="true">Copied</span>
</button>
</td></tr>
<tr><td align="center" class="mk__ctawrap"><a href="#" role="button" class="mk__cta">Shop now</a></td></tr>
<tr><td align="center" class="mk__live" id="live" aria-live="polite"></td></tr>
<tr><td align="center" class="mk__footer">Acme Inc · Seoul · <a href="#" class="mk__unsub">Unsubscribe</a></td></tr>
</table>
</td></tr>
</table>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-base;
$easing: $ease-pop;
$color: $subject-blue-deep;
@include stage($stage-yellow);
.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: $r-sm;
background: #0a4fe8; color: $subject-cream;
}
.mk__ico { width: 62%; height: 62%; }
.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__couponrow { padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.mk__coupon {
position: relative; display: flex; width: 100%; align-items: center; justify-content: center;
background: rgba(47,109,246,.06); border: 2px dashed rgba(47,109,246,.45); border-radius: $r-control;
cursor: pointer; font-family: inherit; padding: $sp-2 $sp-4;
}
.mk__codelabel, .mk__donelabel {
font-weight: 800; font-size: clamp(14px, 4.4vw, 18px); line-height: 1.1; letter-spacing: .08em; color: #6079b0;
}
.mk__donelabel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; visibility: hidden; color: $subject-ink; }
.mk__coupon.is-copied .mk__codelabel { visibility: hidden; }
.mk__coupon.is-copied .mk__donelabel { visibility: visible; }
.mk__coupon:focus-visible { outline: 2px solid $subject-ink; outline-offset: 2px; }
.mk__ctawrap { padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.mk__cta {
display: inline-block; padding: $sp-1 $sp-6; font-weight: 700; font-size: 11px; line-height: 1.6;
font-family: inherit; color: $subject-cream; text-decoration: none; border-radius: $r-control;
background: $subject-ink;
}
.mk__live { font-weight: 600; font-size: 9px; line-height: 1.4; color: rgba(23,20,26,.62); padding: 0 !important; min-height: 12px; }
.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; }
// ── 미리보기 루프: 상자가 한 번 커졌다 돌아오고(부드럽게), 글자는 코드→복사됨 로 한 프레임에 컷 (2s 주기, 복귀 85%)
.mk.is-demo .mk__coupon { animation-name: prPop; animation-duration: 2s; animation-timing-function: cubic-bezier(.2, 1.4, .4, 1); animation-iteration-count: infinite; }
.mk.is-demo .mk__codelabel { animation-name: prCode; animation-duration: 2s; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.mk.is-demo .mk__donelabel { animation-name: prDone; animation-duration: 2s; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.mk.is-demo .mk__badge { animation-name: prBeat; animation-duration: 2s; animation-timing-function: $ease-pop; animation-iteration-count: infinite; }
@keyframes prPop {
0%, 12% { transform: scale(1); }
20% { transform: scale(1.06); }
30%, 100% { transform: scale(1); }
}
@keyframes prCode {
0%, 44% { visibility: visible; }
45%, 84% { visibility: hidden; }
85%, 100% { visibility: visible; }
}
@keyframes prDone {
0%, 44% { visibility: hidden; }
45%, 84% { visibility: visible; }
85%, 100% { visibility: hidden; }
}
@keyframes prBeat {
0%, 40% { transform: scale(1); }
50% { transform: scale(1.12); }
62%, 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__coupon { padding: $sp-1 $sp-3 !important; }
.mk__codelabel, .mk__donelabel { font-size: 12px !important; }
.mk__cta { padding: 0 $sp-5 !important; font-size: 10px !important; }
.mk__live { min-height: 0; font-size: 8px !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__coupon,
.mk.is-demo .mk__codelabel,
.mk.is-demo .mk__donelabel,
.mk.is-demo .mk__badge { animation: none !important; }
}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);
}
.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: 8px;
background: #0a4fe8;
color: #fff7e6;
}
.mk__ico {
width: 62%;
height: 62%;
}
.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__couponrow {
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.mk__coupon {
position: relative;
display: flex;
width: 100%;
align-items: center;
justify-content: center;
background: rgba(47, 109, 246, 0.06);
border: 2px dashed rgba(47, 109, 246, 0.45);
border-radius: 12px;
cursor: pointer;
font-family: inherit;
padding: 8px 16px;
}
.mk__codelabel, .mk__donelabel {
font-weight: 800;
font-size: clamp(14px, 4.4vw, 18px);
line-height: 1.1;
letter-spacing: 0.08em;
color: #6079b0;
}
.mk__donelabel {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
visibility: hidden;
color: #17141a;
}
.mk__coupon.is-copied .mk__codelabel {
visibility: hidden;
}
.mk__coupon.is-copied .mk__donelabel {
visibility: visible;
}
.mk__coupon:focus-visible {
outline: 2px solid #17141a;
outline-offset: 2px;
}
.mk__ctawrap {
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.mk__cta {
display: inline-block;
padding: 4px 24px;
font-weight: 700;
font-size: 11px;
line-height: 1.6;
font-family: inherit;
color: #fff7e6;
text-decoration: none;
border-radius: 12px;
background: #17141a;
}
.mk__live {
font-weight: 600;
font-size: 9px;
line-height: 1.4;
color: rgba(23, 20, 26, 0.62);
padding: 0 !important;
min-height: 12px;
}
.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__coupon {
animation-name: prPop;
animation-duration: 2s;
animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__codelabel {
animation-name: prCode;
animation-duration: 2s;
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__donelabel {
animation-name: prDone;
animation-duration: 2s;
animation-timing-function: steps(1, end);
animation-iteration-count: infinite;
}
.mk.is-demo .mk__badge {
animation-name: prBeat;
animation-duration: 2s;
animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
animation-iteration-count: infinite;
}
@keyframes prPop {
0%, 12% {
transform: scale(1);
}
20% {
transform: scale(1.06);
}
30%, 100% {
transform: scale(1);
}
}
@keyframes prCode {
0%, 44% {
visibility: visible;
}
45%, 84% {
visibility: hidden;
}
85%, 100% {
visibility: visible;
}
}
@keyframes prDone {
0%, 44% {
visibility: hidden;
}
45%, 84% {
visibility: visible;
}
85%, 100% {
visibility: hidden;
}
}
@keyframes prBeat {
0%, 40% {
transform: scale(1);
}
50% {
transform: scale(1.12);
}
62%, 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__coupon {
padding: 4px 12px !important;
}
.mk__codelabel, .mk__donelabel {
font-size: 12px !important;
}
.mk__cta {
padding: 0 20px !important;
font-size: 10px !important;
}
.mk__live {
min-height: 0;
font-size: 8px !important;
}
.mk__footer {
font-size: 7px !important;
padding-top: 0 !important;
padding-bottom: 4px !important;
}
}
@media (prefers-reduced-motion: reduce) {
.mk.is-demo .mk__coupon,
.mk.is-demo .mk__codelabel,
.mk.is-demo .mk__donelabel,
.mk.is-demo .mk__badge {
animation: none !important;
}
}var mk = document.getElementById('mk');
var coupon = document.getElementById('coupon');
var codelabel = document.getElementById('codelabel');
var live = document.getElementById('live');
coupon.addEventListener('click', function () {
mk.classList.remove('is-demo');
coupon.classList.add('is-copied');
live.textContent = 'Code copied';
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText('SUMMER30').then(function () {}, function () {
live.textContent = 'Copy failed — select it manually';
coupon.classList.remove('is-copied');
});
}
});import { useState } from "react";
import styles from "./PromoCoupon.module.scss";
export type PromoCouponProps = { duration?: number; easing?: string; color?: string };
export default function PromoCoupon({ duration = 300, easing = "cubic-bezier(.2,1.4,.4,1)", color = "#0a4fe8" }: PromoCouponProps) {
const [demo, setDemo] = useState(true);
const [copied, setCopied] = useState(false);
const [live, setLive] = useState("");
const copyCode = () => {
setDemo(false);
setCopied(true);
setLive("코드를 복사했어요");
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText("SUMMER30").then(
() => {},
() => { setLive("복사 실패 — 코드를 직접 선택하세요"); setCopied(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="M200,128a32,32,0,0,0,32,32v32a8,8,0,0,1-8,8H96V56H224a8,8,0,0,1,8,8V96A32,32,0,0,0,200,128Z" opacity="0.2"/><path d="M232,104a8,8,0,0,0,8-8V64a16,16,0,0,0-16-16H32A16,16,0,0,0,16,64V96a8,8,0,0,0,8,8,24,24,0,0,1,0,48,8,8,0,0,0-8,8v32a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V160a8,8,0,0,0-8-8,24,24,0,0,1,0-48ZM32,167.2a40,40,0,0,0,0-78.4V64H88V192H32Zm192,0V192H104V64H224V88.8a40,40,0,0,0,0,78.4Z"/></svg>
</span>
</div>
<div className={styles.title}>여름 시즌 30% 할인</div>
<div className={styles.body}>코드를 눌러 복사하고 결제창에 그대로 붙여넣으세요.</div>
<div className={styles.couponrow}>
<button
type="button"
className={`${styles.coupon} ${copied ? styles.isCopied : ""}`}
style={demo ? { animationName: "prPop", animationDuration: "2s", animationTimingFunction: easing, animationIterationCount: "infinite", transitionDuration: `${duration}ms` } : { transitionDuration: `${duration}ms` }}
aria-label="쿠폰 코드 SUMMER30 복사"
onClick={copyCode}
>
<span className={styles.codelabel} style={demo ? { animationName: "prCode", animationDuration: "2s", animationTimingFunction: "steps(1, end)", animationIterationCount: "infinite" } : undefined}>SUMMER30</span>
<span className={styles.donelabel} style={demo ? { animationName: "prDone", animationDuration: "2s", animationTimingFunction: "steps(1, end)", animationIterationCount: "infinite" } : undefined} aria-hidden="true">복사됨</span>
</button>
</div>
<div className={styles.ctawrap}>
<a href="#" role="button" className={styles.cta} onClick={(e: { preventDefault: () => void }) => { e.preventDefault(); }}>지금 쇼핑하러 가기</a>
</div>
<div className={styles.live} aria-live="polite">{live}</div>
<div className={styles.footer}>Acme Inc · 서울 · <a href="#" className={styles.unsub}>수신거부</a></div>
</div>
</div>
</main>
);
}02 Discount coupon email — Measured area 3.929% · moving frames 12/23Original by GODRICH · SCSS and React ship in the zip · Marketing Email Design: 9 Templates, Outlook-Safe
The post this demo lives in
Marketing Email Design: 9 Templates, Outlook-SafeMarketing email design shapes the emails you send to sell — newsletters, coupons, countdowns, reminders. These nine are See all demos in this post


