diff --git a/backend/entities/game.ts b/backend/entities/game.ts index 5f25de0..56a5630 100644 --- a/backend/entities/game.ts +++ b/backend/entities/game.ts @@ -311,6 +311,6 @@ export const game = { const { finished, stage } = serverGame; if (finished == 0) return 0; if (stage < 2) return 0; - return Math.floor(Math.pow(2, stage * 0.92)); + return Math.floor(Math.pow(2, stage * 0.93) + stage * 4 + 5); }, }; diff --git a/src/components/BounceImg.tsx b/src/components/BounceImg.tsx new file mode 100644 index 0000000..5818449 --- /dev/null +++ b/src/components/BounceImg.tsx @@ -0,0 +1,27 @@ +import { animate, motion } from "framer-motion"; +import { useRef } from "react"; + +const BounceImg = ({ src, className }: { src: string; className?: string }) => { + const ref = useRef(null); + return ( + { + if (ref.current) { + animate(ref.current, { scale: 1.2 }, { duration: 0.3 }); + setTimeout(() => { + if (ref.current) + animate(ref.current, { scale: 1 }, { duration: 0.3 }); + }, 300); + } + }} + transition={{ + type: "spring", + }} + className={className} + /> + ); +}; + +export default BounceImg; diff --git a/src/components/Feed/Feed.tsx b/src/components/Feed/Feed.tsx index 5837c01..824ca57 100644 --- a/src/components/Feed/Feed.tsx +++ b/src/components/Feed/Feed.tsx @@ -45,7 +45,7 @@ const Feed: React.FC = () => { newItems.push({ type: "gemsEarned", id: crypto.randomUUID(), - decay: Date.now() + 1000 * 3 + data.gems * 500, + decay: Date.now() + 1000 * 3 + data.stage * 1500, stage: data.stage, gems: data.gems, }); diff --git a/src/views/endless/Endless.tsx b/src/views/endless/Endless.tsx index 91b7b6e..d61ebcb 100644 --- a/src/views/endless/Endless.tsx +++ b/src/views/endless/Endless.tsx @@ -15,7 +15,7 @@ const Endless: React.FC = (props) => { const { data: game } = useWSQuery("game.getGameState", gameId!, !!gameId); const { data: settings } = useWSQuery("user.getSettings", null); const startGame = useWSMutation("game.createGame"); - const { data: leaderboard } = useWSQuery("scoreboard.getScoreBoard", 10); + const { data: leaderboard } = useWSQuery("scoreboard.getScoreBoard", 100); const reveal = useWSMutation("game.reveal"); const placeFlag = useWSMutation("game.placeFlag"); const placeQuestionMark = useWSMutation("game.placeQuestionMark"); diff --git a/src/views/store/Store.tsx b/src/views/store/Store.tsx index 392c7a2..49a156d 100644 --- a/src/views/store/Store.tsx +++ b/src/views/store/Store.tsx @@ -19,6 +19,7 @@ import Particles, { initParticlesEngine } from "@tsparticles/react"; import { loadSlim } from "@tsparticles/slim"; import { loadSeaAnemonePreset } from "@tsparticles/preset-sea-anemone"; import { motion } from "framer-motion"; +import BounceImg from "../../components/BounceImg"; const Store = () => { const openLootbox = useWSMutation("user.openLootbox"); @@ -112,7 +113,7 @@ const Store = () => {
- @@ -178,7 +179,7 @@ const Store = () => {
- +