aether-garden / ui /hero.py
kavyabhand's picture
Deploy Aether Garden application
781b9f7 verified
Raw
History Blame Contribute Delete
1.55 kB
"""Hero banner and world atmosphere components."""
from __future__ import annotations
from ui import assets
from world.database import get_world_state
def render_hero_banner() -> str:
state = get_world_state()
day = state.get("current_day", 1)
entities = state.get("total_entities", 0)
events = state.get("total_events", 0)
interactions = state.get("total_interactions", 0)
particles = "".join(
f'<span class="hero-particle" style="left:{(i * 17 + 7) % 96}%;'
f'animation-delay:{(i * 0.37) % 5:.2f}s;'
f'animation-duration:{3.5 + (i % 4) * 0.8:.1f}s"></span>'
for i in range(18)
)
return f"""
<div class="hero-banner">
<div class="hero-image-wrap">
<img src="{assets.banner_url()}" alt="Aether Garden — The World That Remembers" class="hero-image"/>
<div class="hero-particles" aria-hidden="true">{particles}</div>
<div class="hero-shimmer" aria-hidden="true"></div>
</div>
<div class="hero-statusbar">
<span class="hero-status-live"><span class="live-dot"></span> The world is awake</span>
<span class="hero-stat"><b>Day {day}</b></span>
<span class="hero-stat-div">·</span>
<span class="hero-stat"><b>{entities}</b> souls</span>
<span class="hero-stat-div">·</span>
<span class="hero-stat"><b>{interactions}</b> encounters</span>
<span class="hero-stat-div">·</span>
<span class="hero-stat"><b>{events}</b> world events</span>
</div>
</div>
"""