diff --git a/src/components/pages/game/game.tsx b/src/components/pages/game/game.tsx index 91bab39..dc87d58 100644 --- a/src/components/pages/game/game.tsx +++ b/src/components/pages/game/game.tsx @@ -29,6 +29,11 @@ const ORACLE_NEEDS_TIME = 'images/tarot-game/oracle-needs-time.png'; const THANKS_ORACLE = 'images/tarot-game/thanks-oracle.png'; const LOADING_IMAGES = [SHUFFLE_DECK, ORACLE_NEEDS_TIME] as const; +const CARD_ANIMATIONS = [ + 'firstCardAppearance 1s linear forwards', + 'secondCardAppearance 2s linear forwards', + 'thirdCardAppearance 3s linear forwards', +] as const; type TarotRequestSchemaType = z.infer; @@ -75,7 +80,13 @@ export const GameSection = () => { useEffect(() => { if (predictionAnswer) { - setValue('question', predictionAnswer.answer); + const timer = setTimeout(() => { + setValue('question', predictionAnswer.answer); + }, 3200); + + return () => { + clearTimeout(timer); + }; } }, [isSuccess, predictionAnswer, setValue, watch]); @@ -117,17 +128,18 @@ export const GameSection = () => { return (
-
Your Future In One Bet
+
Your Future In One Forecast
{predictionAnswer && currentMainImage === DEFAULT_IMAGE && (
- {predictionAnswer.tarots.map((e) => { + {predictionAnswer.tarots.map((e, idx) => { return ( card @@ -160,7 +172,7 @@ export const GameSection = () => {
{errors.question?.message ? errors.question.message : '⠀'}