11import { useEffect , useRef } from "react" ;
22import { motion } from "framer-motion" ;
3+ import "./TitleHero.css" ;
34
45interface PageHeader {
56 pageTitle : string ;
@@ -10,44 +11,39 @@ const TitleHero = ({ pageTitle, pageDescription }: PageHeader) => {
1011 const ref = useRef < HTMLDivElement > ( null ) ;
1112
1213 return (
13- < div className = "grid grid-cols-1 grid-rows-1 items-center md:mt-10 relative overflow-clip" >
14- { /* Background */ }
15- < div
16- className = "col-start-1 row-start-1 absolute -z-10 stroke-width text-9xl font-black md:text-[256px] whitespace-nowrap left-1/2"
17- style = { {
18- color : "transparent" ,
19- WebkitTextStrokeColor : "#767676" ,
20- } }
21- ref = { ref } >
14+ < div className = "hero-container" >
15+ < div className = "hero-bigtext" >
16+ { /* Background Text */ }
2217 < motion . div
23- className = " relative -left-1/2 "
24- initial = { { opacity : 0 , letterSpacing : "20rem" , textIndent : "20rem" } }
25- whileInView = { { opacity : 1 , letterSpacing : "0px" , textIndent : "0px" } }
18+ className = "hero-background "
19+ initial = { { opacity : 0 } }
20+ whileInView = { { opacity : 1 } }
2621 transition = { { delay : 0.4 , duration : 0.8 , ease : "anticipate" , type : "tween" } }
27- viewport = { { once : true } } >
22+ viewport = { { once : true } }
23+ >
2824 { pageTitle }
2925 </ motion . div >
26+
27+ { /* Foreground Content */ }
28+ < motion . div
29+ className = "hero-title"
30+ initial = { { opacity : 0 , letterSpacing : "20rem" , textIndent : "20rem" } }
31+ whileInView = { { opacity : 1 , letterSpacing : "0px" , textIndent : "0px" } }
32+ transition = { { duration : 1.2 , ease : "anticipate" , type : "tween" } }
33+ viewport = { { once : true } }
34+ >
35+ < h1 > { pageTitle } </ h1 >
36+ </ motion . div >
3037 </ div >
31- { /* Foreground */ }
32- < div className = "col-start-1 row-start-1 pt-48 px-8 j" >
33- < div className = "justify-self-center flex flex-col gap-3 md:items-center md:gap-5" >
34- < motion . div
35- className = "z-1 text-5xl font-black md:text-7xl lg:text-[96px] md:whitespace-nowrap"
36- initial = { { opacity : 0 , letterSpacing : "20rem" , textIndent : "20rem" } }
37- whileInView = { { opacity : 1 , letterSpacing : "0px" , textIndent : "0px" } }
38- transition = { { duration : 1.2 , ease : "anticipate" , type : "tween" } }
39- viewport = { { once : true } } >
40- < h1 > { pageTitle } </ h1 >
41- </ motion . div >
42- < motion . div
43- className = "md:w-2/5"
44- initial = { { opacity : 0 , y : - 40 } }
45- animate = { { opacity : 1 , y : 0 } }
46- transition = { { delay : 1 } } >
47- < p > { pageDescription } </ p >
48- </ motion . div >
49- </ div >
50- </ div >
38+
39+ < motion . div
40+ className = "hero-description"
41+ initial = { { opacity : 0 , y : - 40 } }
42+ animate = { { opacity : 1 , y : 0 } }
43+ transition = { { delay : 1 } }
44+ >
45+ < p > { pageDescription } </ p >
46+ </ motion . div >
5147 </ div >
5248 ) ;
5349} ;
0 commit comments