Skip to content

v0.6.0: Rename Animate to App with Window abstraction

Latest

Choose a tag to compare

@jdrumgoole jdrumgoole released this 03 Feb 12:48

What's New

Breaking Changes

  • Renamed Animate class to App - The main interactive display class is now called App for cleaner naming
  • All demos, tests, and documentation updated to use App

New Features

  • Window abstraction - New Window class for runtime window control
    • app.window.set_title("New Title") - Change browser tab title
    • app.window.dark() / app.window.light() - Toggle themes
    • app.window.resize(width, height) - Resize window
    • app.window.fullscreen() - Make window fullscreen
  • WindowConfig - Configuration dataclass with factory presets
    • WindowConfig.compact() - 600x400
    • WindowConfig.standard() - 1024x768
    • WindowConfig.wide() - 1400x900
    • WindowConfig.dark() - Dark theme preset
  • CSS theme variables - Light and dark theme support via CSS variables

Example

from animaid import App, HTMLString

with App(title="My App", theme="dark") as app:
    app.add(HTMLString("Hello World!").bold())
    
    # Runtime window control
    app.window.set_title("Updated Title")
    app.window.light()  # Switch to light theme

Migration

Simply replace Animate with App and anim with app:

# Before
from animaid import Animate
with Animate() as anim:
    anim.add(...)

# After
from animaid import App
with App() as app:
    app.add(...)