30 lines
696 B
JavaScript
30 lines
696 B
JavaScript
const ShinyText = ({ text, disabled = false, speed = 5, className = '' }) => {
|
|
const animationDuration = `${speed}s`;
|
|
|
|
return (
|
|
<div className={`shiny-text ${disabled ? 'disabled' : ''} ${className}`} style={{ animationDuration }}>
|
|
{text}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ShinyText;
|
|
|
|
// tailwind.config.js
|
|
// module.exports = {
|
|
// theme: {
|
|
// extend: {
|
|
// keyframes: {
|
|
// shine: {
|
|
// '0%': { 'background-position': '100%' },
|
|
// '100%': { 'background-position': '-100%' },
|
|
// },
|
|
// },
|
|
// animation: {
|
|
// shine: 'shine 5s linear infinite',
|
|
// },
|
|
// },
|
|
// },
|
|
// plugins: [],
|
|
// };
|