Files
dylanmazzei-website/static/assets/book.js
T
Alejandro Veras 75d8cbc7f7 Embed the GoHighLevel lead form and booking calendars
/contact/ now uses the GHL "Dylan – Lead Form", and a new /contact/book/
page lets visitors pick the free intro call or the paid 1:1 and book it in
the matching GHL calendar. Both calendars load up front so switching tabs is
instant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:43:35 -04:00

22 lines
890 B
JavaScript

(function () {
var tabs = document.querySelectorAll('[data-call]');
var select = function (id, scroll) {
tabs.forEach(function (t) {
var on = t.getAttribute('data-call') === id;
t.setAttribute('aria-selected', String(on));
var panel = document.getElementById('cal-' + t.getAttribute('data-call'));
if (panel) { if (on) panel.removeAttribute('data-off'); else panel.setAttribute('data-off', ''); }
});
if (scroll) document.getElementById('schedule').scrollIntoView({ behavior: 'smooth', block: 'start' });
};
tabs.forEach(function (t) {
t.addEventListener('click', function () {
var id = t.getAttribute('data-call');
select(id, true);
try { history.replaceState(null, '', '#' + id); } catch (e) {}
});
});
var hash = location.hash.replace('#', '');
if (hash === 'free' || hash === 'vip') select(hash, false);
})();