2 Commits

Author SHA1 Message Date
89c32f3b4a Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-12 06:04:01 +00:00
b1d145fe0b Update src/app/page.tsx 2026-03-12 06:04:00 +00:00
2 changed files with 34 additions and 37 deletions

View File

@@ -20,7 +20,7 @@ export default function LandingPage() {
borderRadius="rounded" borderRadius="rounded"
contentWidth="small" contentWidth="small"
sizing="largeSmallSizeLargeTitles" sizing="largeSmallSizeLargeTitles"
background="aurora" background="circleGradient"
cardStyle="gradient-bordered" cardStyle="gradient-bordered"
primaryButtonStyle="double-inset" primaryButtonStyle="double-inset"
secondaryButtonStyle="solid" secondaryButtonStyle="solid"
@@ -48,7 +48,7 @@ export default function LandingPage() {
{ text: "Explore Collection", href: "product" }, { text: "Explore Collection", href: "product" },
{ text: "Learn Our Story", href: "about" } { text: "Learn Our Story", href: "about" }
]} ]}
background={{ variant: "aurora" }} background={{ variant: "sparkles-gradient" }}
imageSrc="http://img.b2bpic.net/free-photo/top-view-gua-sha-face-products_23-2149401501.jpg" imageSrc="http://img.b2bpic.net/free-photo/top-view-gua-sha-face-products_23-2149401501.jpg"
imageAlt="Pure Glow luxury skincare products" imageAlt="Pure Glow luxury skincare products"
frameStyle="card" frameStyle="card"

View File

@@ -1,51 +1,48 @@
"use client"; import React from 'react';
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
interface SvgTextLogoProps { interface SvgTextLogoProps {
logoText: string; text: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
className?: string; className?: string;
} }
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({ const SvgTextLogo: React.FC<SvgTextLogoProps> = ({ text, className = '' }) => {
logoText, const textLength = text.length;
adjustHeightFactor, const charWidth = 60;
verticalAlign = "top", const width = Math.max(300, textLength * charWidth);
className = "", const height = 120;
}) { const fontSize = 80;
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); const x = width / 2;
const y = height / 2;
return ( return (
<svg <svg
ref={svgRef} viewBox={`0 0 ${width} ${height}`}
viewBox={viewBox} width={width}
className={cls("w-full", className)} height={height}
style={{ aspectRatio: aspectRatio }} xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="none" className={className}
role="img" aria-label={text}
aria-label={`${logoText} logo`}
> >
<defs>
<linearGradient id="textGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style={{ stopColor: 'rgb(59, 130, 246)', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'rgb(139, 92, 246)', stopOpacity: 1 }} />
</linearGradient>
</defs>
<text <text
ref={textRef} x={x}
x="0" y={y}
y={verticalAlign === "center" ? "50%" : "0"} textAnchor="middle"
className="font-bold fill-current" dominantBaseline="middle"
style={{ fontSize={fontSize}
fontSize: "20px", fontWeight="bold"
letterSpacing: "-0.02em", fill="url(#textGradient)"
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge" fontFamily="system-ui, -apple-system, sans-serif"
}}
> >
{logoText} {text}
</text> </text>
</svg> </svg>
); );
}); };
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo; export default SvgTextLogo;