Generator

Pop-up Designer

Build a timer-based exit-intent style popup HTML with email capture form.

Popup HTML+JS
<div id="popup" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:9999;align-items:center;justify-content:center;">
  <div style="background:#fff;border-radius:16px;padding:32px;max-width:420px;text-align:center;">
    <button onclick="document.getElementById('popup').style.display='none'" style="float:right;background:none;border:none;font-size:24px;cursor:pointer;">×</button>
    <h2 style="font-size:22px;margin:0 0 12px;">Get 20% off your first order</h2>
    <p style="color:#64748b;margin:0 0 20px;">Join our newsletter for exclusive deals.</p>
    <form action="/api/subscribe" method="POST">
      <input name="email" type="email" required placeholder="you@email.com" style="width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:8px;margin-bottom:12px;" />
      <button type="submit" style="width:100%;background:#2563eb;color:#fff;padding:12px;border:none;border-radius:8px;font-weight:600;cursor:pointer;">Get my discount</button>
    </form>
  </div>
</div>
<script>
setTimeout(() => { if (!localStorage.getItem('popup-dismissed')) document.getElementById('popup').style.display = 'flex'; }, 5000);
</script>