diff --git a/src/app/page.tsx b/src/app/page.tsx index 76bc76d..8ef3119 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -72,6 +72,7 @@ export default function LandingPage() { imageAlt="Coffee roasting process and café ambiance" useInvertedBackground={false} mediaAnimation="slide-up" + metricsAnimation="slide-up" /> diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..2725ddb 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,54 @@ -"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; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo: React.FC = ({ + text, + className = '', + textClassName = '', +}) => { + const textLength = useMemo(() => { + if (typeof document === 'undefined') return text.length * 10; + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + if (!ctx) return text.length * 10; + ctx.font = '48px Arial'; + return ctx.measureText(text).width; + }, [text]); + + const pathLength = useMemo(() => Math.ceil(textLength + 40), [textLength]); return ( + + + - {logoText} + + {text} + ); -}); - -SvgTextLogo.displayName = "SvgTextLogo"; +}; export default SvgTextLogo;