Make player names clickable with Sleeper league URLs

- Wrapped player pills in anchor tags linking to Sleeper league pages
- Both starters and bench players now clickable and link to their league
- Added CSS styling for player-pill-link to maintain existing appearance
- Players maintain hover effects and position-based colors when clickable
- Links work on both web and mobile (Sleeper app deep links)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
efigueroa 2025-09-06 23:08:43 -07:00
parent 59265c7798
commit c0e3879cb8
2 changed files with 32 additions and 16 deletions

View file

@ -438,6 +438,18 @@
transform: scale(1.05); transform: scale(1.05);
} }
/* Player pill links */
.player-pill-link {
text-decoration: none;
color: inherit;
display: inline-block;
}
.player-pill-link:hover .player-pill {
transform: scale(1.05);
cursor: pointer;
}
.player-pill .pos { .player-pill .pos {
font-weight: bold; font-weight: bold;
font-size: 9px; font-size: 9px;

View file

@ -125,14 +125,16 @@
{% if starters %} {% if starters %}
<div class="starters-container"> <div class="starters-container">
{% for player in starters %} {% for player in starters %}
<div class="player-pill starter {{ player.fantasy_positions[0]|lower if player.fantasy_positions else 'flex' }}"> <a href="https://sleeper.com/leagues/{{ league_info.league.league_id }}" target="_blank" class="player-pill-link">
<span class="pos">{{ player.fantasy_positions[0] if player.fantasy_positions else 'FLEX' }}</span> <div class="player-pill starter {{ player.fantasy_positions[0]|lower if player.fantasy_positions else 'flex' }}">
<span class="name">{{ player.last_name }} <span class="pos">{{ player.fantasy_positions[0] if player.fantasy_positions else 'FLEX' }}</span>
{% if player.injury_status %} <span class="name">{{ player.last_name }}
<span class="injury-status">{{ player.injury_status }}</span> {% if player.injury_status %}
{% endif %} <span class="injury-status">{{ player.injury_status }}</span>
</span> {% endif %}
</div> </span>
</div>
</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@ -141,14 +143,16 @@
{% if bench_players %} {% if bench_players %}
<div class="bench-container"> <div class="bench-container">
{% for player in bench_players %} {% for player in bench_players %}
<div class="player-pill bench {{ player.fantasy_positions[0]|lower if player.fantasy_positions else 'flex' }}"> <a href="https://sleeper.com/leagues/{{ league_info.league.league_id }}" target="_blank" class="player-pill-link">
<span class="pos">{{ player.fantasy_positions[0] if player.fantasy_positions else 'FLEX' }}</span> <div class="player-pill bench {{ player.fantasy_positions[0]|lower if player.fantasy_positions else 'flex' }}">
<span class="name">{{ player.last_name }} <span class="pos">{{ player.fantasy_positions[0] if player.fantasy_positions else 'FLEX' }}</span>
{% if player.injury_status %} <span class="name">{{ player.last_name }}
<span class="injury-status">{{ player.injury_status }}</span> {% if player.injury_status %}
{% endif %} <span class="injury-status">{{ player.injury_status }}</span>
</span> {% endif %}
</div> </span>
</div>
</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}