mirror of
https://github.com/allan-cff/strava-free-year-in-sport.git
synced 2026-01-18 16:47:35 +01:00
recap new svg
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user