<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>프로모션 쿠폰 발급</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Poppins', 'Noto Sans KR', sans-serif;
background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 100%);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.card {
background: #fff;
border-radius: 20px;
padding: 40px;
max-width: 400px;
width: 100%;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
text-align: center;
}
h2 {
margin-bottom: 20px;
color: #333;
}
input[type="text"], input[type="email"] {
width: 100%;
padding: 12px;
margin: 10px 0 20px;
border: none;
border-bottom: 2px solid #ccc;
outline: none;
font-size: 14px;
transition: border-color 0.3s;
}
input[type="text"]:focus, input[type="email"]:focus {
border-color: #74ebd5;
}
button {
background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 100%);
border: none;
padding: 12px 20px;
color: #fff;
font-size: 16px;
border-radius: 30px;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
#result {
margin-top: 20px;
font-weight: 600;
color: #333;
}
</style>
</head>
<body>
<div class="card">
<h2>✨ 프로모션 쿠폰 발급 ✨</h2>
<form id="couponForm">
<input type="text" name="name" placeholder="이름을 입력하세요" required>
<input type="email" name="email" placeholder="이메일을 입력하세요" required>
<button type="submit">쿠폰 받기</button>
</form>
<p id="result"></p>
</div>
<script>
document.getElementById("couponForm").addEventListener("submit", function(e){
e.preventDefault();
google.script.run.withSuccessHandler(function(coupon){
document.getElementById("result").innerText =
"🎉 발급된 쿠폰 코드: " + coupon + " (이메일로도 발송되었습니다)";
}).saveAndSend({
name: this.name.value,
email: this.email.value
});
this.reset();
});
</script>
</body>
</html>