@@ -89,28 +89,25 @@ export default function AboutSection() {
8989 useEffect ( ( ) => {
9090 const paragraph = paragraphRef . current ;
9191
92- const originalSpan = paragraph . querySelector ( ".text-primary" ) ;
93- const highlightedText = originalSpan . textContent ;
94-
9592 // Split all text nodes while preserving the special span
9693 const splitText = ( node ) => {
9794 if ( node . nodeType === 3 ) {
9895 // Text node
99- const letters = node . textContent . split ( "" ) ;
100- const fragments = letters . map ( ( letter ) => {
96+ const words = node . textContent . split ( " " ) ;
97+ const fragments = words . map ( ( word ) => {
10198 const span = document . createElement ( "span" ) ;
10299 span . className = "inline-block letter-span" ;
103- span . innerHTML = letter === " " ? " " : letter ;
100+ span . innerHTML = ` ${ word } ` ;
104101 return span ;
105102 } ) ;
106103 node . replaceWith ( ...fragments ) ;
107104 } else if ( node . classList ?. contains ( "text-primary" ) ) {
108105 // For highlighted text, split but add special class
109- const letters = node . textContent . split ( "" ) ;
110- const fragments = letters . map ( ( letter ) => {
106+ const words = node . textContent . split ( " " ) ;
107+ const fragments = words . map ( ( word ) => {
111108 const span = document . createElement ( "span" ) ;
112109 span . className = "inline-block letter-span highlighted" ;
113- span . innerHTML = letter === " " ? " " : letter ;
110+ span . innerHTML = ` ${ word } } ` ;
114111 return span ;
115112 } ) ;
116113 node . replaceWith ( ...fragments ) ;
@@ -137,7 +134,7 @@ export default function AboutSection() {
137134 // Animate regular text
138135 tl . fromTo (
139136 paragraph . querySelectorAll ( ".letter-span:not(.highlighted)" ) ,
140- { color : "#595959 " } ,
137+ { color : "transparent " } ,
141138 {
142139 color : "#B7AB98" ,
143140 stagger : 0.02 ,
@@ -148,7 +145,7 @@ export default function AboutSection() {
148145 // Animate highlighted text
149146 tl . fromTo (
150147 paragraph . querySelectorAll ( ".highlighted" ) ,
151- { color : "#595959 " } ,
148+ { color : "transparent " } ,
152149 {
153150 color : "#E76941" ,
154151 stagger : 0.02 ,
@@ -177,10 +174,10 @@ export default function AboutSection() {
177174 ref = { paragraphRef }
178175 className = "text-xl md:text-4xl md:leading-snug font-poppins font-semibold"
179176 >
180- Codex is the coding club at{ " " }
177+ Codex is the coding club at
181178 < span className = "text-primary" >
182179 Symbiosis Institute of Technology
183- </ span > { " " }
180+ </ span >
184181 that brings together students passionate about technology and
185182 programming. Our club is committed to creating an engaging
186183 environment where members can learn, collaborate, and grow their
0 commit comments