From 5e282ab18dea6719f51e16c794c237cb476ee80d Mon Sep 17 00:00:00 2001 From: geun <1416geun@naver.com> Date: Thu, 21 May 2026 09:37:52 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B9=EC=85=98=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SubHero.jsx | 111 ++++++------- src/css/common.css | 114 +------------ src/pages/company/AboutPage.jsx | 282 -------------------------------- 3 files changed, 54 insertions(+), 453 deletions(-) diff --git a/src/components/SubHero.jsx b/src/components/SubHero.jsx index ade06bf..ea271fe 100644 --- a/src/components/SubHero.jsx +++ b/src/components/SubHero.jsx @@ -105,8 +105,7 @@ function NetworkGlobe() { const d = Math.sqrt(dx * dx + dy * dy + dz * dz); if (d < 0.55) { const depth = (a.sz + b.sz) * 0.5; - const alpha = - Math.max(0, 0.05 + (depth + 1) * 0.1) * (1 - d / 0.55); + const alpha = Math.max(0, 0.05 + (depth + 1) * 0.1) * (1 - d / 0.55); const aHex = Math.round(Math.min(255, alpha * 255)) .toString(16) .padStart(2, "0"); @@ -135,14 +134,7 @@ function NetworkGlobe() { .toString(16) .padStart(2, "0"); - const glow = ctx.createRadialGradient( - n.sx, - n.sy, - 0, - n.sx, - n.sy, - r * 3.5, - ); + const glow = ctx.createRadialGradient(n.sx, n.sy, 0, n.sx, n.sy, r * 3.5); glow.addColorStop(0, n.color + gHex); glow.addColorStop(1, n.color + "00"); ctx.beginPath(); @@ -176,9 +168,19 @@ function NetworkGlobe() { return ; } +// 라인 단위 마스크 슬라이드업 +function TitleLine({ children, delay }) { + return ( + + + {children} + + + ); +} + export default function SubHero({ title, desc, navItems, rightSlot }) { const { pathname } = useLocation(); - const titleLines = typeof title === "string" ? title.split("\n") : null; const [isPill, setIsPill] = useState(false); const navRef = useRef(null); @@ -190,50 +192,54 @@ export default function SubHero({ title, desc, navItems, rightSlot }) { return () => window.removeEventListener("scroll", onScroll); }, []); + // string이면 \n 기준으로 라인 분리, JSX면 React.Children으로 라인 처리 + const titleContent = + typeof title === "string" + ? title.split("\n").map((line, i) => ( + + {line} + + )) + : // JSX:
로 나뉜 형태 → 직접 TitleLine 배열로 변환 + (() => { + const children = Array.isArray(title.props?.children) ? title.props.children : [title]; + const lines = []; + let current = []; + children.forEach((child, i) => { + if (child?.type === "br") { + lines.push(current); + current = []; + } else { + current.push(child); + } + if (i === children.length - 1 && current.length) { + lines.push(current); + } + }); + return lines.map((lineChildren, i) => ( + + {lineChildren} + + )); + })(); + return ( <>
- + {menuMap["/" + pathname.split("/")[1]]?.label} -

- {typeof title === "string" - ? titleLines.map((line, li) => ( - - {line.split("").map((char, ci) => ( - - {char === " " ? "\u00A0" : char} - - ))} - - )) - : title} -

+

{titleContent}

{desc && ( @@ -243,12 +249,7 @@ export default function SubHero({ title, desc, navItems, rightSlot }) {
{rightSlot && ( - + {rightSlot} )} @@ -256,18 +257,10 @@ export default function SubHero({ title, desc, navItems, rightSlot }) {
{navItems?.length > 1 && ( -