46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
|
|
interface SvgTextLogoProps {
|
|
text: string;
|
|
className?: string;
|
|
}
|
|
|
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({ text, className = '' }) => {
|
|
const textLength = text.length;
|
|
const charWidth = 60;
|
|
const width = textLength * charWidth + 40;
|
|
const height = 120;
|
|
|
|
return (
|
|
<svg
|
|
width={width}
|
|
height={height}
|
|
viewBox={`0 0 ${width} ${height}`}
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
className={className}
|
|
>
|
|
<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
|
|
x={width / 2}
|
|
y={height / 2}
|
|
textAnchor="middle"
|
|
dominantBaseline="middle"
|
|
fontSize="48"
|
|
fontWeight="bold"
|
|
fill="url(#textGradient)"
|
|
fontFamily="Arial, sans-serif"
|
|
>
|
|
{text}
|
|
</text>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo; |