recap new svg

This commit is contained in:
Allan Cueff
2022-12-31 00:19:17 +01:00
parent bffb0af901
commit 3a94d25f8c
2 changed files with 14 additions and 5 deletions

View File

@@ -36,7 +36,6 @@
</div>
<div class="top-sport">
<h2>MEILLEUR SPORT</h2>
<svg fill="#ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="100%" height="100%" alt="Meilleur sport"></svg>
</div>
</section>

View File

@@ -27,11 +27,21 @@ document.querySelector('.heures .nombre-md').innerHTML = (totals.total.hours).to
if(totals.run.hours > totals.ride.hours && totals.run.hours > totals.swim.hours){
document.querySelector('.top-sport img').src = './images/run-white.svg';
document.querySelector('.top-sport img').alt = 'Course à pieds';
fetch('images/sports/bike.svg')
.then(response => response.text())
.then(text => {
document.querySelector('.top-sport h2').insertAdjacentHTML("beforeend", text)
document.querySelector('.top-sport svg').alt = 'Course à pieds';
})
document.querySelector('.top-sport svg').src = './images/run-white.svg';
document.querySelector('.top-sport svg').alt = 'Course à pieds';
}
if(totals.ride.hours > totals.run.hours && totals.ride.hours > totals.swim.hours){
document.querySelector('.top-sport img').src = './images/bike-white.svg';
document.querySelector('.top-sport img').alt = 'Cyclisme';
fetch('images/sports/bike.svg')
.then(response => response.text())
.then(text => {
document.querySelector('.top-sport h2').insertAdjacentHTML("beforeend", text)
document.querySelector('.top-sport svg').alt = 'Cyclisme';
})
}