Skip to content

Commit

Permalink
feat: Buttonにホバーアニメーションを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
shun-shobon committed Oct 21, 2024
1 parent da116ed commit 7274ba2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
) => {
const Comp = asChild ? Slot : "button";
return (
<Comp className={cn("relative px-5 py-2")} ref={ref} {...props}>
<Comp className={cn("group relative px-5 py-2")} ref={ref} {...props}>
<div className="absolute inset-0 drop-shadow-md">
{background && (
<svg
className={cn(
"-skew-x-12 absolute inset-0 h-full w-full skew-y-6",
"-skew-x-12 absolute inset-0 h-full w-full rotate-6 transition-transform duration-300 group-hover:rotate-1",
)}
role="presentation"
>
Expand All @@ -37,7 +37,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
)}
<svg
className={cn(
"-skew-y-3 absolute inset-0 h-full w-full skew-x-12 border-2 border-white",
"-rotate-3 group-hover:-rotate-1 absolute inset-0 h-full w-full skew-x-12 border-2 border-white transition-transform duration-300",
)}
role="presentation"
>
Expand Down

0 comments on commit 7274ba2

Please sign in to comment.