Merge version_1 into main #1

Merged
bender merged 2 commits from version_1 into main 2026-03-12 15:14:30 +00:00
2 changed files with 50 additions and 35 deletions

View File

@@ -19,7 +19,7 @@ export default function LandingPage() {
borderRadius="rounded"
contentWidth="mediumLarge"
sizing="medium"
background="aurora"
background="circleGradient"
cardStyle="soft-shadow"
primaryButtonStyle="radial-glow"
secondaryButtonStyle="solid"
@@ -44,7 +44,7 @@ export default function LandingPage() {
<HeroCentered
title="Custom Gaming PCs Built by Experts in Lisbon"
description="High-performance gaming, workstation, and upgrade solutions tailored to your needs. Expert advice, transparent pricing, fast delivery."
background={{ variant: "aurora" }}
background={{ variant: "rotated-rays-static" }}
avatars={[
{ src: "http://img.b2bpic.net/free-photo/man-portrait_1296-491.jpg", alt: "Expert PC builder" },
{ src: "http://img.b2bpic.net/free-photo/black-businessman-happy-expression_1194-2533.jpg", alt: "Workstation specialist" },

View File

@@ -1,51 +1,66 @@
"use client";
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
import React, { useEffect, useRef } from 'react';
interface SvgTextLogoProps {
logoText: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
text: string;
fontSize?: number;
fontFamily?: string;
fontWeight?: string | number;
fill?: string;
strokeWidth?: number;
stroke?: string;
className?: 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,
fontSize = 48,
fontFamily = 'Arial, sans-serif',
fontWeight = 'bold',
fill = 'currentColor',
strokeWidth = 0,
stroke = 'none',
className = '',
}) => {
const svgRef = useRef<SVGSVGElement>(null);
const textRef = useRef<SVGTextElement>(null);
useEffect(() => {
if (textRef.current && svgRef.current) {
const bbox = textRef.current.getBBox();
const padding = 16;
svgRef.current.setAttribute('width', String(bbox.width + padding * 2));
svgRef.current.setAttribute('height', String(bbox.height + padding * 2));
svgRef.current.setAttribute(
'viewBox',
`${bbox.x - padding} ${bbox.y - padding} ${bbox.width + padding * 2} ${bbox.height + padding * 2}`
);
}
}, [text]);
return (
<svg
ref={svgRef}
viewBox={viewBox}
className={cls("w-full", className)}
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img"
aria-label={`${logoText} logo`}
className={className}
xmlns="http://www.w3.org/2000/svg"
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"
}}
y="0"
fontSize={fontSize}
fontFamily={fontFamily}
fontWeight={fontWeight}
fill={fill}
stroke={stroke}
strokeWidth={strokeWidth}
dominantBaseline="hanging"
>
{logoText}
{text}
</text>
</svg>
);
});
};
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo;
export default SvgTextLogo;