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 (

@@ -10,19 +39,72 @@ export function Welcome() { Mind that gambling isn't that dangerous

-
-
-

PRICE-

+
+
+
+ + {Array.from({ length: 150 }).map((_, index) => ( +
+ {(() => { + const chance = Math.random(); + let colorClass = "text-blue-500"; + if (chance < 0.7) { + colorClass = "text-blue-500"; + } else if (chance < 0.9) { + colorClass = "text-yellow-500"; + } else { + colorClass = "text-red-500"; + } + return {index + 1}; + })()} +
+ ))} +
+
+ +

ROLL

+
+
+ Cost per roll : + 6 + $ +
-
-

ROLL

-
- -
-

CHANCE+

-
-

Cost per roll :

+ {showResetPopup && ( +
+
+

Dragon Lore

+

Would you like to reset?

+ +
+
+ )}
);