feat: UNO-style table, social hub, cosmetics, speed mode, store IAB

Game table & play
- UNO-style restyle: suit-aware bolder cards (+xl size), pulsing playable glow,
  big "YOUR TURN" pill, active-seat ring, trick-win particle burst, round
  confetti, match coin-rain.
- Per-league turn time via turnMsForStake: 15s starter/AI, 10s pro, 7s expert;
  mirrored server-side in GameRoom.TurnMs.
- Speed (Blitz) mode for vs-AI/private: 5s turns, race to 5, ~halved pacing.
- Matchmaking waits ~15s (randomized 12-18s) then fills bots; elapsed timer + hint.

Rewards / gifts
- Richer post-match modal (floating coins, XP bar), celebration overlay reveals
  the unlocked sticker pack, boosted daily rewards (client+server synced),
  themed 7-day daily with special day-7.

Social
- Public profile modal (identity, stats, achievement board) from leaderboard /
  friends / discover / end-of-game roster; rate-limited add-friend (10/hour).
- Social hub: Friends / Discover (player search + suggestions) / Messages inbox.
- Profile gender (shown in finder/profile) + social links with public/friends/
  hidden visibility, enforced server-side.

Cosmetics
- Distinct card backs: per-design pattern families (stripes/argyle/grid/dots/
  rays/scales/crosshatch/royal/filigree/gem) + luxury motifs (lib/cardBack.ts),
  consistent on table/shop/profile; +Peacock/Rose-Gold backs.
- Purchasable titles (shop Titles section); title shown under the seat on the
  table and in discover/public profile.
- 10 new sticker packs (banter/kol-kol, Persian trends, court cards, moods).
- Persistent level+XP bar on Home and every inner screen.

Payments
- Buy-coins gateway opens in a new tab (no SPA dead-end) + focus refresh.
- Store IAB scaffolding: Cafe Bazaar deep-link purchase + redirect-token capture,
  Myket native-bridge contract, server-side IabService.Verify for both stores,
  config-driven via Iab__* env. POST /api/coins/iab/verify (JWT).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-06 18:39:24 +03:30
parent e450a6a2ed
commit cb27a16dc1
49 changed files with 3438 additions and 592 deletions
+27
View File
@@ -10,6 +10,7 @@ import { useUIStore } from "@/lib/ui-store";
import { useI18n } from "@/lib/i18n";
import { getService } from "@/lib/online/service";
import { pushNotification } from "@/lib/notification-store";
import { celebrate } from "@/lib/celebration-store";
import { MatchSummary, RewardResult } from "@/lib/online/types";
export function GameScreen() {
@@ -66,6 +67,30 @@ export function GameScreen() {
});
};
// Splashy celebration overlay for every achievement / level-up earned in the
// match — fired once the post-match reward summary is dismissed so each unlock
// gets its own animated moment (queued by the celebration store).
const celebrateRewards = (r: RewardResult | null) => {
if (!r) return;
if (r.leveledUp) {
celebrate({
variant: "xp",
icon: "🎚️",
title: t("reward.levelUp"),
levelBefore: r.levelBefore,
levelAfter: r.levelAfter,
});
}
for (const a of r.newAchievements) {
celebrate({
variant: "purchase",
icon: a.icon,
title: t("reward.newAchievement"),
achievements: [a],
});
}
};
// Client-run games (private rooms / casual): submit the result to the server.
useEffect(() => {
if (!live && mode === "online" && game.phase === "match-over" && !submitted.current) {
@@ -149,7 +174,9 @@ export function GameScreen() {
reward={reward}
won={game.matchWinner === 0}
onClose={() => {
const r = reward;
setReward(null);
celebrateRewards(r);
finish();
}}
/>