49 lines
962 B
TypeScript
49 lines
962 B
TypeScript
import React from 'react';
|
|
|
|
interface SvgTextLogoProps {
|
|
text: string;
|
|
className?: string;
|
|
textClassName?: string;
|
|
animationDuration?: number;
|
|
}
|
|
|
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|
text,
|
|
className = '',
|
|
textClassName = '',
|
|
animationDuration = 2,
|
|
}) => {
|
|
return (
|
|
<svg
|
|
viewBox={`0 0 ${text.length * 60} 100`}
|
|
className={`${className}`}
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<text
|
|
x="50%"
|
|
y="50%"
|
|
dominantBaseline="middle"
|
|
textAnchor="middle"
|
|
className={`text-2xl font-bold fill-current ${textClassName}`}
|
|
style={{
|
|
animation: `fadeIn ${animationDuration}s ease-in-out`,
|
|
}}
|
|
>
|
|
{text}
|
|
</text>
|
|
<style>{`
|
|
@keyframes fadeIn {
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
`}</style>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo;
|