Commit 963ee79e authored by Julien Ait azzouzene's avatar Julien Ait azzouzene
Browse files

🐛 fix: correction d'une erreur qui empêchait les

arrière-plans de s'afficher sur GithubPages
parent a6d504c0
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -4,9 +4,13 @@ let fond = document.getElementById("fond")

function actualiserArrierePlan(weatherCard){
    let typetemps = weatherCard.determineWeather()//methode Victor

    // Pour tester l'affichage d'un certain thème:
    //let typetemps = "orage";

    console.log(typetemps);
    if(typetemps == 'soleil'){
        fond.style.background = 'url("../image/theme_clair.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_clair.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("soleil").style.display = "block"
@@ -19,7 +23,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'neige'){
        fond.style.background = 'url("../image/theme_neigeux.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_neigeux.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover' 
        titre.classList.add('sombre')
        document.getElementById("neige").style.display = "block"
@@ -32,7 +36,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'nuage'){
        fond.style.background = 'url("../image/theme_nuageux.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_nuageux.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("nuage").style.display = "block"
@@ -45,7 +49,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'pluie'){
        fond.style.background = 'url("../image/theme_pluie.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_pluie.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("pluie").style.display = "block"
@@ -58,7 +62,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'vent'){
        fond.style.background = 'url("../image/theme_vent.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_vent.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("vent").style.display = "block"
@@ -71,7 +75,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'brume'){
        fond.style.background = 'url("../image/theme_brume.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_brumeux.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("brume").style.display = "block"
@@ -84,7 +88,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("grele").style.display = "none"
    }
    else if(typetemps == 'grele'){
        fond.style.background = 'url("../image/theme_grele.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_grele.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("grele").style.display = "block"
@@ -97,7 +101,7 @@ function actualiserArrierePlan(weatherCard){
        document.getElementById("pluie").style.display = "none"
    }
    else if(typetemps == 'orage'){
        fond.style.background = 'url("../image/theme_orageux.jpg") no-repeat fixed'
        fond.style.background = 'url("./image/theme_orageux.jpg") no-repeat fixed'
        fond.style.backgroundSize = 'cover'
        titre.classList.add('sombre')
        document.getElementById("orage").style.display = "block"
+3 −3
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ const labelEnsoleillement = document.getElementById("WCEnsoleillement"); // Nomb

let villes_insee = new Map();

// Forcer l'actualisation (pour tester un arrière plan par exemple)
//actualiserArrierePlan(null);

function onRechercher(){
    let codePostalS = barreRechercheCodePostal.value;

@@ -86,9 +89,6 @@ function onSelectionneVille(){
function afficherMeteo(weatherCard){
    labelVille.textContent = weatherCard.Ville();
    
    //TODO remplir cette ligne
    //labelBref.textContent = "ensoleillé";
    
    labelTemperatureMin.textContent = `${weatherCard.TempMin()} °C`;
    labelTemperatureMax.textContent = `${weatherCard.TempMax()} °C`;