-
Звонок
-
+
{/* `max-md`, not the `narrow` variant: `narrow` is max-width 760 and the
bar is min-width 760, so at exactly 760px both would hide and the page
would have no CTA at all. `max-md` is the exact complement of `md`. */}
diff --git a/medcenterphysio/src/hooks/useBodyLock.ts b/medcenterphysio/src/hooks/useBodyLock.ts
new file mode 100644
index 0000000..205e7fa
--- /dev/null
+++ b/medcenterphysio/src/hooks/useBodyLock.ts
@@ -0,0 +1,10 @@
+import { useEffect } from 'react'
+
+/** Freezes background scrolling while a modal is open. */
+export function useBodyLock(locked: boolean) {
+ useEffect(() => {
+ if (!locked) return
+ document.body.classList.add('is-locked')
+ return () => document.body.classList.remove('is-locked')
+ }, [locked])
+}
diff --git a/medcenterphysio/src/hooks/useEscapeKey.ts b/medcenterphysio/src/hooks/useEscapeKey.ts
new file mode 100644
index 0000000..d217bf6
--- /dev/null
+++ b/medcenterphysio/src/hooks/useEscapeKey.ts
@@ -0,0 +1,12 @@
+import { useEffect } from 'react'
+
+export function useEscapeKey(active: boolean, onEscape: () => void) {
+ useEffect(() => {
+ if (!active) return
+ const onKeyDown = (event: KeyboardEvent) => {
+ if (event.key === 'Escape') onEscape()
+ }
+ window.addEventListener('keydown', onKeyDown)
+ return () => window.removeEventListener('keydown', onKeyDown)
+ }, [active, onEscape])
+}
diff --git a/medcenterphysio/src/index.css b/medcenterphysio/src/index.css
index d0f2c7d..3fe3770 100644
--- a/medcenterphysio/src/index.css
+++ b/medcenterphysio/src/index.css
@@ -27,6 +27,8 @@
--color-paper: #f5fafb;
--color-ink: #0a2540;
--color-muted: #60778b;
+ /* Inputs on the white callback dialog. */
+ --color-field: #f7fafb;
--color-footer: #041524;
/* The dark "сценарии выручки" band sits between navy and navy-deep. */
--color-scenario: #071f35;
@@ -84,6 +86,10 @@
overflow-x: hidden;
}
+ body.is-locked {
+ overflow: hidden;
+ }
+
/* The fixed header is 78px tall; anchors must clear it. */
section[id] {
scroll-margin-top: 78px;