newsletter: site-wide signup modal with 7-day dismiss

Renders on every page via root layout. Behavior:
- 5s delay after first paint so it doesn't slam the user.
- Animates from a pill into the full card (bb-modal-pop keyframe);
  respects prefers-reduced-motion.
- Heading "Get the latest in broadcast & media", email field,
  Subscribe + "Not now" + close (X).
- Subscribe POSTs to the existing /api/newsletter/subscribe route
  (native system — newsletter_subscribers table + SMTP welcome
  via Mailcow/SMTP2GO). Listmonk wasn't installed anywhere on the
  infra; switching to it later is a one-line URL change.
- "Not now" + backdrop click + Escape + X all dismiss for 7 days
  via localStorage["bb_newsletter_dismissed"].
- On success → "Check your email" panel + auto-close at 4s;
  subscribed flag stored in localStorage so the modal never
  re-prompts that visitor.

Styling matches the site's dark-navy + electric-blue palette
(NOT the neon ticker palette). No layout/page shifts — overlay
only.
This commit is contained in:
Ryan Salazar
2026-05-20 17:55:29 +00:00
parent 418027b469
commit 8f8eaa5fe8
3 changed files with 453 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import SystemStatusBar from '@/components/SystemStatusBar';
import AskBBAI from '@/components/AskBBAI';
import GoogleAnalytics from '@/components/GoogleAnalytics';
import CookieConsent from '@/components/CookieConsent';
import NewsletterModal from '@/components/NewsletterModal';
export const viewport: Viewport = {
width: 'device-width',
@@ -135,6 +136,7 @@ export default function RootLayout({
{children}
</div>
<CookieConsent />
<NewsletterModal />
<AskBBAI />
</body>
</html>);