fix: pill modunda telefon link'i gizle (sıkışma sorunu)
Header pill modunda max-width 1100px'e iniyor. Nav + telefon + CTA 3 element sığmıyordu, telefon ile 'Ücretsiz Teklif' butonu üst üste biniyordu. Çözüm: - Telefon link'ine data-pill-hide='true' attribute eklendi - header-scroll.tsx scroll'da bu elementleri display:none yapıyor - Pill kapanınca tekrar görünür hale geliyor - whitespace-nowrap CTA butonuna eklendi (taşma engeli)
This commit is contained in:
@@ -29,6 +29,10 @@ export function HeaderScrollEffect() {
|
|||||||
if (!mobile && pillWrap && header && navBar && wrap) {
|
if (!mobile && pillWrap && header && navBar && wrap) {
|
||||||
wrap.style.transform = "";
|
wrap.style.transform = "";
|
||||||
wrap.style.opacity = "";
|
wrap.style.opacity = "";
|
||||||
|
// Pill modu için data-pill-hide elementlerini gizle/göster
|
||||||
|
const hidables = document.querySelectorAll<HTMLElement>(
|
||||||
|
'[data-pill-hide="true"]',
|
||||||
|
);
|
||||||
if (scrolled) {
|
if (scrolled) {
|
||||||
pillWrap.style.padding = "12px 16px 0";
|
pillWrap.style.padding = "12px 16px 0";
|
||||||
header.style.maxWidth = "1100px";
|
header.style.maxWidth = "1100px";
|
||||||
@@ -37,6 +41,9 @@ export function HeaderScrollEffect() {
|
|||||||
header.style.boxShadow = "0 8px 24px rgba(0,0,0,0.08)";
|
header.style.boxShadow = "0 8px 24px rgba(0,0,0,0.08)";
|
||||||
navBar.style.height = "52px";
|
navBar.style.height = "52px";
|
||||||
navBar.style.padding = "0 1.25rem";
|
navBar.style.padding = "0 1.25rem";
|
||||||
|
hidables.forEach((el) => {
|
||||||
|
el.style.display = "none";
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
pillWrap.style.padding = "";
|
pillWrap.style.padding = "";
|
||||||
header.style.maxWidth = "";
|
header.style.maxWidth = "";
|
||||||
@@ -45,6 +52,9 @@ export function HeaderScrollEffect() {
|
|||||||
header.style.boxShadow = "";
|
header.style.boxShadow = "";
|
||||||
navBar.style.height = "";
|
navBar.style.height = "";
|
||||||
navBar.style.padding = "";
|
navBar.style.padding = "";
|
||||||
|
hidables.forEach((el) => {
|
||||||
|
el.style.display = "";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,16 +139,19 @@ export async function Header() {
|
|||||||
|
|
||||||
{/* Col 3 — CTA */}
|
{/* Col 3 — CTA */}
|
||||||
<div className="flex items-center justify-end gap-2">
|
<div className="flex items-center justify-end gap-2">
|
||||||
|
{/* Phone — pill modunda gizlenir (header-scroll.tsx) */}
|
||||||
<a
|
<a
|
||||||
href={`tel:${phoneRaw}`}
|
href={`tel:${phoneRaw}`}
|
||||||
className="hidden lg:inline-flex h-9 items-center gap-1.5 rounded-lg px-3 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900"
|
data-pill-hide="true"
|
||||||
|
className="hidden h-9 items-center gap-1.5 rounded-lg px-3 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 xl:inline-flex"
|
||||||
|
aria-label={phone}
|
||||||
>
|
>
|
||||||
<Phone className="size-3.5" />
|
<Phone className="size-3.5" />
|
||||||
<span className="hidden xl:inline">{phone}</span>
|
<span>{phone}</span>
|
||||||
</a>
|
</a>
|
||||||
<Link
|
<Link
|
||||||
href="/iletisim"
|
href="/iletisim"
|
||||||
className="inline-flex h-9 items-center justify-center rounded-lg bg-[var(--navy)] px-4 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-[var(--navy-700)]"
|
className="inline-flex h-9 items-center justify-center whitespace-nowrap rounded-lg bg-[var(--navy)] px-4 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-[var(--navy-700)]"
|
||||||
>
|
>
|
||||||
Ücretsiz Teklif
|
Ücretsiz Teklif
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user