-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: setup font and update button join our discord
- Loading branch information
Showing
13 changed files
with
141 additions
and
69 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,96 @@ | ||
import React, { CSSProperties } from "react"; | ||
|
||
import { twMerge } from "tailwind-merge"; | ||
|
||
export interface ShimmerButtonProps | ||
extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
shimmerColor?: string; | ||
shimmerSize?: string; | ||
borderRadius?: string; | ||
shimmerDuration?: string; | ||
background?: string; | ||
className?: string; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const ShimmerButton = React.forwardRef<HTMLButtonElement, ShimmerButtonProps>( | ||
( | ||
{ | ||
shimmerColor = "#ffffff", | ||
shimmerSize = "0.05em", | ||
shimmerDuration = "3s", | ||
borderRadius = "100px", | ||
background = "rgba(0, 0, 0, 1)", | ||
className, | ||
children, | ||
...props | ||
}, | ||
ref | ||
) => { | ||
return ( | ||
<button | ||
style={ | ||
{ | ||
"--spread": "90deg", | ||
"--shimmer-color": shimmerColor, | ||
"--radius": borderRadius, | ||
"--speed": shimmerDuration, | ||
"--cut": shimmerSize, | ||
"--bg": background, | ||
} as CSSProperties | ||
} | ||
className={twMerge( | ||
"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden whitespace-nowrap border border-white/10 px-6 py-3 text-white [background:var(--bg)] [border-radius:var(--radius)] dark:text-black", | ||
"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-[1px]", | ||
className | ||
)} | ||
ref={ref} | ||
{...props} | ||
> | ||
{/* spark container */} | ||
<div | ||
className={twMerge( | ||
"-z-30 blur-[2px]", | ||
"absolute inset-0 overflow-visible [container-type:size]" | ||
)} | ||
> | ||
{/* spark */} | ||
<div className="absolute inset-0 h-[100cqh] animate-slide [aspect-ratio:1] [border-radius:0] [mask:none]"> | ||
{/* spark before */} | ||
<div className="animate-spin-around absolute inset-[-100%] w-auto rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" /> | ||
</div> | ||
</div> | ||
{children} | ||
|
||
{/* Highlight */} | ||
<div | ||
className={twMerge( | ||
"insert-0 absolute h-full w-full", | ||
|
||
"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]", | ||
|
||
// transition | ||
"transform-gpu transition-all duration-300 ease-in-out", | ||
|
||
// on hover | ||
"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]", | ||
|
||
// on click | ||
"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]" | ||
)} | ||
/> | ||
|
||
{/* backdrop */} | ||
<div | ||
className={twMerge( | ||
"absolute -z-20 [background:var(--bg)] [border-radius:var(--radius)] [inset:var(--cut)]" | ||
)} | ||
/> | ||
</button> | ||
); | ||
} | ||
); | ||
|
||
ShimmerButton.displayName = "ShimmerButton"; | ||
|
||
export default ShimmerButton; |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
p, | ||
li, | ||
span { | ||
@apply text-black/70 dark:text-white/70; | ||
@apply text-black dark:text-white; | ||
} | ||
} | ||
|
||
|
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