diff --git a/public/announce.js b/public/announce.js new file mode 100644 index 0000000..a6bee58 --- /dev/null +++ b/public/announce.js @@ -0,0 +1,114 @@ +/* announce.js β dismissible event pop-up overlay (RM Circle). + Weekly one-off: edit the EV block below each week (or set enabled:false to hide). + Self-gating: shows once per browser until dismissed, and never after `expiresUTC`. */ +(function () { + var EV = { + id: 'huddle-2026-09-08', // bump this when the event changes (resets dismissals) + enabled: true, + img: '/huddle-flyer.jpg', + meet: 'https://meet.google.com/gsw-yhqn-zrc', + eyebrow: 'Team RM Circle Β· Weekly Huddle', + dateLabel: 'Tuesday, September 8', + times: [ + ['πΊπΈ', '7:00 PM CST', 'USA / Canada'], + ['πΊπΈ', '8:00 PM EST', ''], + ['πΉπΉ', '8:00 PM AST', 'Caribbean'], + ['π¬π§', '1:00 AM', 'UK'] + ], + expiresUTC: '2026-09-09T02:30:00Z' // ~9:30 PM CT Sept 8 (after the huddle ends) + }; + + if (!EV.enabled) return; + if (Date.now() > Date.parse(EV.expiresUTC)) return; + var KEY = 'rmc-announce-' + EV.id; + try { if (localStorage.getItem(KEY) === 'done') return; } catch (e) {} + function dismiss() { try { localStorage.setItem(KEY, 'done'); } catch (e) {} close(); } + + var back, card; + function close() { + if (!back) return; + back.style.opacity = '0'; + setTimeout(function () { if (back && back.parentNode) back.parentNode.removeChild(back); back = null; }, 260); + document.removeEventListener('keydown', onKey); + } + function onKey(e) { if (e.key === 'Escape') dismiss(); } + + function build() { + back = document.createElement('div'); + back.setAttribute('role', 'dialog'); + back.setAttribute('aria-label', 'Team RM Circle Weekly Huddle invitation'); + back.style.cssText = 'position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;' + + 'padding:20px;background:rgba(3,7,14,.82);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);' + + 'opacity:0;transition:opacity .28s ease;overflow:auto;'; + back.addEventListener('click', function (e) { if (e.target === back) dismiss(); }); + + card = document.createElement('div'); + card.style.cssText = 'position:relative;width:100%;max-width:428px;max-height:94vh;overflow:auto;border-radius:20px;' + + 'background:#0a1119;border:1px solid rgba(212,175,55,.55);box-shadow:0 24px 70px rgba(0,0,0,.7),0 0 0 1px rgba(212,175,55,.15);' + + 'font-family:system-ui,Segoe UI,Arial,sans-serif;'; + + var x = document.createElement('button'); + x.setAttribute('aria-label', 'Close'); + x.innerHTML = '×'; + x.style.cssText = 'position:absolute;top:10px;right:12px;z-index:2;width:38px;height:38px;border-radius:50%;border:none;cursor:pointer;' + + 'background:rgba(6,10,16,.72);color:#fff;font-size:24px;line-height:1;font-weight:700;display:grid;place-items:center;' + + 'box-shadow:0 2px 10px rgba(0,0,0,.5);'; + x.addEventListener('click', dismiss); + + var eyebrow = document.createElement('div'); + eyebrow.textContent = EV.eyebrow; + eyebrow.style.cssText = 'text-align:center;letter-spacing:2px;text-transform:uppercase;font-size:11px;font-weight:700;' + + 'color:#d4af37;padding:14px 44px 10px;'; + + var img = document.createElement('img'); + img.src = EV.img; + img.alt = 'You are invited β RM Circle online presentation, Tuesday 7:00 PM Central, via Google Meet'; + img.style.cssText = 'display:block;width:100%;height:auto;'; + + var foot = document.createElement('div'); + foot.style.cssText = 'padding:16px 20px 20px;'; + + var dateRow = document.createElement('div'); + dateRow.innerHTML = 'π ' + EV.dateLabel + ''; + dateRow.style.cssText = 'text-align:center;color:#eef2f7;font-size:15px;margin-bottom:12px;'; + + var grid = document.createElement('div'); + grid.style.cssText = 'display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px;'; + EV.times.forEach(function (t) { + var cell = document.createElement('div'); + cell.style.cssText = 'background:rgba(212,175,55,.08);border:1px solid rgba(212,175,55,.22);border-radius:10px;padding:8px 10px;'; + cell.innerHTML = '