forked from retoor/devplacepy
feat: add alt text extraction from URLs for images and improve CSS variable usage for progress bars
Add `_alt_from_url` helper in Python rendering and `altFromUrl` in JS ContentRenderer to generate descriptive alt attributes from image filenames, replacing empty alt strings. Update image embed templates and Avatar component to use derived alt text. Migrate inline `style.width` assignments to CSS custom properties (`--poll-pct`, `--hud-xp`, `--quest-pct`, `--bar-pct`, `--quota-pct`) across PollManager, GameFarm, and profile/quest CSS for better maintainability. Introduce new admin, docs, projects, services, and base CSS utility classes. Add "Code Farm" docs page entry.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
<span>{{ profile_user.get('xp', 0) % 100 }}%</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div class="bar-fill" style="width: {{ profile_user.get('xp', 0) % 100 }}%;"></div>
|
||||
<div class="bar-fill" style="--bar-pct: {{ profile_user.get('xp', 0) % 100 }}%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
{% if ai_quota %}
|
||||
<div class="ai-quota" data-ai-quota>
|
||||
<div class="ai-quota-bar">
|
||||
<span class="ai-quota-fill {% if not ai_quota.unlimited and ai_quota.used_pct >= 90 %}ai-quota-danger{% endif %}" style="width: {{ 0 if ai_quota.unlimited else ai_quota.used_pct }}%"></span>
|
||||
<span class="ai-quota-fill {% if not ai_quota.unlimited and ai_quota.used_pct >= 90 %}ai-quota-danger{% endif %}" style="--quota-pct: {{ 0 if ai_quota.unlimited else ai_quota.used_pct }}%"></span>
|
||||
</div>
|
||||
<div class="ai-quota-meta">
|
||||
<span class="ai-quota-pct">{% if ai_quota.unlimited %}No daily spend cap{% else %}{{ ai_quota.used_pct }}% of daily quota used{% endif %}</span>
|
||||
@@ -327,7 +327,7 @@
|
||||
{% if ai_quota %}
|
||||
<div class="ai-quota" data-ai-quota>
|
||||
<div class="ai-quota-bar">
|
||||
<span class="ai-quota-fill {% if not ai_quota.unlimited and ai_quota.used_pct >= 90 %}ai-quota-danger{% endif %}" style="width: {{ 0 if ai_quota.unlimited else ai_quota.used_pct }}%"></span>
|
||||
<span class="ai-quota-fill {% if not ai_quota.unlimited and ai_quota.used_pct >= 90 %}ai-quota-danger{% endif %}" style="--quota-pct: {{ 0 if ai_quota.unlimited else ai_quota.used_pct }}%"></span>
|
||||
</div>
|
||||
<div class="ai-quota-meta">
|
||||
<span class="ai-quota-pct">{% if ai_quota.unlimited %}No daily AI spend cap{% else %}{{ ai_quota.used_pct }}% of your daily AI quota used{% endif %}</span>
|
||||
|
||||
Reference in New Issue
Block a user