Merge version_1 into main #1

Merged
bender merged 2 commits from version_1 into main 2026-03-12 17:24:27 +00:00
2 changed files with 65 additions and 43 deletions

View File

@@ -15,7 +15,7 @@ export default function LandingPage() {
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="reveal-blur"
defaultTextAnimation="entrance-slide"
borderRadius="rounded"
contentWidth="mediumLarge"
sizing="mediumLargeSizeLargeTitles"
@@ -194,7 +194,7 @@ export default function LandingPage() {
cardTitle="Trusted by over 500 satisfied homeowners and businesses across the region"
cardTag="Client Testimonials"
cardTagIcon={Star}
cardAnimation="reveal-blur"
cardAnimation="blur-reveal"
useInvertedBackground={false}
/>
</div>

View File

@@ -1,51 +1,73 @@
"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;
fontSize?: number;
fontFamily?: string;
fontWeight?: string | number;
letterSpacing?: number;
fill?: string;
dominantBaseline?: 'auto' | 'text-bottom' | 'alphabetic' | 'ideographic' | 'middle' | 'central' | 'mathematical' | 'hanging';
}
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
logoText,
adjustHeightFactor,
verticalAlign = "top",
className = "",
}) {
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
const SvgTextLogo = React.forwardRef<SVGSVGElement, SvgTextLogoProps>(
(
{
text,
className = '',
fontSize = 48,
fontFamily = 'system-ui, -apple-system, sans-serif',
fontWeight = 'bold',
letterSpacing = 0,
fill = 'currentColor',
dominantBaseline = 'middle',
},
ref,
) => {
const svgRef = React.useRef<SVGSVGElement>(null);
const [dimensions, setDimensions] = React.useState({ width: 400, height: 100 });
return (
<svg
ref={svgRef}
viewBox={viewBox}
className={cls("w-full", className)}
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img"
aria-label={`${logoText} logo`}
>
<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"
}}
React.useEffect(() => {
if (svgRef.current) {
const textElement = svgRef.current.querySelector('text');
if (textElement) {
const bbox = textElement.getBBox();
setDimensions({
width: Math.ceil(bbox.width + 20),
height: Math.ceil(bbox.height + 20),
});
}
}
}, [text, fontSize, fontFamily, fontWeight]);
React.useImperativeHandle(ref, () => svgRef.current!);
return (
<svg
ref={svgRef}
viewBox={`0 0 ${dimensions.width} ${dimensions.height}`}
className={className}
xmlns="http://www.w3.org/2000/svg"
>
{logoText}
</text>
</svg>
);
});
<text
x={dimensions.width / 2}
y={dimensions.height / 2}
textAnchor="middle"
dominantBaseline="central"
fontSize={fontSize}
fontFamily={fontFamily}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill={fill}
>
{text}
</text>
</svg>
);
},
);
SvgTextLogo.displayName = "SvgTextLogo";
SvgTextLogo.displayName = 'SvgTextLogo';
export default SvgTextLogo;