2 Commits

Author SHA1 Message Date
f4993e0493 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-12 06:05:05 +00:00
6d46dd6307 Update src/app/page.tsx 2026-03-12 06:05:04 +00:00
2 changed files with 33 additions and 38 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,46 @@
"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 = textLength * charWidth + 40;
className = "", const height = 120;
}) {
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
return ( return (
<svg <svg
ref={svgRef} width={width}
viewBox={viewBox} height={height}
className={cls("w-full", className)} viewBox={`0 0 ${width} ${height}`}
style={{ aspectRatio: aspectRatio }} xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="none" className={className}
role="img"
aria-label={`${logoText} logo`}
> >
<defs>
<linearGradient id="textGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#ff6b6b" />
<stop offset="50%" stopColor="#4ecdc4" />
<stop offset="100%" stopColor="#45b7d1" />
</linearGradient>
</defs>
<text <text
ref={textRef} x={width / 2}
x="0" y={height / 2}
y={verticalAlign === "center" ? "50%" : "0"} textAnchor="middle"
className="font-bold fill-current" dominantBaseline="middle"
style={{ fontSize="48"
fontSize: "20px", fontWeight="bold"
letterSpacing: "-0.02em", fill="url(#textGradient)"
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge" fontFamily="Arial, sans-serif"
}}
> >
{logoText} {text}
</text> </text>
</svg> </svg>
); );
}); };
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo; export default SvgTextLogo;