Skip to content

Commit fb95f5f

Browse files
fix: word breaking in about
1 parent 681e95f commit fb95f5f

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

src/components/AboutUs/index.jsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/pages/About/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useEffect, useState, useRef } from "react";
2-
import Heading from "@/components/Heading/index";
32
import { gsap } from "gsap";
43
import { ScrollTrigger } from "gsap/ScrollTrigger";
54
import Oval from "@/assets/images/About/oval.svg";
65
import PageTransition from "../../components/PageTransition";
6+
import Heading from "@/components/Heading/index";
77
import "./About.css";
88

99
gsap.registerPlugin(ScrollTrigger);

src/pages/Teams/TeamMember.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const images = {
2222
};
2323

2424
function TeamMember({ member }) {
25-
const { name, position, description, linkedin, instagram, github, id } = member;
25+
const { name, position, description, linkedin, instagram, github, id } =
26+
member;
2627
const image = images[id];
2728

2829
return (

0 commit comments

Comments
 (0)