|
|
|
@ -9,15 +9,18 @@ const menuMap = { |
|
|
|
"/contact": { label: "Contact Us" }, |
|
|
|
"/contact": { label: "Contact Us" }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default function SubHero({ title, desc, navItems }) { |
|
|
|
export default function SubHero({ title, desc, navItems, rightSlot }) { |
|
|
|
const { pathname } = useLocation(); |
|
|
|
const { pathname } = useLocation(); |
|
|
|
const titleLines = typeof title === "string" ? title.split("\n") : [title]; |
|
|
|
const titleLines = typeof title === "string" ? title.split("\n") : [title]; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<section className="sh4"> |
|
|
|
<section className={`sh4${rightSlot ? " sh4--split" : ""}`}> |
|
|
|
<div className="sh4-inner"> |
|
|
|
<div className="sh4-inner"> |
|
|
|
<span className="sh4-label">{menuMap["/" + pathname.split("/")[1]]?.label}</span> |
|
|
|
<div className="sh4-left"> |
|
|
|
|
|
|
|
<motion.span className="sh4-label" initial={{ opacity: 0, y: 12 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.6, ease: [0.16, 1, 0.3, 1] }}> |
|
|
|
|
|
|
|
{menuMap["/" + pathname.split("/")[1]]?.label} |
|
|
|
|
|
|
|
</motion.span> |
|
|
|
|
|
|
|
|
|
|
|
<h1 className="sh4-title"> |
|
|
|
<h1 className="sh4-title"> |
|
|
|
{titleLines.map((line, li) => ( |
|
|
|
{titleLines.map((line, li) => ( |
|
|
|
@ -26,10 +29,10 @@ export default function SubHero({ title, desc, navItems }) { |
|
|
|
<motion.span |
|
|
|
<motion.span |
|
|
|
key={ci} |
|
|
|
key={ci} |
|
|
|
className="sh4-char" |
|
|
|
className="sh4-char" |
|
|
|
initial={{ opacity: 0, y: 16 }} |
|
|
|
initial={{ opacity: 0 }} |
|
|
|
animate={{ opacity: 1, y: 0 }} |
|
|
|
animate={{ opacity: 1 }} |
|
|
|
transition={{ |
|
|
|
transition={{ |
|
|
|
duration: 0.5, |
|
|
|
duration: 0.6, |
|
|
|
delay: li * 0.08 + ci * 0.022, |
|
|
|
delay: li * 0.08 + ci * 0.022, |
|
|
|
ease: [0.16, 1, 0.3, 1], |
|
|
|
ease: [0.16, 1, 0.3, 1], |
|
|
|
}} |
|
|
|
}} |
|
|
|
@ -41,7 +44,18 @@ export default function SubHero({ title, desc, navItems }) { |
|
|
|
))} |
|
|
|
))} |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
|
|
|
|
|
|
|
|
{desc && <p className="sh4-desc">{desc}</p>} |
|
|
|
{desc && ( |
|
|
|
|
|
|
|
<motion.p className="sh4-desc" initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.7, delay: 0.8, ease: [0.16, 1, 0.3, 1] }}> |
|
|
|
|
|
|
|
{desc} |
|
|
|
|
|
|
|
</motion.p> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{rightSlot && ( |
|
|
|
|
|
|
|
<motion.div className="sh4-right" initial={{ opacity: 0, x: 24 }} animate={{ opacity: 1, x: 0 }} transition={{ duration: 0.8, delay: 0.4, ease: [0.16, 1, 0.3, 1] }}> |
|
|
|
|
|
|
|
{rightSlot} |
|
|
|
|
|
|
|
</motion.div> |
|
|
|
|
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
|
|
|
|
|
|
|
|
|