You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

210 lines
8.3 KiB

  1. <ion-content *ngIf="matchStats" [scrollEvents]="true">
  2. <section class="header-with-action-buttons">
  3. <div class="nav">
  4. <button (click)="back()"> <ion-icon name="chevron-back-outline"></ion-icon> <span> BACK </span> </button>
  5. </div>
  6. <header> {{ matchStats.homeTeam.teamName }} v/s {{ matchStats.awayTeam.teamName }} <br>
  7. <span> Live from {{ matchStats.stadium }} Stadium </span> </header>
  8. <div class="action">
  9. <button> <ion-icon name="share-social"></ion-icon> </button>
  10. </div>
  11. </section>
  12. <div class="segment-holder" [ngClass]="{'no-bg' : selectedSegment === 'MATCH' && selectedRoster === 'LIVE'} ">
  13. <section class="segments" [ngClass]="{'active': selectedSegment === 'MATCH' }">
  14. <button (click)="selectedSegment = 'SCORE'"> Scorecard </button>
  15. <button (click)="selectedSegment = 'MATCH'"> Match </button>
  16. </section>
  17. </div>
  18. <div class="score-container" *ngIf="selectedSegment === 'SCORE'">
  19. <section class="score-card">
  20. <header>
  21. <img [src]="matchStats.awayTeam.teamLogo"> <h5> {{ matchStats.awayTeam.teamName }} </h5>
  22. <p> {{ matchStats.awayTeam.totalScore }}/{{ matchStats.awayTeam.totalWickets }} <span> ({{ matchStats.awayTeam.overs }}) </span> </p>
  23. </header>
  24. <div class="container">
  25. <table>
  26. <thead>
  27. <tr>
  28. <th>
  29. Player
  30. </th>
  31. <th>
  32. Score
  33. </th>
  34. <th>
  35. Balls
  36. </th>
  37. <th>
  38. 6s
  39. </th>
  40. <th>
  41. 4s
  42. </th>
  43. <th>
  44. RR
  45. </th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <tr *ngFor="let player of matchStats.awayTeam.batting">
  50. <td>
  51. <label> {{ player.name }} </label> <br>
  52. <span> {{ player.wicketTo }} </span>
  53. </td>
  54. <td>
  55. {{ player.score }}
  56. </td>
  57. <td>
  58. {{ player.ballsPlayed }}
  59. </td>
  60. <td>
  61. {{ player.sixes }}
  62. </td>
  63. <td>
  64. {{ player.boundaries }}
  65. </td>
  66. <td>
  67. {{ limitDecimals(player.score / player.ballsPlayed) }}
  68. </td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. </section>
  74. <section class="score-card">
  75. <header>
  76. <img [src]="matchStats.homeTeam.teamLogo"> <h5> {{ matchStats.homeTeam.teamName }} </h5>
  77. <p> {{ matchStats.homeTeam.totalScore }}/{{ matchStats.homeTeam.totalWickets }} <span> ({{ matchStats.homeTeam.overs }}) </span> </p>
  78. </header>
  79. <div class="container">
  80. <table>
  81. <thead>
  82. <tr>
  83. <th>
  84. Player
  85. </th>
  86. <th>
  87. Score
  88. </th>
  89. <th>
  90. Balls
  91. </th>
  92. <th>
  93. 6s
  94. </th>
  95. <th>
  96. 4s
  97. </th>
  98. <th>
  99. RR
  100. </th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr *ngFor="let player of matchStats.homeTeam.batting">
  105. <td>
  106. <label> {{ player.name }} </label> <br>
  107. <span> {{ player.wicketTo }} </span>
  108. </td>
  109. <td>
  110. {{ player.score }}
  111. </td>
  112. <td>
  113. {{ player.ballsPlayed }}
  114. </td>
  115. <td>
  116. {{ player.sixes }}
  117. </td>
  118. <td>
  119. {{ player.boundaries }}
  120. </td>
  121. <td>
  122. {{ limitDecimals(player.score / player.ballsPlayed) }}
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </div>
  128. </section>
  129. </div>
  130. <ng-container *ngIf="selectedSegment === 'MATCH'">
  131. <div class="commentary-container" *ngIf="selectedRoster === 'LIVE'">
  132. </div>
  133. <div *ngIf="selectedSegment === 'MATCH'" class="team-selection" [ngClass]="{'active': selectedRoster === 'AWAY', 'live': selectedRoster === 'LIVE', 'change-bg' : selectedRoster !== 'LIVE' }">
  134. <button (click)="selectedRoster = 'HOME'"> {{ matchData.home.name }} </button>
  135. <button class="live" (click)="selectedRoster = 'LIVE'"> <span></span> </button>
  136. <button (click)="selectedRoster = 'AWAY'"> {{ matchData.away.name }} </button>
  137. </div>
  138. <section class="player-list" *ngIf="selectedRoster === 'HOME'">
  139. <ul>
  140. <li *ngFor="let player of matchData.home.players" (click)="selectPlayerDetails()">
  141. <label> {{ player.jersey }} </label>
  142. <img [src]="player.image" class="player-image">
  143. <div class="details">
  144. <h4> {{ player.name }} </h4>
  145. <img *ngIf="player.isCaptain" src="assets/icons/captain-band.png">
  146. <img *ngIf="player.isKeeper" src="assets/icons/gloves.png">
  147. <img *ngIf="player.isTopScorer" src="assets/icons/orange-cap.png">
  148. <img *ngIf="player.role === 'BATSMAN'" src="assets/icons/batsman.png">
  149. <img *ngIf="player.role === 'BOWLER'" src="assets/icons/ball.png">
  150. </div>
  151. </li>
  152. </ul>
  153. </section>
  154. <section class="player-list" *ngIf="selectedRoster === 'AWAY'">
  155. <ul>
  156. <li *ngFor="let player of matchData.away.players" (click)="selectPlayerDetails()">
  157. <label> {{ player.jersey }} </label>
  158. <img [src]="player.image" class="player-image">
  159. <div class="details">
  160. <h4> {{ player.name }} </h4>
  161. <img *ngIf="player.isCaptain" src="assets/icons/captain-band.png">
  162. <img *ngIf="player.isKeeper" src="assets/icons/gloves.png">
  163. <img *ngIf="player.isTopScorer" src="assets/icons/orange-cap.png">
  164. <img *ngIf="player.role === 'BATSMAN'" src="assets/icons/batsman.png">
  165. <img *ngIf="player.role === 'BOWLER'" src="assets/icons/ball.png">
  166. </div>
  167. </li>
  168. </ul>
  169. </section>
  170. </ng-container>
  171. <section class="player-details" *ngIf="isPlayerSelected">
  172. <button class="close-button" (click)="isPlayerSelected = false">
  173. <ion-icon name="close-outline"></ion-icon>
  174. </button>
  175. <app-player-details></app-player-details>
  176. </section>
  177. </ion-content>