Created
July 5, 2023 17:58
-
-
Save merlinstardust/7aabbe8db1ea3a13b22f92ad6c0815ea to your computer and use it in GitHub Desktop.
Rainbow Text using enchanted land font
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import localFont from 'next/font/local'; | |
const enchantedLandFont = localFont({ src: './enchanted-land.ttf' }); | |
const headerStyle = (colors) => ({ | |
display: 'inline', | |
margin: 0, | |
fontSize: 500, | |
fontWeight: 400, | |
background: `-webkit-linear-gradient(left, ${colors.join(', ')})`, | |
'-webkit-background-clip': 'text', | |
'-webkit-text-fill-color': 'transparent', | |
}); | |
const headerStyle1 = headerStyle(['red', 'orange', 'yellow', 'green', 'blue', 'purple']); | |
const headerStyle2 = headerStyle(['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']); | |
export default function CocktailPartyJson() { | |
return ( | |
<> | |
<main className={enchantedLandFont.className}> | |
<div> | |
<h1 style={headerStyle1}> | |
Arcanum | |
</h1> | |
</div> | |
<div> | |
<h1 style={headerStyle2}> | |
Arcanum | |
</h1> | |
</div> | |
</main> | |
</> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment