Oopsies! Something went wrong.
} diff --git a/src/components/player/player-scores.tsx b/src/components/player/player-scores.tsx index 5b33aa1..a5a0851 100644 --- a/src/components/player/player-scores.tsx +++ b/src/components/player/player-scores.tsx @@ -8,7 +8,7 @@ import { capitalizeFirstLetter } from "@/common/string-utils"; import useWindowDimensions from "@/hooks/use-window-dimensions"; import { ClockIcon, TrophyIcon } from "@heroicons/react/24/solid"; import { useQuery } from "@tanstack/react-query"; -import { motion, useAnimation } from "framer-motion"; +import { motion, useAnimation, Variants } from "framer-motion"; import { useCallback, useEffect, useState } from "react"; import Card from "../card"; import Pagination from "../input/pagination"; @@ -35,11 +35,48 @@ type Props = { page: number; }; +const containerVariants: Variants = { + hiddenRight: { + opacity: 0, + x: 50, + }, + hiddenLeft: { + opacity: 0, + x: -50, + }, + visible: { + opacity: 1, + x: 0, + transition: { + staggerChildren: 0.05, + }, + }, +}; + +const childVariants: Variants = { + hiddenRight: { + opacity: 0, + x: 50, + }, + hiddenLeft: { + opacity: 0, + x: -50, + }, + visible: { + opacity: 1, + x: 0, + transition: { + ease: "anticipate", + }, + }, +}; + export default function PlayerScores({ initialScoreData, player, sort, page }: Props) { const { width } = useWindowDimensions(); const controls = useAnimation(); const [currentSort, setCurrentSort] = useState(sort); + const [previousPage, setPreviousPage] = useState(page); const [currentPage, setCurrentPage] = useState(page); const [currentScores, setCurrentScores] = useState