diff --git a/src/app/page.tsx b/src/app/page.tsx index 3ff307c..22bdabb 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -85,7 +85,7 @@ export default function LandingPage() { animationType="slide-up" textboxLayout="default" useInvertedBackground={false} - buttonAnimation="fade" + buttonAnimation="slide-up" /> diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..428675e 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,63 @@ -"use client"; - -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; +import React, { useMemo } from 'react'; interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; + text: string; className?: string; + textClassName?: string; + fontSize?: number; + fontWeight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold'; + dominantBaseline?: 'auto' | 'baseline' | 'hanging' | 'middle' | 'central'; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const fontWeightMap: Record = { + light: 300, + normal: 400, + medium: 500, + semibold: 600, + bold: 700, + extrabold: 800, +}; + +export const SvgTextLogo: React.FC = ({ + text, + className = '', + textClassName = '', + fontSize = 48, + fontWeight = 'bold', + dominantBaseline = 'middle', +}) => { + const textRef = React.useRef(null); + const [viewBoxWidth, setViewBoxWidth] = React.useState(300); + + const numericFontWeight = fontWeightMap[fontWeight] || 700; + + React.useEffect(() => { + if (textRef.current) { + const bbox = textRef.current.getBBox(); + setViewBoxWidth(Math.max(bbox.width + 20, 300)); + } + }, [text]); return ( - {logoText} + {text} ); -}); - -SvgTextLogo.displayName = "SvgTextLogo"; +}; export default SvgTextLogo;