2026-06-03 23:02:27 -08:00
|
|
|
var FIXED_BUFFER = 0; // breathing room below fixed header when menu is closed
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
|
|
|
|
|
// Returns the effective scroll offset to clear the header.
|
|
|
|
|
// When the hamburger is open, offsetHeight already includes the expanded nav,
|
|
|
|
|
// so no extra buffer is needed. When closed, add FIXED_BUFFER for breathing room.
|
|
|
|
|
function headerOffset() {
|
2026-06-13 23:38:35 -08:00
|
|
|
var header = /** @type {HTMLElement | null} */ (document.querySelector(".rpt-header"));
|
2026-06-03 23:02:27 -08:00
|
|
|
if (!header) return 0;
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
var pos = window.getComputedStyle(header).position;
|
2026-06-03 23:02:27 -08:00
|
|
|
if (pos !== "fixed" && pos !== "sticky") return 0;
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
var nav = document.getElementById("rpt-main-nav");
|
|
|
|
|
var menuOpen = nav && nav.classList.contains("is-open");
|
|
|
|
|
return header.offsetHeight + (menuOpen ? 0 : FIXED_BUFFER);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-13 23:38:35 -08:00
|
|
|
/** @param {Element} el @param {boolean} [animate] */
|
2026-06-08 18:14:22 -08:00
|
|
|
function scrollToEl(el, animate) {
|
|
|
|
|
var top = Math.max(0, el.getBoundingClientRect().top + window.scrollY - headerOffset());
|
|
|
|
|
window.scrollTo({ top: top, behavior: animate ? "smooth" : "instant" });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.rptScrollTo = scrollToEl;
|
|
|
|
|
|
2026-06-03 23:13:32 -08:00
|
|
|
// On load: scroll to the anchor from either the URL hash or drupalSettings
|
|
|
|
|
// (set by the server when rendering the home page at a clean URL like /services).
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
2026-06-03 23:13:32 -08:00
|
|
|
var settings = window.drupalSettings && window.drupalSettings.riversidePt;
|
|
|
|
|
var anchor = window.location.hash || (settings && settings.scrollTo);
|
|
|
|
|
if (!anchor) return;
|
2026-06-13 23:38:35 -08:00
|
|
|
const target = document.querySelector(anchor);
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
if (!target) return;
|
|
|
|
|
requestAnimationFrame(function () {
|
2026-06-08 18:14:22 -08:00
|
|
|
scrollToEl(target, false);
|
2026-06-03 21:14:39 -08:00
|
|
|
});
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.addEventListener("click", function (e) {
|
2026-06-13 23:38:35 -08:00
|
|
|
if (!(e.target instanceof Element)) return;
|
|
|
|
|
var link = /** @type {HTMLElement | null} */ (e.target.closest("[data-scroll-to]"));
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
if (!link) return;
|
2026-06-13 23:38:35 -08:00
|
|
|
var target = document.querySelector(link.dataset.scrollTo || "");
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
if (!target) return;
|
|
|
|
|
e.preventDefault();
|
2026-06-03 23:05:52 -08:00
|
|
|
history.pushState({}, "", link.getAttribute("href"));
|
2026-06-08 18:14:22 -08:00
|
|
|
scrollToEl(target, true);
|
Create custom /contact page with details and appointment CTAs
- Refactor AboutController to PageController to handle multiple static pages:
- /about
- /services/{slug} (diagnostic, sports, pre-post, neuro)
- /contact (new)
- New template riverside-pt-contact.html.twig:
- Contact details (address, phone, email)
- Office hours
- 'Send us a message' section directing to booking tool
- Multiple 'Make an Appointment' links back to /home#book-an-appointment
- Updated riverside_pt.routing.yml with riverside_pt.contact route
- Registered 'riverside_pt_contact' theme in riverside_pt.module
- Updated riverside_pt.install to skip legacy node creation for 'Contact' (and previously About/Services) to avoid alias conflicts
- Minor updates to home template, header handling, libraries (scroll support), and other controllers for consistency with page flows and email/booking features
All details pages (/about, /services/*, /contact) now include clear links back to 'Make an Appointment'.
2026-06-03 22:55:02 -08:00
|
|
|
});
|