Merge version_1 into main #1

Merged
bender merged 2 commits from version_1 into main 2026-03-11 07:39:17 +00:00
2 changed files with 64 additions and 40 deletions

View File

@@ -68,6 +68,7 @@ export default function LandingPage() {
imageSrc="https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3An3bKtQCvkWEWug7gjEDCOtTTo/a-focused-developer-working-intently-at--1773214662679-8ecfd971.png"
imageAlt="Developer working on animated project"
mediaAnimation="blur-reveal"
metricsAnimation="blur-reveal"
useInvertedBackground={false}
/>
</div>

View File

@@ -1,51 +1,74 @@
"use client";
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
import React, { CSSProperties } from 'react';
interface SvgTextLogoProps {
logoText: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
text: string;
className?: string;
animate?: boolean;
animationDuration?: number;
fill?: string;
stroke?: string;
strokeWidth?: number;
fontSize?: number;
fontFamily?: string;
fontWeight?: number | string;
letterSpacing?: number;
textAnchor?: 'start' | 'middle' | 'end';
dominantBaseline?: 'auto' | 'middle' | 'hanging';
}
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 = '',
animate = false,
animationDuration = 3,
fill = 'currentColor',
stroke = 'none',
strokeWidth = 0,
fontSize = 48,
fontFamily = 'inherit',
fontWeight = 700,
letterSpacing = 0,
textAnchor = 'middle',
dominantBaseline = 'middle',
}) => {
const animationStyle: CSSProperties = animate
? {
animation: `float ${animationDuration}s ease-in-out infinite`,
}
: {};
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"
}}
<>
<style>{`
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
`}</style>
<svg
viewBox="0 0 1000 200"
className={className}
style={animationStyle}
aria-label={text}
>
{logoText}
</text>
</svg>
<text
x="500"
y="100"
fill={fill}
stroke={stroke}
strokeWidth={strokeWidth}
fontSize={fontSize}
fontFamily={fontFamily}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
textAnchor={textAnchor}
dominantBaseline={dominantBaseline}
>
{text}
</text>
</svg>
</>
);
});
SvgTextLogo.displayName = "SvgTextLogo";
};
export default SvgTextLogo;