New table styling added

This commit is contained in:
Lucas Patenaude
2024-04-14 15:47:07 -06:00
parent f6f75075e0
commit 4cf078cca9
5 changed files with 55 additions and 46 deletions

View File

@@ -54,10 +54,12 @@
flex: 1; flex: 1;
} }
#league-stats-container .container { #league-table-and-information-container .container {
margin: 0 10px; margin: 0 10px;
margin-bottom: 20px;
padding: 15px;
background-color: #eaeaea; /* Example background color */ background-color: #ffffff; /* Example background color */
border: 1px solid gray; border: 1px solid gray;
border-radius: 8px; border-radius: 8px;

View File

@@ -6,14 +6,14 @@
#standings-table { #standings-table {
width: 100%; width: 100%;
padding: 5px; padding: 15px;
} }
#club-logo { #table-club-logo {
width: 20px; width: 20px;
margin-right: 5px; margin-right: 5px;
cursor: pointer; cursor: pointer;
transform: skewX(0deg); /* Skew the banner to create a triangular side */
} }
#club-name { #club-name {

View File

@@ -4,3 +4,7 @@
width: 40%; width: 40%;
/* Add any other styling you need for the top scorers container */ /* Add any other styling you need for the top scorers container */
} }
#top-scorers-container img {
width: 25px;
}

View File

@@ -1,5 +1,5 @@
// Add click event listener to club logos // Add click event listener to club logos
document.querySelectorAll('#club-logo, #club-name').forEach(element => { document.querySelectorAll('#table-club-logo, #club-name').forEach(element => {
element.addEventListener('click', (event) => { element.addEventListener('click', (event) => {
// Get the club ID from the clicked club logo's clubID attribute // Get the club ID from the clicked club logo's clubID attribute
const clubId = element.getAttribute('clubID'); const clubId = element.getAttribute('clubID');

View File

@@ -11,9 +11,13 @@
<div class="container" id="league-stats-container"> <div class="container" id="league-stats-container">
<!-- Container to display league table <- split 50% --> <!-- Container to display league table <- split 50% -->
<div class="container" id="league-table-container"> <div class="container" id="league-table-and-information-container">
<div id="table-header-container" class="header">
<h2>Table</h2> <h2>Table</h2>
</div>
<div id="table-stats-container" class="container">
<table id="standings-table"> <table id="standings-table">
<thead> <thead>
<tr> <tr>
@@ -32,7 +36,7 @@
{{#each league.standings}} {{#each league.standings}}
<tr> <tr>
<td>{{table.league_position}}</td> <td>{{table.league_position}}</td>
<td><img src="{{table.team_crest}}" alt="{{table.team_name}} Crest" id="club-logo" clubID="{{table.team_id}}"></td> <td id="club-logo-row"><img src="{{table.team_crest}}" alt="{{table.team_name}} Crest" id="table-club-logo" clubID="{{table.team_id}}"></td>
<td><span id="club-name" clubID="{{table.team_id}}">{{table.team_name}}</span></td> <td><span id="club-name" clubID="{{table.team_id}}">{{table.team_name}}</span></td>
<td>{{games_played}}</td> <td>{{games_played}}</td>
<td>{{wins}}</td> <td>{{wins}}</td>
@@ -44,31 +48,30 @@
{{/each}} {{/each}}
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
<!-- Container to display top scorers for league <- Split 50% --> <!-- Container to display top scorers for league <- Split 50% -->
<div class="container" id="top-scorers-container"> <div id="top-scorers-container" class="container">
<h2>Top Scorers</h2> <h2>Top Scorers</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Player Name</th> <th></th>
<th>Name</th>
<th>Club</th>
<th>GP</th> <th>GP</th>
<th>Goals</th> <th>Goals</th>
<th></th>
<th>Team Name</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each topScorers.scorers}} {{#each topScorers.scorers}}
<tr> <tr>
<td><img src="{{team.team_crest}}" alt="{{table.team_name}} Crest" id="table-logo"></td>
<td>{{player.player_name}}</td> <td>{{player.player_name}}</td>
<td>{{team.team_name}}</td>
<td>{{games_played}}</td> <td>{{games_played}}</td>
<td>{{goals}}</td> <td>{{goals}}</td>
<td><img src="{{team.team_crest}}" alt="{{table.team_name}} Crest" id="table-logo"></td>
<td>{{team.team_name}}</td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>