Merge version_1 into main #1
@@ -116,7 +116,7 @@ export default function LandingPage() {
|
||||
imageSrc: "http://img.b2bpic.net/free-photo/side-view-lentil-merci-soup-bowl-hand-with-spoon-bowl_141793-2988.jpg", imageAlt: "Signature Soup"
|
||||
}
|
||||
]}
|
||||
gridVariant="four-items-2x2-equal-grid"
|
||||
gridVariant="uniform-all-items-equal"
|
||||
animationType="slide-up"
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
@@ -178,7 +178,7 @@ export default function LandingPage() {
|
||||
{ id: "3", value: "50+", description: "Menu Items" },
|
||||
{ id: "4", value: "Best", description: "Ambiance Award" }
|
||||
]}
|
||||
gridVariant="four-items-2x2-equal-grid"
|
||||
gridVariant="uniform-all-items-equal"
|
||||
animationType="scale-rotate"
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
"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;
|
||||
textClassName?: string;
|
||||
svgClassName?: string;
|
||||
animationDuration?: number;
|
||||
}
|
||||
|
||||
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 = '',
|
||||
textClassName = '',
|
||||
svgClassName = '',
|
||||
animationDuration = 2,
|
||||
}) => {
|
||||
const textId = `text-path-${Math.random().toString(36).substr(2, 9)}`;
|
||||
|
||||
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"
|
||||
}}
|
||||
<div className={`flex items-center justify-center ${className}`}>
|
||||
<svg
|
||||
viewBox="0 0 800 600"
|
||||
className={`w-full h-full ${svgClassName}`}
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
>
|
||||
{logoText}
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
});
|
||||
<defs>
|
||||
<path
|
||||
id={textId}
|
||||
d="M 100,300 Q 400,100 700,300"
|
||||
fill="none"
|
||||
/>
|
||||
</defs>
|
||||
|
||||
SvgTextLogo.displayName = "SvgTextLogo";
|
||||
<text
|
||||
className={`fill-current font-bold ${textClassName}`}
|
||||
fontSize="48"
|
||||
letterSpacing="2"
|
||||
fill="currentColor"
|
||||
dominantBaseline="middle"
|
||||
>
|
||||
<textPath href={`#${textId}`} startOffset="50%" textAnchor="middle">
|
||||
{text}
|
||||
</textPath>
|
||||
</text>
|
||||
</svg>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SvgTextLogo;
|
||||
|
||||
Reference in New Issue
Block a user