paper-dynasty-database/storage/templates/player_card.html
Cal Corum c262bb431e
All checks were successful
Build Docker Image / build (pull_request) Successful in 3m57s
feat: render pipeline optimization (Phase 0)
- Persistent Chromium browser instance with auto-reconnect (WP-02)
- FastAPI lifespan hooks for browser startup/shutdown (WP-03)
- Self-hosted WOFF2 fonts via base64 embedding, remove Google Fonts CDN (WP-01)
- Fix pre-existing lint issues (unused imports, f-string placeholders)

Eliminates ~1.5s browser spawn overhead and ~0.4s font CDN round-trip
per card render. Target: per-card render from ~3s to <1s.

Refs: #88, #89, #90

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 00:06:58 -05:00

62 lines
3.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
{% include 'style.html' %}
</head>
<body>
<div id="fullCard" style="width: 1200px; height: 600px;">
<div id="header" class="row-wrapper header-text border-bot" style="height: 65px">
<!-- <div id="headerLeft" style="flex-grow: 3; height: auto">-->
<div id="headerLeft" style="width: 477px; height: auto">
<div class="row-wrapper" style="height: 100%">
<div style="width: 29px; height: auto; font-size: 30px; margin-left: 6px">
<b>{{ hand }}</b>
</div>
<div class="vline"></div>
<div class="header-text" style="padding-left: 5px; width: 462px">
<div style="height: 50%; font-variant: small-caps; font-size: 27px"><b>{{ player.p_name }}</b></div>
<div style="height: 50%; padding-left: 18px; margin-top: {{ position_margin }}px; font-size: {{ position_font }}px;">{{ position_string }}</div>
</div>
</div>
</div>
<div id="headerMiddle" style="width: 246px; height: auto; ">
<img src="data:image/png;base64,{{ rarity_file|safe }}" class="center" style="height: {% if player.rarity.name == 'Hall of Fame' %}62.{% else %}6{% endif %}5px; width: auto;"/>
</div>
{% if card_type == 'batter' %}
{% include 'topright_batter.html' %}
{% else %}
{% include 'topright_pitcher.html' %}
{% endif %}
</div>
<div id="allResults" class="result">
<div id="resultHeader" class="row-wrapper border-bot" style="height: 30px">
<div class="row-wrapper border-right-thick" style="width: 600px; ">
<div id="leftResultHeaderOne" class="column-num border-right-thin blue-gradient" style="width: 200px">
<b>{{ 1 if card_type == 'batter' else 4 }}</b>
</div>
<div id="leftResultHeaderTwo" class="column-num border-right-thin blue-gradient" style="width: 200px">
<b>{{ 2 if card_type == 'batter' else 5 }}</b>
</div>
<div id="leftResultHeaderThree" class="column-num blue-gradient" style="width: 200px">
<b>{{ 3 if card_type == 'batter' else 6 }}</b>
</div>
</div>
<div class="row-wrapper" style="width: 600px; ">
<div id="rightResultHeaderOne" class="column-num border-right-thin red-gradient" style="width: 200px">
<b>{{ 1 if card_type == 'batter' else 4 }}</b>
</div>
<div id="rightResultHeaderTwo" class="column-num border-right-thin red-gradient" style="width: 200px">
<b>{{ 2 if card_type == 'batter' else 5 }}</b>
</div>
<div id="rightResultHeaderThree" class="column-num red-gradient" style="width: 200px">
<b>{{ 3 if card_type == 'batter' else 6 }}</b>
</div>
</div>
</div>
<div id="resultWrapper" class="row-wrapper" style="height: 505px">
{% include 'result_columns.html' %}
</div>
</div>
</div>
</body>
</html>