%PDF- %PDF-
| Direktori : /home2/rezakur1/www/portfolio/portfolio-rezakurnia/src/components/shared/ |
| Current File : /home2/rezakur1/www/portfolio/portfolio-rezakurnia/src/components/shared/BtnLink.astro |
---
export interface Props{
href:string,
text:string,
i18nKey?: string,
className?:string,
variant:"primary"|"secondary"
}
const {href, text, i18nKey, className, variant} = Astro.props
const getThemeStyle = (variant:"primary"|"secondary")=>{
if (variant === "primary") {
return "bg-primary border-transparent relative after:bg-[#172554] hover:border-[#172554]"
}
return "text-primary"
}
const getTextColor = (variant:"primary"|"secondary") =>{
if (variant === "primary") {
return "text-white"
}
return "text-primary"
}
---
<a href={href} class={`px-4 py-2 text-sm rounded-full outline-none relative overflow-hidden border duration-300 ease-linear
after:absolute after:inset-x-0 after:aspect-square after:scale-0 after:opacity-70 after:origin-center after:duration-300 after:ease-linear after:rounded-full after:top-0 after:left-0 after:bg-[#172554]
${getThemeStyle(variant)} hover:after:opacity-100 hover:after:scale-[2.5] ${className}`}>
<span class={`relative ${getTextColor(variant)} z-10`}>
{i18nKey ? <span data-i18n={i18nKey}>{text}</span> : text}
</span>
</a>