-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c57b6c
commit 1a9b48f
Showing
3 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
interface TitleProps { | ||
title: string; | ||
} | ||
|
||
export const Title = ({title}: TitleProps) => { | ||
const titleLength = title.length; | ||
const svgWidth = titleLength * 85; // Adjust multiplier as needed | ||
const svgHeight = 250; | ||
|
||
return ( | ||
<div style={{position: "relative", maxWidth: "1200px", margin: "0 auto", width: "100%"}}> | ||
<svg | ||
width={"100%"} viewBox={`0 0 ${svgWidth} ${svgHeight}`} fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<defs> | ||
<clipPath id="textClip"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" | ||
style={{transform: "translate(20%, 0%)"}} | ||
d="M229.346 4.55498C355.281 29.5933 425.293 147.645 370.785 206.007C323.101 257.063 262.072 194.01 193.395 180.478C122.857 166.579 33.3513 204.321 4.50831 140.756C-24.3347 77.191 103.412 -20.4833 229.346 4.55498Z" | ||
fill="#CF9D13"/> | ||
</clipPath> | ||
</defs> | ||
<rect width="100%" height="100%" fill="#CF9D13" clip-path="url(#textClip)" /> | ||
<text x="50%" y="80%" dominant-baseline="middle" text-anchor="middle" font-size="9rem" font-weight="800" fill="#2A3751"> | ||
{title} | ||
</text> | ||
<text style={{userSelect: 'none'}} x="50%" y="80%" dominant-baseline="middle" text-anchor="middle" font-size="9rem" font-weight="800" fill="#ffff26" clip-path="url(#textClip)"> | ||
{title} | ||
</text> | ||
</svg> | ||
|
||
<h1 style={{ | ||
visibility: "hidden", | ||
}}>{title}</h1> | ||
</div> | ||
); | ||
} |