Compare commits
2
Commits
210117e73e
...
1b7824b265
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b7824b265 | ||
|
|
96ea8fc0d1 |
@@ -1,11 +1,19 @@
|
|||||||
---
|
---
|
||||||
// MobileStickyCtaBar — Sticky bottom action bar for mobile/tablet (<768px)
|
// MobileStickyCtaBar — Sticky bottom action bar for mobile/tablet (<768px)
|
||||||
// 3 equal columns: Call, WhatsApp, Quote
|
// 3 equal columns: Call, Chat (WhatsApp), Quote
|
||||||
// - Fixed to bottom of viewport
|
// - Fixed to bottom of viewport
|
||||||
// - Respects safe-area-inset-bottom on iOS
|
// - Respects safe-area-inset-bottom on iOS
|
||||||
// - Hidden at md+ breakpoints (>=768px)
|
// - Hidden at md+ breakpoints (>=768px)
|
||||||
// - Hidden on print
|
// - Hidden on print
|
||||||
// - Light + dark theme aware
|
// - Light + dark theme aware
|
||||||
|
//
|
||||||
|
// Label policy (post-polish):
|
||||||
|
// - Short, action-led verbs (max ~7 chars) so they never truncate even at 320px.
|
||||||
|
// - Visible text intentionally terse; aria-label carries the full descriptive
|
||||||
|
// phrasing for screen readers (Apple HIG / WCAG SC 2.5.3 name-in-name).
|
||||||
|
// - 24px inline SVG icons sit above each label. Tap target is ~64px tall
|
||||||
|
// and >=44px wide per column at 320px (320 / 3 ≈ 106px), satisfying
|
||||||
|
// Apple HIG (44x44) and WCAG 2.5.5 (Target Size).
|
||||||
---
|
---
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
@@ -15,13 +23,15 @@
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="tel:+919561417403"
|
href="tel:+919561417403"
|
||||||
aria-label="Call WorkRoot"
|
aria-label="Call us"
|
||||||
data-testid="mobile-cta-call"
|
data-testid="mobile-cta-call"
|
||||||
class="mobile-sticky-cta__btn"
|
class="mobile-sticky-cta__btn"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="mobile-sticky-cta__icon"
|
class="mobile-sticky-cta__icon"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
@@ -40,13 +50,15 @@
|
|||||||
href="https://wa.me/919561417403?text=Hi%20WorkRoot%2C%20I%27d%20like%20to%20discuss%20a%20project."
|
href="https://wa.me/919561417403?text=Hi%20WorkRoot%2C%20I%27d%20like%20to%20discuss%20a%20project."
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
aria-label="Chat on WhatsApp"
|
aria-label="Chat with us on WhatsApp"
|
||||||
data-testid="mobile-cta-whatsapp"
|
data-testid="mobile-cta-whatsapp"
|
||||||
class="mobile-sticky-cta__btn mobile-sticky-cta__btn--whatsapp"
|
class="mobile-sticky-cta__btn mobile-sticky-cta__btn--whatsapp"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="mobile-sticky-cta__icon"
|
class="mobile-sticky-cta__icon"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
@@ -54,18 +66,20 @@
|
|||||||
>
|
>
|
||||||
<path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.464 3.488"/>
|
<path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.464 3.488"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="mobile-sticky-cta__label">WhatsApp</span>
|
<span class="mobile-sticky-cta__label">Chat</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href="/contact"
|
href="/contact"
|
||||||
aria-label="Request a quote"
|
aria-label="Get a free quote"
|
||||||
data-testid="mobile-cta-quote"
|
data-testid="mobile-cta-quote"
|
||||||
class="mobile-sticky-cta__btn mobile-sticky-cta__btn--accent"
|
class="mobile-sticky-cta__btn mobile-sticky-cta__btn--accent"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="mobile-sticky-cta__icon"
|
class="mobile-sticky-cta__icon"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
@@ -96,7 +110,7 @@
|
|||||||
border-top: 1px solid rgba(15, 23, 42, 0.08);
|
border-top: 1px solid rgba(15, 23, 42, 0.08);
|
||||||
box-shadow: 0 -8px 20px -8px rgba(15, 23, 42, 0.18);
|
box-shadow: 0 -8px 20px -8px rgba(15, 23, 42, 0.18);
|
||||||
padding-bottom: env(safe-area-inset-bottom, 0px);
|
padding-bottom: env(safe-area-inset-bottom, 0px);
|
||||||
/* Ensure no horizontal overflow on very narrow viewports */
|
/* Ensure no horizontal overflow on very narrow viewports (down to 320px) */
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@@ -112,8 +126,12 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 2px;
|
gap: 4px;
|
||||||
min-height: 56px;
|
/* 44x44 minimum tap target per Apple HIG / WCAG 2.5.5.
|
||||||
|
64px gives comfortable thumb-zone clearance for the 24px icon
|
||||||
|
+ 12px label without ever clipping. */
|
||||||
|
min-height: 64px;
|
||||||
|
min-width: 44px;
|
||||||
padding: 8px 6px;
|
padding: 8px 6px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #0f172a;
|
color: #0f172a;
|
||||||
@@ -157,15 +175,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mobile-sticky-cta__icon {
|
.mobile-sticky-cta__icon {
|
||||||
width: 22px;
|
width: 24px;
|
||||||
height: 22px;
|
height: 24px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-sticky-cta__label {
|
.mobile-sticky-cta__label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 11px;
|
/* Font tuned so labels (Call/Chat/Quote, ≤5 chars) never overflow
|
||||||
|
even at 320px (column ≈ 106px – 12px padding = 94px usable).
|
||||||
|
The nowrap + ellipsis pair below is a defensive safety net only —
|
||||||
|
at the tuned sizes it should never visibly trigger. */
|
||||||
|
font-size: 12px;
|
||||||
letter-spacing: 0.01em;
|
letter-spacing: 0.01em;
|
||||||
|
max-width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Drop label font a hair on the smallest phones (iPhone SE: 320px).
|
||||||
|
This keeps the ellipsis safety net from ever triggering even if the
|
||||||
|
system font swaps in slightly wider glyphs. */
|
||||||
|
@media (max-width: 359px) {
|
||||||
|
.mobile-sticky-cta__label {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
.mobile-sticky-cta__btn {
|
||||||
|
padding: 8px 4px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide on tablets/desktops (>=768px = Tailwind md breakpoint).
|
/* Hide on tablets/desktops (>=768px = Tailwind md breakpoint).
|
||||||
|
|||||||
@@ -292,8 +292,12 @@ const fullTitle = title === 'Home' ? siteName : `${title} | ${siteName}`;
|
|||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
||||||
<!-- Spacer to ensure footer/content clears the mobile sticky CTA bar (<md only) -->
|
<!-- Spacer to ensure footer/content (incl. PricingTimelineBand, GuaranteeBand,
|
||||||
<div aria-hidden="true" class="md:hidden h-[calc(64px+env(safe-area-inset-bottom,0px))] w-full"></div>
|
and any other bottom-of-page sections) clears the mobile sticky CTA bar.
|
||||||
|
Bar min-height is 64px; we use 72px here so there is always an 8px
|
||||||
|
visual breathing strip between the last band and the sticky bar.
|
||||||
|
<md only — bar is hidden at md+. -->
|
||||||
|
<div aria-hidden="true" class="md:hidden h-[calc(72px+env(safe-area-inset-bottom,0px))] w-full"></div>
|
||||||
|
|
||||||
<!-- Mobile sticky bottom CTA bar (visible <md) -->
|
<!-- Mobile sticky bottom CTA bar (visible <md) -->
|
||||||
<MobileStickyCtaBar />
|
<MobileStickyCtaBar />
|
||||||
|
|||||||
Reference in New Issue
Block a user