diff --git a/app/index.tsx b/app/index.tsx index 9469682..55210fa 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,6 +1,35 @@ +import { useState } from "react"; import "./app.css"; +import { motion } from "motion/react"; export function Welcome() { + const [rolling, setRolling] = useState(false); + const [showResetPopup, setShowResetPopup] = useState(false); + + const handleRollClick = () => { + if (!rolling) { + setRolling(true); + } + }; + + const handleAnimationComplete = () => { + setShowResetPopup(true); + }; + + const handleReset = () => { + setRolling(false); + setShowResetPopup(false); + }; + + const rollButtonVariants = { + initial: { scale: 1, rotateY: 0 }, + clicked: { + scale: [1, 1.1, 1], + rotateY: [0, 20, 0], + transition: { duration: 0.5, ease: "easeInOut" }, + }, + }; + return (
Would you like to reset?
+ +