Skip to content

Web single trial + MiniPay gate #6

@Otaiki1

Description

@Otaiki1

Overview

Users who open blokaz.xyz in a standard browser (not MiniPay) get exactly one free game with no wallet connection available. After that game ends, a full-screen MiniPay gate blocks further play and directs them to download MiniPay.

User Flow

  1. User lands on blokaz.xyz in a regular browser
  2. All wallet connect buttons are hidden — a badge reads: "PLAY 1 FREE TRIAL — MINIPAY REQUIRED TO COMPETE"
  3. User clicks PLAY CLASSIC — game starts in practice mode (no on-chain transactions)
  4. Game over → MiniPayGateModal covers the screen:
    • Score displayed large
    • Heading: "YOUR TRIAL IS OVER."
    • Body: "To save your score, join the weekly leaderboard, and compete for USDT prizes — you need MiniPay."
    • Primary CTA: "GET MINIPAY" → links to https://minipay.opera.com
    • Secondary: "HOW IT WORKS" → opens HowToPlayModal
    • No Play Again, no wallet connect
  5. localStorage key blokaz:trial_used is set when the first game starts
  6. On subsequent visits from a non-MiniPay browser, the gate modal shows immediately on the lobby — no second game possible

Detection Logic

  • IS_MINIPAY already in src/utils/miniPay.ts — MiniPay users completely unaffected
  • Add isWebBrowser(): boolean!IS_MINIPAY
  • Add hasUsedTrial(): boolean → reads localStorage.getItem('blokaz:trial_used') === '1'
  • Gate condition: isWebBrowser() && hasUsedTrial()

Files to Change

  • src/utils/miniPay.ts — add helpers
  • src/components/LobbyScreen.tsx — hide wallet UI on web, show trial badge, show gate if trial used
  • src/components/GameScreen.tsx — set trial key on game start; route game-over to gate when on web
  • src/components/MiniPayGateModal.tsx — new full-screen non-dismissible modal

Notes

  • Trial game must NOT call contractStartGame — pure practice mode only
  • Web3Auth and MetaMask hidden entirely on web (not just greyed out)
  • Clearing localStorage gives another trial — acceptable tradeoff

Contract change required: No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions