Skip to the editor

Design → preview → paste

Popups that look designed, not bolted on.

Build a website popup visually, watch it open in a mock browser, then copy one self-contained HTML block. No libraries, no accounts, no tracking, nothing to host.

In the export

6.3 kB
  • Markup with a unique scoped id
  • Scoped <style>, no frameworks
  • Vanilla JS behavior, ~0 requests
  • Esc, focus return, scroll lock, reduced motion

Newsletter · center · scale

Editor · 4 sections

01

Start from

A template fills in content, look and behavior.

02

Content

Plain text only. Everything is escaped on export.

106/280

http and https only. Empty or invalid links are dropped from the export.

03

Look

Palettes set all three colors at once.

Palette

Position
Animation
420px
24px
55%
04

Behavior

How the popup appears, and how often.

Trigger
4s
Frequency

Becomes the storage key, so two popups on one page never share memory.

Live preview

updates instantly

yoursite.com/launch

Get the weekly field notes

One short email every Thursday: new tools, honest tests, zero growth hacks. Unsubscribe whenever you like.

Subscribe

opens after 4s · once per session

The preview mirrors the exported markup. The real block adds focus trapping, Esc handling and storage guards.

05 / export

One block, ready to paste

Paste this once inside <body>. Every character of your copy is HTML-escaped, and links are limited to http, https, mailto, tel, anchors or relative paths.

Snippet size6.3 kB
<!-- Popforge popup: generated block, paste anywhere inside <body>. -->
<div id="pf-field-notes-1rora" class="pf-overlay pf-pos-center pf-anim-scale" role="dialog" aria-modal="true" aria-labelledby="pf-field-notes-1rora-title" aria-describedby="pf-field-notes-1rora-body" aria-hidden="true">
  <div class="pf-card">
    <button type="button" class="pf-close" data-pf-focus aria-label="Close popup"><span aria-hidden="true">&times;</span></button>
    <h2 class="pf-title" id="pf-field-notes-1rora-title">Get the weekly field notes</h2>
    <p class="pf-body" id="pf-field-notes-1rora-body">One short email every Thursday: new tools, honest tests, zero growth hacks. Unsubscribe whenever you like.</p>
    <a class="pf-btn" href="#">Subscribe</a>
  </div>
