Add icons to sport

This commit is contained in:
2023-11-06 19:50:38 +01:00
parent ec162009b4
commit b1efcc587f
3 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="191.000000pt" height="191.000000pt" viewBox="0 0 191.000000 191.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,191.000000) scale(0.100000,-0.100000)"
fill="#dee2e6" stroke="none">
<path d="M811 1753 c-21 -20 -86 -149 -213 -422 -169 -364 -187 -398 -242
-458 l-59 -65 219 -219 c120 -120 223 -219 229 -219 5 0 37 27 70 59 57 57 77
67 450 241 274 127 398 190 418 211 26 28 27 33 27 140 0 103 -1 111 -25 134
-46 47 -125 24 -125 -35 0 -39 -41 -111 -74 -131 -17 -11 -101 -42 -187 -69
-86 -27 -163 -58 -171 -67 -9 -10 -28 -42 -42 -71 -25 -50 -31 -54 -136 -107
-60 -30 -120 -55 -133 -55 -13 0 -37 15 -57 35 l-34 35 112 113 112 112 103
32 c302 94 372 118 389 135 16 16 18 37 18 208 0 257 17 240 -238 240 -183 0
-189 -1 -210 -23 -13 -14 -48 -108 -93 -252 l-72 -230 -113 -115 -114 -114
-35 34 c-20 20 -35 44 -35 57 0 13 25 73 55 133 l55 110 68 34 68 34 48 154
c27 84 59 172 72 195 25 44 89 83 136 83 59 0 80 79 33 125 -23 24 -31 25
-134 25 -107 0 -112 -1 -140 -27z"/>
<path d="M192 708 c-53 -56 -77 -121 -76 -213 0 -95 23 -152 88 -218 109 -112
273 -126 410 -36 26 18 50 39 53 47 4 9 -70 90 -213 233 -120 120 -221 219
-224 219 -4 0 -20 -15 -38 -32z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -7,8 +7,11 @@ const idMatch = window.location.href.split("=")[1];
const data = {
"status": "in_progress",
};
const record = await pb.collection('match').update(idMatch, data);
//Récupération des données du match
const currentStatus = await pb.collection('match').getOne(idMatch, {
expand: 'sport,team1,team2',
@@ -116,7 +119,6 @@ if(currentStatus.expand.sport.name === "basketball"){
arbitrageStopForm.appendChild(arbitrageStopFormDiv);
arbitrageDiv.appendChild(arbitrageStopForm);
//Comptage des points
const point1Team1 = document.getElementById("btnPoint1Btn1");
const point2Team1 = document.getElementById("btnPoint1Btn2");

View File

@@ -80,12 +80,27 @@ function getSportNextMatchText(sport){
return "Prochain match : " + match.expand.team1.name + " vs " + match.expand.team2.name + ' ' + time_start.toLocaleString('fr', { weekday: 'long' }) + " à " + time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' });
}
function getSportIcon(sport){
switch(sport.name) {
case "basketball":
return ` <span class="material-symbols-outlined">sports_basketball</span>`
case "volleyball":
return ` <span class="material-symbols-outlined">sports_volleyball</span>`
case "football":
return ` <span class="material-symbols-outlined">sports_soccer</span>`
case "handball":
return ` <span class="material-symbols-outlined">sports_handball</span>`
case "badminton":
return ` <img src="assets/shuttlecock.svg" alt="shuttlecock" width="24" height="24">`
}
}
function getSportCard(sport){
let winner = getSportWinningTeam(sport)
let title = winner === "" ? "La compétition n'a pas commencé" : ("Equipe en tête : " + winner)
return `
<div class="card my-3">
<div class="card-header text-center bg-light-subtle text-emphasis-light">${sport.name.toUpperCase()}</div>
<div class="card-header text-center bg-light-subtle text-emphasis-light"><div class="d-flex justify-content-center">${sport.name.toUpperCase()}${getSportIcon(sport)}</div></div>
<div class="card-body bg-light-subtle text-emphasis-light">
<h5 class="card-title">${title}</h5>
</div>