Skip to content

Bundle a local card-back image and stop depending on the hard-coded gstatic.com URL #187

@arasaka-net

Description

@arasaka-net

Both createCard and createDeck inline a gstatic.com thumbnail URL as the card back. That URL is a third-party encoded asset that can 404 or rotate at any time. Replace it with a local asset in src/assets/ so the game renders correctly without an external dependency.

Context
The card-back image is currently fetched from https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSEArMDpLqCtEe0kLcWh5dJj0s-dAnCShz_cQ&s. That URL is a Google Images CDN thumbnail whose content and lifetime Arasaka does not control; if Google invalidates it the entire table renders with broken card backs. The repository already vendors other card imagery under src/assets/ (credit.jpg, virus.jpg, etc.), so adding a bundled card back and importing it is consistent with existing practice. This reduces one external point of failure and makes the production build self-contained, which also makes Playwright e2e runs less flaky.

Affected Files

  • src/assets/card-back.jpg — new bundled asset replacing the third-party URL
  • src/scripts/card.js:21card-back img src is the gstatic.com URL
  • src/scripts/deck.js:45deck-card-back img src is the same gstatic.com URL

Requirements

  • A local card-back image file is committed under src/assets/ and referenced from both card.js and deck.js.
  • No source file under src/ contains the string gstatic.com after the change.
  • npm run build succeeds and the produced dist/ includes the bundled card-back asset.
  • npm test continues to pass.

Verification

  • npm ci
  • npm run build
  • ! grep -r 'gstatic.com' src/
  • ls src/assets/card-back.*
  • npm test

Not In Scope

  • Do not refactor the surrounding card or deck DOM construction beyond swapping the image source.
  • Do not introduce a build-time image optimization pipeline or new asset loader.

Evidence

  • src/scripts/card.js:21<img ... src="https://encrypted-tbn0.gstatic.com/images?..."> hard-codes a third-party thumbnail URL
  • src/scripts/deck.js:45 — identical gstatic.com URL duplicated in the deck DOM template
  • src/assets/ — already contains local .jpg tokens, proving local assets are the established convention

Arasaka Queue Planning Division.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions