Skip to main content

Cat miner animation UI widget (HTML/CSS/JS). Use in NiceGUI, Streamlit, Flask, or any web app.

Project description

cat-miner-ui

A Cat Miner animation UI widget.
Framework-agnostic HTML/CSS/JS fragments — inject into the body of NiceGUI, Streamlit, Flask, or any web app.

Install

Standard install (recommended) — from PyPI or from a local wheel:

pip install cat-miner-ui

For local development (editable install):

cd preorder_app_final
pip install -e .

Demo (see it in action)

Importing alone does not show anything: from cat_miner_ui import render only loads the function.
render() returns HTML/CSS/JS strings; you need to inject them into a web page for the animation to appear.

To open a demo in your browser, run in a terminal:

python -m cat_miner_ui

Your default browser will open with the cat miner demo page.

Image

  • Sprite: 3 frames horizontally (300% width), 100% height (1/3 width per frame).
  • Default: Uses the bundled static/cat_mining.png. No extra serving needed.
  • Custom: Pass a URL, e.g. render(image_url="/img/my_sprite.png").

Example (NiceGUI)

from nicegui import ui
from cat_miner_ui import render

# Pass your own list of messages (or omit to use defaults)
parts = render(messages=["Loading...", "Hold on", "Almost there"])
# Or use defaults: parts = render()

ui.add_body_html(parts["font_link"])
ui.add_body_html(parts["css"])
ui.add_body_html(parts["html_left"])
ui.add_body_html(parts["html_right"])
ui.add_body_html(parts["script"])

API

  • get_css(image_url=None) → CSS string
  • get_html(first_message, flip=False) → Speech bubble + miner div HTML (flip=True for right-facing)
  • get_script(messages) → Speech-bubble rotation script
  • get_font_link() → Noto Sans KR webfont link tag
  • render(messages=None, image_url=None) → Dict with all of the above.
    messages: list of strings for the speech bubble (any strings).
    image_url: None = use bundled image.
  • DEFAULT_MESSAGES → Default speech-bubble strings (reference).
  • get_demo_html(messages=None) → Full HTML document string for a standalone demo page.

Publishing to PyPI

See BUILD.md in the project root for step-by-step build and upload. Summary:

  1. pip install build twine
  2. python -m build → creates wheel/sdist in dist/
  3. Create an API token on PyPI, then twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cat_miner_ui-0.1.0.tar.gz (336.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cat_miner_ui-0.1.0-py3-none-any.whl (333.4 kB view details)

Uploaded Python 3

File details

Details for the file cat_miner_ui-0.1.0.tar.gz.

File metadata

  • Download URL: cat_miner_ui-0.1.0.tar.gz
  • Upload date:
  • Size: 336.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cat_miner_ui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7007aa90d30253ce72624565e5c5e6ed670b018696d5d3c47956ee2d26fb54f5
MD5 4889cec01675175787e51d9bc419e7cc
BLAKE2b-256 4aa6a833ba8ec335a462b882035ba9e715032129c4672e4aba0814b7eb7af432

See more details on using hashes here.

File details

Details for the file cat_miner_ui-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cat_miner_ui-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 333.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cat_miner_ui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd1e32fd9e7c6384cf9738c8e93050a2edb781f003825fa5170d1652ecd5545c
MD5 d8c98ece0db4feb4166a648f020e335a
BLAKE2b-256 5d83d7d4cfb03b896b930e2bc79e812c0e8563af6d24ff95b9a5f1033384d220

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page