Skip to content

Instantly share code, notes, and snippets.

@merlinstardust
Created July 5, 2023 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merlinstardust/7aabbe8db1ea3a13b22f92ad6c0815ea to your computer and use it in GitHub Desktop.
Save merlinstardust/7aabbe8db1ea3a13b22f92ad6c0815ea to your computer and use it in GitHub Desktop.
Rainbow Text using enchanted land font
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