28 lines
692 B
TypeScript
Raw Normal View History

2023-07-15 08:08:36 +00:00
import React from "react"
import { Text } from "@chakra-ui/react"
2023-07-15 08:08:36 +00:00
export const RainbowText = (props) => {
return (
<Text
2023-07-15 08:08:36 +00:00
as="h1"
sx={{
2023-07-15 08:08:36 +00:00
"@keyframes moving-rainbow": {
"0%": { backgroundPosition: "0 0" },
"100%": { backgroundPosition: "200% 0" },
},
2023-07-15 08:08:36 +00:00
animation: "moving-rainbow 5s infinite linear",
}}
2023-07-15 08:08:36 +00:00
position="relative"
color="transparent"
fontSize="6xl"
fontWeight="bold"
backgroundSize="200%"
bgGradient="linear-gradient(to right, #f34a4a, #ffbc48, #58ca70, #47b5e6, #a555e8, #f34a4a)"
backgroundClip="text"
userSelect="none"
>
{props?.children}
</Text>
)
}