Repository navigation
Expand file tree
/
Copy pathwebinar-card.js
More file actions
107 lines (99 loc) · 5.49 KB
/
Copy pathwebinar-card.js
File metadata and controls
107 lines (99 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Floating registration card for the "Bruno 101 + Automation Deep Dive" webinar.
// Desktop: card pinned bottom-right. Mobile: slim bar pinned to the bottom edge.
// Auto-hides once the event ends; safe to delete after 2026-10-28.
(function () {
var KEY = "bruno-webinar-2026-10-28";
// Runs 11:00 AM - 12:00 PM EDT (3:00 - 4:00 PM GMT). UK clocks fall back on Oct 25,
// US not until Nov 1, so the UK time is an hour earlier than the usual BST pairing.
var ENDS = Date.parse("2026-10-28T16:00:00Z"); // 12:00 PM EDT
if (Date.now() >= ENDS) return;
try {
if (localStorage.getItem(KEY)) return;
} catch (e) {
// Private browsing / storage blocked — show the card, just don't persist dismissal.
}
var render = function () {
if (document.getElementById("bru-webinar")) return;
var el = document.createElement("div");
el.innerHTML =
"<style>" +
// right/max-width track --assistant-sheet-width so the card slides aside when the AI
// assistant panel opens, the same way Mintlify's own fixed navbar does.
// z-index 39 keeps the card above page content but UNDER the search
// modal's z-40 scrim, so it dims with the rest of the page.
"#bru-webinar{position:fixed;bottom:1.25rem;z-index:39;width:20rem;" +
"right:calc(1.25rem + var(--assistant-sheet-width, 0px));" +
"max-width:calc(100vw - 2.5rem - var(--assistant-sheet-width, 0px));" +
"padding:1rem;border-radius:.75rem;border:1px solid #E5E7EB;" +
"background:#fff;color:#111827;box-shadow:0 10px 30px rgba(0,0,0,.12);font-size:.875rem;" +
"line-height:1.4}" +
".dark #bru-webinar{background:#0F1117;border-color:#26272B;color:#F3F4F6;" +
"box-shadow:0 10px 30px rgba(0,0,0,.5)}" +
"#bru-webinar .bru-eyebrow{display:flex;align-items:center;gap:.4rem;font-size:.6875rem;" +
"font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#C2410C}" +
"#bru-webinar .bru-dot{flex:none;width:.4rem;height:.4rem;border-radius:9999px;" +
"background:#C2410C}" +
// #F2994A is only ~2.2:1 on the light card, but ~8.5:1 on the dark one — keep it there.
".dark #bru-webinar .bru-eyebrow{color:#F2994A}" +
".dark #bru-webinar .bru-dot{background:#F2994A}" +
"#bru-webinar .bru-narrow{display:none}" +
"#bru-webinar h4{margin:.5rem 0 .25rem;font-size:.9375rem;font-weight:600}" +
"#bru-webinar p{margin:0;opacity:.7;font-size:.8125rem}" +
"#bru-webinar a.bru-cta{display:inline-block;margin-top:.75rem;padding:.4rem .75rem;" +
// Dark ink on the orange: white was only ~2.2:1, this is ~8:1.
"border-radius:.5rem;background:#F2994A;color:#111827;font-weight:600;" +
"text-decoration:none}" +
"#bru-webinar button{position:absolute;top:.5rem;right:.5rem;border:0;background:none;" +
"cursor:pointer;color:inherit;opacity:.5;font-size:1rem;line-height:1;padding:.25rem}" +
"#bru-webinar button:hover{opacity:1}" +
// Below 1024px the assistant is a bottom drawer, and search/mobile-nav are modals — all
// Radix dialogs. Stand down entirely rather than cover their inputs.
"html:has([role=dialog][data-state=open]) #bru-webinar{display:none}" +
// Mobile: collapse the card into a single-line bar across the bottom edge.
"@media (max-width:640px){" +
"#bru-webinar{left:0;right:0;bottom:0;width:auto;max-width:none;display:flex;" +
"align-items:center;gap:.625rem;padding:.625rem .875rem;" +
"padding-bottom:calc(.625rem + env(safe-area-inset-bottom));border-radius:0;" +
"border-left:0;border-right:0;border-bottom:0;box-shadow:0 -4px 16px rgba(0,0,0,.1)}" +
".dark #bru-webinar{box-shadow:0 -4px 16px rgba(0,0,0,.5)}" +
"#bru-webinar h4,#bru-webinar p,#bru-webinar .bru-wide{display:none}" +
"#bru-webinar .bru-narrow{display:inline}" +
"#bru-webinar .bru-eyebrow{flex:1;min-width:0}" +
"#bru-webinar .bru-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}" +
"#bru-webinar a.bru-cta{flex:none;margin-top:0;font-size:.8125rem}" +
"#bru-webinar button{position:static;flex:none;font-size:1.125rem}" +
"}" +
"</style>" +
'<div id="bru-webinar" role="complementary" aria-label="Upcoming webinar">' +
'<button type="button" aria-label="Dismiss webinar notification">×</button>' +
'<div class="bru-eyebrow"><span class="bru-dot"></span>' +
'<span class="bru-label"><span class="bru-wide">Live webinar</span>' +
'<span class="bru-narrow">Bruno 101</span> · Oct 28</span></div>' +
"<h4>Bruno 101 + Automation Deep Dive</h4>" +
"<p>11:00 AM EDT / 3:00 PM GMT · Zoom</p>" +
'<a class="bru-cta" href="https://www.usebruno.com/webinar" target="_blank" rel="noopener">' +
"Register →</a>" +
"</div>";
document.body.appendChild(el);
el.querySelector("button").addEventListener("click", function () {
try {
localStorage.setItem(KEY, "1");
} catch (e) {}
el.remove();
});
// A tab left open past the end time should lose the card too, not just on the
// next page load. setTimeout overflows past 2^31-1 ms (~24.8 days) and fires at
// once, so only arm it inside that window; earlier loads rely on the check above.
var wait = ENDS - Date.now();
if (wait > 0 && wait <= 2147483647) {
setTimeout(function () {
el.remove();
}, wait);
}
};
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", render);
} else {
render();
}
})();