3 Commits

Author SHA1 Message Date
62c0edf9af Update src/app/page.tsx 2026-03-12 19:51:44 +00:00
fa408bcde9 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-12 19:51:19 +00:00
89e014a9c3 Update src/app/page.tsx 2026-03-12 19:51:19 +00:00
2 changed files with 29 additions and 40 deletions

View File

@@ -77,7 +77,7 @@ export default function LandingPage() {
{ text: "Our Story", href: "#" },
{ text: "Meet Our Team", href: "#" }
]}
buttonAnimation="entrance-slide"
buttonAnimation="slide-up"
/>
</div>

View File

@@ -1,51 +1,40 @@
"use client";
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
import React from 'react';
interface SvgTextLogoProps {
logoText: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
text: string;
className?: string;
containerClassName?: string;
textClassName?: string;
}
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
logoText,
adjustHeightFactor,
verticalAlign = "top",
className = "",
}) {
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
containerClassName = 'w-full h-full',
textClassName = '',
}) => {
const characters = text.split('');
return (
<svg
ref={svgRef}
viewBox={viewBox}
className={cls("w-full", className)}
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img"
aria-label={`${logoText} logo`}
viewBox={`0 0 ${text.length * 100} 120`}
className={containerClassName}
preserveAspectRatio="xMidYMid meet"
>
<text
ref={textRef}
x="0"
y={verticalAlign === "center" ? "50%" : "0"}
className="font-bold fill-current"
style={{
fontSize: "20px",
letterSpacing: "-0.02em",
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge"
}}
>
{logoText}
</text>
{characters.map((char, index) => (
<text
key={index}
x={index * 100 + 50}
y={90}
textAnchor="middle"
className={`text-4xl font-bold fill-current ${textClassName}`}
dominantBaseline="middle"
>
{char}
</text>
))}
</svg>
);
});
};
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo;
export default SvgTextLogo;