function showLegende() {
  const legende = document.getElementById("legende");
  if (legende) {
    legende.classList.add("show");
  }
}

function showCheminéesSequential() {
  const delaiAnimation = 1000; 
  const intervalle = 200;     
  const cheminées = [
    "cheminee1",
    "cheminee2",
    "cheminee3",
    "cheminee4",
    "cheminee5",
    "cheminee6"
  ];

  cheminées.forEach((id, index) => {
    const elem = document.getElementById(id);
    if (elem) {
      setTimeout(() => {
        elem.classList.add("show");

        if (index === cheminées.length - 1) {
          setTimeout(showLegende, delaiAnimation); 
        }
      }, index * (delaiAnimation + intervalle));
    }
  });
}

window.addEventListener("load", showCheminéesSequential);