メインコンテンツへスキップ
2

dsh-basketball-pet

2095945715a-source/dsh-basketball-pet

A draggable basketball desktop pet that bounces around the window, with a hoop to score in and a crate that keeps the ball.

インストール

dsh plugin --profile web add github:2095945715a-source/dsh-basketball-pet

README

Hoops Pet · 篮球桌宠

A desktop pet for the DSH Web UI: a real basketball that lives on top of your workspace, a hoop and a ball crate you can drag anywhere, and a score that resets every day.

Hoops Pet

中文说明见 README.zh.md


Why you'll like it

  • It feels physical. Gravity, air drag, spin, rolling friction, wall bounce and a squash-and-stretch on every impact — not a CSS animation loop.
  • It never gets in your way. The pet lives in a click-through overlay: the ball, the hoop and the crate accept pointer events, everything else you click goes straight through to the app.
  • It's a tiny game. Drag the hoop where you want it, flick the ball in, and watch the net drop when it swishes. The score is kept per day.

Features

🏀 Bouncy ballGravity 2400 px/s², floor restitution 0.78, air drag, spin. Hits compress it, fast falls stretch it.
🥅 Draggable hoopGlass backboard, steel bracket, gradient rim and a diamond net that swings on a swish. Drag it by the rim, the board or the bracket.
📦 Draggable crateBall rests inside until you take it out. Drag the crate with the ball in it — the ball comes along.
🖱️ Flick to throw110 ms of pointer samples become the release velocity (capped at 2600 px/s). Throw flat, lob it, or bank it off the board.
🎯 ScoringDropping through the rim gives +1, a net swish, a +1 pop and a bump on the score plate. Rim and board give real bounces.
📅 Daily scoreThe count is stored per calendar day and flips back to 0 after midnight, even while the page stays open.
💾 Stays where you put itHoop and crate positions are remembered across reloads.
♿ Reduced motionWith prefers-reduced-motion the pet stops nudging itself but still reacts to your input.
🔒 No network, no storage of anything elsePure rendering. The only persisted data is your score and the two positions.

Install

From the plugin market, or from a shell:

dsh plugin add dsh-basketball-pet
# if your dsh asks for a target profile explicitly:
dsh plugin --profile desktop add dsh-basketball-pet

From a local checkout / release tarball:

dsh plugin add ./dsh-basketball-pet-1.3.0.tgz

Or from source in this repo:

dsh plugin add github:<owner>/dsh-basketball-pet

Then reload the page (Ctrl+R). The pet mounts into the shell.overlay slot of the Web UI.

How to play

ActionResult
Click the crateThe ball pops out
Drag the ball and releaseIt flies off with your throw
Click the ball (no drag)It hops in place
Drag the hoop's rim / board / bracketThe hoop moves, the score plate follows
Drag the crateThe crate moves; a ball inside comes with it
Drop the ball onto the crateThe ball is put away
Throw the ball through the rim+1

How it works

Single-file client plugin (client.js), no build step, no runtime dependencies. It registers one component on the shell.overlay slot and runs its own requestAnimationFrame loop that writes transform directly — React never re-renders per frame.

  • Physics constants: GRAVITY 2400, FLOOR_REST 0.78, WALL_REST 0.84, rim 1.72, board 0.62, air drag 0.1
  • Collisions: floor, both walls, ceiling, both rim tips (as small circles) and the backboard edge
  • Scoring: the ball must cross the rim plane downward, moving down, inside the inner gap
  • Storage: dsh-basketball-pet:score:v1, dsh-basketball-pet:layout:v1 (localStorage)

Compatibility

  • DSH Web UI with the shell.overlay slot and the @deepseek-ai/dsh-client-ui-slots service
  • Any Chromium/Electron/WebKit-based DSH desktop build; no Node, no native code

License

MIT

関連プラグイン