Skip to content
Snippets Groups Projects
Commit 20836cf4 authored by maeries's avatar maeries
Browse files

new table design for ranking and competition page

parent 92b41e9b
Branches
No related tags found
No related merge requests found
......@@ -60,9 +60,24 @@ def get_competition_page_html(self, competition_id):
tr:hover {{
background-color: #f5f5f5;
}}
tr:nth-child(even)>td:nth-child(1) {{
background-color: {self.BORDER_COLOR_DARK};
}}
tr:nth-child(odd)>td:nth-child(1) {{
background-color: {self.BORDER_COLOR};
}}
td:nth-child(1) {{
text-align: center;
font-weight: bold;
}}
p {{
animation: fadeInUp 0.5s ease-out forwards;
}}
.chart-container {{
margin-top: 30px;
display: flex;
......@@ -77,19 +92,22 @@ def get_competition_page_html(self, competition_id):
padding: 20px;
box-sizing: border-box;
}}
.chart-container img {{
max-width: 100%;
height: auto;
}}
a {{
color: {self.LINK_COLOR};
text-decoration: none;
color: black;
transition: color 0.3s ease;
}}
a:hover {{
color: {self.LINK_COLOR_HOVER};
text-decoration: none;
color: {self.LINK_COLOR};
text-decoration: underline;
}}
.summary-stats {{
display: flex;
justify-content: space-around;
......@@ -97,6 +115,7 @@ def get_competition_page_html(self, competition_id):
flex-wrap: wrap;
animation: fadeInUp 0.5s ease-out forwards;
}}
.stat-box {{
padding: 15px;
border: 1px solid #ddd;
......@@ -107,21 +126,26 @@ def get_competition_page_html(self, competition_id):
text-align: center;
background-color: #f9f9f9;
}}
.stat-value {{
font-size: 24px;
font-weight: bold;
color: #333;
}}
.stat-label {{
font-size: 14px;
color: #666;
}}
.positive {{
color: green;
}}
.negative {{
color: red;
}}
@keyframes fadeInUp {{
from {{
opacity: 0;
......@@ -151,7 +175,7 @@ def get_competition_page_html(self, competition_id):
<h2>Results</h2>
<table>
<tr>
<th>Placement</th>
<th></th>
<th>Team</th>
<th>Elo Before</th>
<th>Elo Change</th>
......
......@@ -38,10 +38,12 @@ class EloSystem:
self.competition_meta_data = self.load_competition_meta_data()
if self.competition_type == "electric":
self.BORDER_COLOR = "#ffff1e"
self.BORDER_COLOR_DARK = "#f9f918"
self.LINK_COLOR = "#ffc400"
self.LINK_COLOR_HOVER = "#cc9d00"
elif self.competition_type == "combustion":
self.BORDER_COLOR = "#ff8c00"
self.BORDER_COLOR_DARK = "#f98700"
self.LINK_COLOR = "#ff4500"
self.LINK_COLOR_HOVER = "#cc3700"
else:
......
......@@ -171,15 +171,16 @@ def get_team_page_html(self, team_name, team_data, team_competitions):
</div>
<h2>Competition History</h2>
<table>
<tr>
<th>Date</th>
<th>Competition</th>
<th>Placement</th>
<th>Elo Before</th>
<th>Elo After</th>
<th>Elo Change</th>
</tr>
<div style="overflow: scroll;">
<table>
<tr>
<th>Date</th>
<th>Competition</th>
<th>Placement</th>
<th>Elo Before</th>
<th>Elo After</th>
<th>Elo Change</th>
</tr>
""".format(clean_filename(team_name), team_name)
# Add rows for each competition
......@@ -198,7 +199,8 @@ def get_team_page_html(self, team_name, team_data, team_competitions):
</tr>"""
html_content += """
</table>
</table>
</div>
<p><small>Generated on {}</small></p>
</body>
......
......@@ -100,6 +100,19 @@ def get_world_ranking_html(self, sorted_teams):
background-color: #f5f5f5;
}}
tr:nth-child(even)>td:nth-child(1) {{
background-color: {self.BORDER_COLOR_DARK};
}}
tr:nth-child(odd)>td:nth-child(1) {{
background-color: {self.BORDER_COLOR};
}}
td:nth-child(1) {{
text-align: center;
font-weight: bold;
}}
.chart-container {{
margin: 30px 0;
display: flex;
......@@ -121,14 +134,13 @@ def get_world_ranking_html(self, sorted_teams):
}}
a {{
color: {self.LINK_COLOR};
text-decoration: none;
color: black;
transition: color 0.3s ease;
}}
a:hover {{
color: {self.LINK_COLOR_HOVER};
text-decoration: none;
color: {self.LINK_COLOR};
text-decoration: underline;
}}
.timestamp {{
......@@ -202,13 +214,14 @@ def get_world_ranking_html(self, sorted_teams):
</div>
<h2>Current Rankings</h2>
<table>
<tr>
<th>Rank</th>
<th>Team</th>
<th>Elo Rating</th>
<th>Competitions</th>
</tr>
<div style="overflow: scroll;">
<table>
<tr>
<th></th>
<th>Team</th>
<th>Elo Rating</th>
<th>Competitions</th>
</tr>
"""
# Add rows for each team
......@@ -222,7 +235,8 @@ def get_world_ranking_html(self, sorted_teams):
</tr>"""
html_content += """
</table>
</table>
<div>
<div class="chart-container">
<img src="images/elo_distribution.png" alt="Elo Distribution">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment