diff --git a/taskncoffee-app/src/components/buttons.jsx b/taskncoffee-app/src/components/buttons.jsx index debb666..b5f36ff 100644 --- a/taskncoffee-app/src/components/buttons.jsx +++ b/taskncoffee-app/src/components/buttons.jsx @@ -1,58 +1,42 @@ "use client" -import { AnimatePresence, motion } from "motion/react" import { useState } from "react" +import { motion, AnimatePresence } from "motion/react" -export default function ExitAnimation() { - const [isVisible, setIsVisible] = useState(true) +export function useRipple() { + const [ripples, setRipples] = useState([]) - const container = { - display: "flex", - flexDirection: "column", - width: 100, - height: 160, - position: "relative", + const addRipple = (e) => { + const rect = e.currentTarget.getBoundingClientRect() + const x = e.clientX - rect.left + const y = e.clientY - rect.top + const id = Date.now() + + setRipples((prev) => [...prev, { x, y, id }]) + + setTimeout(() => { + setRipples((prev) => prev.filter((r) => r.id !== id)) + }, 600) } - const box = { - width: 100, - height: 100, - backgroundColor: "#0cdcf7", - borderRadius: 10, - } - - const button = { - backgroundColor: "#0cdcf7", - borderRadius: 10, - padding: "10px 20px", - color: "#0f1115", - position: "absolute", - bottom: 0, - left: 0, - right: 0, - } - - return ( -