-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* constant docstrings * update prompt engineering a bit * update prompt language * first pass matchup viewer * minor changes * remove ai on team viewer cause it's not good * an absurd amount of work for what is essentially recreating the espn ui * add note * add sad note
- Loading branch information
Showing
11 changed files
with
342 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[client] | ||
showErrorDetails = "none" | ||
#toolbarMode = "viewer" | ||
|
||
[logger] | ||
level = "info" | ||
messageFormat = "%(asctime)s %(message)s" | ||
|
||
[server] | ||
headless = true | ||
|
||
[browser] | ||
gatherUsageStats = false | ||
|
||
[theme] | ||
base="dark" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from dataclasses import dataclass | ||
|
||
from espn_api.basketball import Team | ||
from jinja2 import Template | ||
|
||
|
||
@dataclass | ||
class MatchupInput: | ||
home_team: Team | ||
away_team: Team | ||
home_team_score: int | ||
away_team_score: int | ||
ties: int | ||
matchup_scores: list[dict[str, int]] | ||
|
||
|
||
def get_matchup_html(data: MatchupInput): | ||
with open("src/frontend/components/matchup.html", "r") as f: | ||
template = Template(f.read()) | ||
|
||
return template.render( | ||
home_logo=data.home_team.logo_url, | ||
away_logo=data.away_team.logo_url, | ||
home_team=data.home_team.team_name, | ||
away_team=data.away_team.team_name, | ||
wins=data.home_team_score, | ||
losses=data.away_team_score, | ||
ties=data.ties, | ||
matchup_scores=data.matchup_scores, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Fantasy Basketball Dashboard</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: fit-content; | ||
background-color: #0E1117; | ||
color: white; | ||
} | ||
|
||
.score-card { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 16px; | ||
background: #262730; | ||
border-radius: 12px; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
padding: 16px; | ||
width: 80%; | ||
margin-bottom: 1px; | ||
color: white; | ||
} | ||
|
||
.team { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
flex: 1; | ||
} | ||
|
||
.team img { | ||
width: 50px; | ||
height: 50px; | ||
object-fit: cover; | ||
border-radius: 50%; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.team-name { | ||
font-size: 16px; | ||
font-weight: bold; | ||
text-align: center; | ||
word-wrap: break-word; | ||
} | ||
|
||
.score { | ||
font-size: 24px; | ||
font-weight: bold; | ||
white-space: nowrap; | ||
text-align: center; | ||
flex-shrink: 0; | ||
} | ||
|
||
table { | ||
width: 80%; | ||
border-collapse: collapse; | ||
margin-top: 0px; | ||
background: rgba(224, 128, 38, 0.819); | ||
border-radius: 8px; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
overflow: hidden; | ||
padding: 16px; | ||
width: 80%; | ||
border-top: 1px solid rgba(224, 128, 38, 0.819); | ||
} | ||
|
||
|
||
table th, table td { | ||
padding: 6px; | ||
text-align: center; | ||
border-bottom: 1px solid #0907078e; | ||
border-left: 1px solid #0907071e; | ||
} | ||
table th img { | ||
width: 50px; /* Set a consistent width */ | ||
height: 50px; /* Set a consistent height */ | ||
object-fit: cover; /* Ensure proper aspect ratio */ | ||
} | ||
|
||
.highlight { | ||
background-color: rgb(230, 131, 39);; | ||
font-weight: bold; | ||
} | ||
.highlight-black { | ||
background-color: #262730; | ||
} | ||
|
||
|
||
@media (max-width: 480px) { | ||
.score-card { | ||
flex-direction: row; | ||
text-align: center; | ||
padding: 4px; | ||
width: 95%; | ||
} | ||
|
||
.team img { | ||
width: 40px; | ||
height: 40px; | ||
} | ||
|
||
.team-name { | ||
font-size: 14px; | ||
} | ||
|
||
.score { | ||
font-size: 18px; | ||
} | ||
|
||
table { | ||
width: 95%; | ||
} | ||
|
||
/* table th, table td { | ||
padding: 8px; | ||
} */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="score-card"> | ||
<div class="team"> | ||
<img src="{{ home_logo }}" alt="Team 1 Logo"> | ||
<div class="team-name">{{ home_team }}</div> | ||
</div> | ||
<div class="score">{{ wins }} - {{ ties }} - {{ losses }}</div> | ||
<div class="team"> | ||
<img src="{{ away_logo }}" alt="Team 2 Logo"> | ||
<div class="team-name">{{ away_team }}</div> | ||
</div> | ||
</div> | ||
<table> | ||
<tbody> | ||
{% for category in matchup_scores %} | ||
<tr> | ||
<td | ||
class="{% if (category.name == 'TO' and category.home < category.away) or (category.name != 'TO' and category.home > category.away) %}highlight{% endif %}"> | ||
{{ category.home }} | ||
</td> | ||
<td class="highlight-black">{{ category.name }}</td> | ||
<td | ||
class="{% if (category.name == 'TO' and category.away < category.home) or (category.name != 'TO' and category.away > category.home) %}highlight{% endif %}"> | ||
{{ category.away }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.