</div>
<style>
#pf-field-notes-1rora.pf-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;box-sizing:border-box;padding:24px;align-items:center;justify-content:center;background:rgba(0,0,0,0.55);opacity:0;visibility:hidden;transition:opacity .3s ease,visibility .3s ease;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}
#pf-field-notes-1rora.pf-overlay.is-open{opacity:1;visibility:visible}
#pf-field-notes-1rora .pf-card{position:relative;box-sizing:border-box;width:420px;max-width:100%;max-height:calc(100vh - 48px);overflow-y:auto;padding:32px;background:#171512;color:#f2ece0;border-radius:24px;box-shadow:0 28px 80px rgba(0,0,0,.5);opacity:0;transition:opacity .3s ease,transform .35s cubic-bezier(.22,.9,.28,1)}
#pf-field-notes-1rora.is-open .pf-card{opacity:1;transform:none}
#pf-field-notes-1rora.pf-anim-fade .pf-card{transform:none}
#pf-field-notes-1rora.pf-anim-scale .pf-card{transform:scale(.94)}
#pf-field-notes-1rora.pf-anim-slide .pf-card{transform:translateY(32px)}
#pf-field-notes-1rora.pf-pos-bottom-right{align-items:flex-end;justify-content:flex-end}
#pf-field-notes-1rora.pf-pos-bottom-center{align-items:flex-end;justify-content:center}
#pf-field-notes-1rora.pf-pos-top-bar{align-items:flex-start;justify-content:center}
#pf-field-notes-1rora.pf-pos-top-bar .pf-card{width:100%;max-width:960px}
#pf-field-notes-1rora.pf-pos-top-bar.pf-anim-slide .pf-card{transform:translateY(-32px)}
#pf-field-notes-1rora .pf-close{position:absolute;top:12px;right:12px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:999px;background:transparent;color:inherit;font-size:22px;line-height:1;cursor:pointer;opacity:.6;transition:opacity .15s ease}
#pf-field-notes-1rora .pf-close:hover{opacity:1}
#pf-field-notes-1rora .pf-close:focus-visible,#pf-field-notes-1rora .pf-btn:focus-visible{outline:2px solid #c8f751;outline-offset:3px}
#pf-field-notes-1rora .pf-image{display:block;width:100%;max-height:190px;object-fit:cover;border-radius:16px;margin:0 0 18px}
#pf-field-notes-1rora .pf-title{margin:0 0 10px;font-size:22px;line-height:1.25;font-weight:700;letter-spacing:-.01em;color:inherit}
#pf-field-notes-1rora .pf-body{margin:0 0 20px;font-size:15px;line-height:1.55;opacity:.82}
#pf-field-notes-1rora .pf-btn{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;padding:13px 18px;border-radius:18px;background:#c8f751;color:#141210;font-size:15px;font-weight:600;text-decoration:none;transition:filter .15s ease,transform .15s ease}
#pf-field-notes-1rora .pf-btn:hover{filter:brightness(1.06);transform:translateY(-1px)}
@media (max-width:640px){#pf-field-notes-1rora.pf-overlay{padding:16px}#pf-field-notes-1rora .pf-card{width:100%;padding:24px;border-radius:20px;max-height:calc(100vh - 32px)}#pf-field-notes-1rora.pf-pos-top-bar .pf-card{width:100%}}
@media (prefers-reduced-motion:reduce){#pf-field-notes-1rora.pf-overlay,#pf-field-notes-1rora .pf-card,#pf-field-notes-1rora .pf-btn{transition:none!important}}
</style>
<script>
(function () {
  var root = document.getElementById('pf-field-notes-1rora');
  if (!root) return;
  var KEY = 'popforge:pf-field-notes-1rora:seen';
  var MODE = 'session';
  var LOCK = true;
  var DISMISS = true;
  var card = root.querySelector('.pf-card');
  var closeBtn = root.querySelector('.pf-close');
  var lastFocus = null;
  var isOpen = false;
  function seen() {
    try {
      if (MODE === 'once' && window.localStorage.getItem(KEY)) return true;
      if (MODE === 'session' && window.sessionStorage.getItem(KEY)) return true;
    } catch (error) {
      return false;
    }
    return false;
  }
  function remember() {
    try {
      if (MODE === 'once') window.localStorage.setItem(KEY, '1');
      else if (MODE === 'session') window.sessionStorage.setItem(KEY, '1');
    } catch (error) {
      /* storage blocked: the popup simply behaves like "every visit" */
    }
  }
  function open() {
    if (isOpen) return;
    isOpen = true;
    lastFocus = document.activeElement;
    root.classList.add('is-open');
    root.setAttribute('aria-hidden', 'false');
    if (LOCK) document.documentElement.style.overflow = 'hidden';
    remember();
    var target = root.querySelector('[data-pf-focus]') || card;
    if (target && target.focus) {
      try { target.focus(); } catch (error) {}
    }
  }
  function close() {
    if (!isOpen) return;
    isOpen = false;
    root.classList.remove('is-open');
    root.setAttribute('aria-hidden', 'true');
    if (LOCK) document.documentElement.style.overflow = '';
    if (lastFocus && lastFocus.focus) {
      try { lastFocus.focus(); } catch (error) {}
    }
  }
  root.addEventListener('click', function (event) {
    if (DISMISS && event.target === root) close();
  });
  if (closeBtn) closeBtn.addEventListener('click', close);
  document.addEventListener('keydown', function (event) {
    if (event.key === 'Escape' || event.keyCode === 27) {
      if (isOpen) {
        event.preventDefault();
        close();
      }
      return;
    }
    if (event.key !== 'Tab' || !isOpen) return;
    var items = card.querySelectorAll('a[href],button,[tabindex]:not([tabindex="-1"])');
    if (!items.length) return;
    var first = items[0];
    var last = items[items.length - 1];
    if (event.shiftKey && document.activeElement === first) {
      event.preventDefault();
      last.focus();
    } else if (!event.shiftKey && document.activeElement === last) {
      event.preventDefault();
      first.focus();
    }
  });
  if (seen()) return;
  window.setTimeout(open, 4000);
})();
</script>
  • Esc closes · focus enters and returns
  • Overlay click dismissal on
  • Scroll lock on · mobile breakpoint at 640px
  • Storage key popforge:field-notes:seen

06 / widget

A whole popup builder you can paste into any site

This is a trimmed second builder: a single HTML block with its own scoped styles, no iframes and no dependencies. Drop it into a Webnode HTML block, a WordPress custom HTML block, or any page builder that accepts custom code.

Widget block—
Open standalone
Loading widget block…
  1. 01

    Copy the block

    Use “Copy widget code”. The block is self-contained: styles, markup and script travel together.

  2. 02

    Paste it into your site

    Add an HTML / embed element in Webnode, WordPress or Squarespace and paste the whole block unchanged.

  3. 03

    Open standalone to test

    Try the full builder in a new tab, change a field, then copy the refreshed code back into your page.