Compare commits

...

2 Commits

Author SHA1 Message Date
kudinDmitriyUp
c478660d98 feat: Add 3D effect to buttons 2026-05-07 18:46:42 +00:00
14eaacf469 Merge version_11_1778179203177 into main
Merge version_11_1778179203177 into main
2026-05-07 18:42:05 +00:00

View File

@@ -1,6 +1,5 @@
"use client"; "use client";
import { motion } from "motion/react";
import { useButtonClick } from "@/hooks/useButtonClick"; import { useButtonClick } from "@/hooks/useButtonClick";
import { cls } from "@/lib/utils"; import { cls } from "@/lib/utils";
import { useStyle } from "@/components/ui/useStyle"; import { useStyle } from "@/components/ui/useStyle";
@@ -23,31 +22,18 @@ interface ButtonProps {
className?: string; className?: string;
} }
const DefaultButton = ({ text, variant = "primary", href = "#", onClick, animate = true, animationDelay = 0, className = "" }: ButtonProps) => { const DefaultButton = ({ text, variant = "primary", href = "#", onClick, className = "" }: ButtonProps) => {
const handleClick = useButtonClick(href, onClick); const handleClick = useButtonClick(href, onClick);
const button = ( return (
<a <a
href={href} href={href}
onClick={handleClick} onClick={handleClick}
className={cls("flex items-center justify-center h-9 px-6 text-sm rounded cursor-pointer", variant === "primary" ? "primary-button text-primary-cta-text" : "secondary-button text-secondary-cta-text", className)} className={cls("flex items-center justify-center h-9 px-6 text-sm rounded cursor-pointer transform transition-transform duration-200 hover:scale-105 active:scale-95", variant === "primary" ? "primary-button text-primary-cta-text shadow-[0_4px_0_0_rgba(0,0,0,0.2)] hover:shadow-[0_6px_0_0_rgba(0,0,0,0.2)] active:shadow-[0_2px_0_0_rgba(0,0,0,0.2)]" : "secondary-button text-secondary-cta-text shadow-[0_4px_0_0_rgba(0,0,0,0.2)] hover:shadow-[0_6px_0_0_rgba(0,0,0,0.2)] active:shadow-[0_2px_0_0_rgba(0,0,0,0.2)]", className)}
> >
{text} {text}
</a> </a>
); );
if (!animate) return button;
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.6, delay: animationDelay, ease: "easeOut" }}
>
{button}
</motion.div>
);
}; };
const Button = (props: ButtonProps) => { const Button = (props: ButtonProps) => {