Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx
This commit is contained in:
@@ -8,36 +8,34 @@ interface SvgTextLogoProps {
|
||||
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({ text, className = '' }) => {
|
||||
const textLength = text.length;
|
||||
const charWidth = 60;
|
||||
const width = Math.max(300, textLength * charWidth);
|
||||
const width = textLength * charWidth + 40;
|
||||
const height = 120;
|
||||
const fontSize = 80;
|
||||
const x = width / 2;
|
||||
const y = height / 2;
|
||||
|
||||
return (
|
||||
<svg
|
||||
viewBox={`0 0 ${width} ${height}`}
|
||||
width={width}
|
||||
height={height}
|
||||
viewBox={`0 0 ${width} ${height}`}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className={className}
|
||||
aria-label={text}
|
||||
>
|
||||
<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 }} />
|
||||
<stop offset="0%" stopColor="#ff6b6b" />
|
||||
<stop offset="50%" stopColor="#4ecdc4" />
|
||||
<stop offset="100%" stopColor="#45b7d1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<text
|
||||
x={x}
|
||||
y={y}
|
||||
x={width / 2}
|
||||
y={height / 2}
|
||||
textAnchor="middle"
|
||||
dominantBaseline="middle"
|
||||
fontSize={fontSize}
|
||||
fontSize="48"
|
||||
fontWeight="bold"
|
||||
fill="url(#textGradient)"
|
||||
fontFamily="system-ui, -apple-system, sans-serif"
|
||||
fontFamily="Arial, sans-serif"
|
||||
>
|
||||
{text}
|
||||
</text>
|
||||
@@ -45,4 +43,4 @@ const SvgTextLogo: React.FC<SvgTextLogoProps> = ({ text, className = '' }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default SvgTextLogo;
|
||||
export default SvgTextLogo;
|
||||
Reference in New Issue
Block a user