Viel Spaß, Ramez
This commit is contained in:
32
components/GradientText.tsx
Normal file
32
components/GradientText.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import './GradientText.css';
|
||||
import React, { ReactNode } from 'react';
|
||||
|
||||
interface GradientTextProps {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
colors?: string[];
|
||||
animationSpeed?: number;
|
||||
showBorder?: boolean;
|
||||
}
|
||||
|
||||
export default function GradientText({
|
||||
children,
|
||||
className = '',
|
||||
colors = ['#40ffaa', '#4079ff', '#40ffaa', '#4079ff', '#40ffaa'],
|
||||
animationSpeed = 8,
|
||||
showBorder = false
|
||||
}: GradientTextProps) {
|
||||
const gradientStyle = {
|
||||
backgroundImage: `linear-gradient(to right, ${colors.join(', ')})`,
|
||||
animationDuration: `${animationSpeed}s`
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`animated-gradient-text ${className}`}>
|
||||
{showBorder && <div className="gradient-overlay" style={gradientStyle}></div>}
|
||||
<div className="text-content" style={gradientStyle}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user