<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <title>La Vie à Mulhouse - Histoire, Webcam en direct, Objets animés et Photos</title>
    <meta name="description" content="Plongez au cœur de Mulhouse avec une webcam en direct, son histoire captivante, un album photo unique et des objets animés comme la roue de Mulhouse en 3D.">
    <meta name="keywords" content="Mulhouse, caméra en direct, webcam Mulhouse, histoire de Mulhouse, roue de Mulhouse, 3D Mulhouse, objets animés, photos anciennes Mulhouse, Alsace, patrimoine, Place de la Réunion">
    <meta name="author" content="La Vie à Mulhouse">
    <meta name="robots" content="index, follow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Open Graph pour les réseaux sociaux -->
    <meta property="og:title" content="La Vie à Mulhouse - Explorez la ville autrement" />
    <meta property="og:description" content="Webcam en direct, objets 3D comme la roue de Mulhouse, photos anciennes, et l'histoire de la ville. Une immersion unique au cœur de Mulhouse." />
    <meta property="og:image" content="https://lavieamulhouse.com/images/Lvam.jpg" />
    <meta property="og:url" content="https://lavieamulhouse.com" />
    <meta property="og:type" content="website" />
    <meta property="og:locale" content="fr_FR" />
    <link rel="icon" href="https://lavieamulhouse.com/images/favicon.png" sizes="32x32" />
    <!-- Font Awesome (pour les icônes) -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet" crossorigin="anonymous" referrerpolicy="no-referrer" />

    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #000000;
            text-align: center;
            color: #000000;
        }

        header {
            width: 100%;
            overflow: hidden;
        }

        #header-image {
            width: 100%;
            height: auto;
            display: block;
            opacity: 0.9;
        }

        .clock-wrapper {
            margin-top: 10px;
            margin-bottom: 10px;
            text-align: center;
            /*background-color: rgba(250, 255, 255, 0.8);/* A supprimer*/
        }
        #canvas-container { /* Animation stl*/
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
        }        h1, h2 {
            text-align: center;
        }

        h1 {
            font-size: 24pt;
            margin-bottom: 10px;
        }

        h2 {
            font-size: 18pt;
            margin-bottom: 20px;
        }

        .content {
            max-width: 980px;
            margin: auto;
            padding: 10px;
            background-color: rgba(250, 255, 255, 0.8);
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
            border-radius: 18px;
        }

        .webcam {
            max-width: 880px;
            margin: auto;
            margin-top: 30px;
            padding: 10px;
            background-color: rgba(0, 0, 0, 0.8);
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
            color: white;
        }

        .description {
            font-size: 14pt;
            text-align: center;
            padding: 0 20px;
        }

        .disclaimer {
            font-size: 10pt;
            text-align: center;
            margin-top: 10px;
        }

        .camera-image {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 20px auto;
            opacity: 0.8;
            border-radius: 18px;
        }

        .full-screen-link {
            margin-top: 10px;
            text-align: center;
        }

        .full-screen-link a {
            text-decoration: none;
            color: #3498db;
            font-weight: bold;
        }

        #prochaineActualisation {
            margin-top: 10px;
            font-size: 14px;
            text-align: center;
        }

        .button {
           display: inline-block;
           padding: 15px;
           background-color: #3498db;
           color: white;
           text-decoration: none;
           border-radius: 5px;
           font-size: 15px;
           width: 200px; /* largeur fixe */
           text-align: center;
           transition: background-color 0.3s ease;
        }
        .button-container {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 10px;
            margin: 20px 0;
        }
        .button-container a {
            display: inline-block;
            padding: 15px;
            background-color: #3498db;
            color: white;
            text-decoration: none;
            border-radius: 8px;
            font-size: 15px;
            min-width: 150px;
            border: 2px solid white;
            box-shadow: 20px 20px 40px rgba(0, 0, 0, 0.9); /* Ombre très grande et diffuse */
            transition: background-color 0.3s ease;
        }
        .button-container a:hover {
          opacity: 1;
              transform: scale(1.15);
              box-shadow: 20px 20px 40px rgba(0, 0, 0, 0.9); /* Ombre très grande et diffuse */
              border: 2px solid white;
              font-size: 20px;
        }

        /* === STYLES DES ONGLETS === */
        .tab-buttons {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .tab-button {
            padding: 12px 24px;
            background-color: #f0f0f0;
            color: #333;
            border: none;
            border-radius: 30px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
            position: relative;
            z-index: 1;
        }

        .tab-button:hover {
            background-color: #e0e0e0;
            transform: translateY(-2px);
        }

        .tab-button.active {
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
            transform: scale(1.05);
        }

        /* Effet subtil sur l'activation (facultatif) */
        .tab-button.active::after {
            content: "";
            position: absolute;
            bottom: -5px;
            left: 50%;
            transform: translateX(-50%);
            width: 60%;
            height: 3px;
            background: linear-gradient(to right, #2980b9, #3498db);
            border-radius: 2px;
            z-index: 2;
        }

        /* Masquer les éléments cachés */
        .hidden {
            display: none !important;
        }

        @media (max-width: 600px) {
            .button-container a {
                flex: 1 1 calc(50% - 10px);
                min-width: unset;
                max-width: calc(50% - 10px);
                box-sizing: border-box;
            }
        }
    </style>
</head>
<body>

<header>
    <img id="header-image" alt="Image du header" />
</header>

<div class="clock-wrapper">
    <style>
  :root {
    --bgcolor: rgb(38, 37, 41);
    --clockheight: 60px; /* Réduit rectangle */
    --radius: 10px; /* Rayon réduit */
    --rotationtime: 0.55s;
    --avobg: rgb(227, 246, 104);
  }

  body {
    color: #fff;
    font-family: "Saira Extra Condensed", sans-serif;
    margin: 0; /* Ajouté pour éviter les marges par défaut */
    padding: 0; /* Ajouté pour éviter les marges par défaut */
  }

  .clock {
    display: grid;
    margin-left: 22px;
    padding: 5px 15px; /*Fond horloge noir */
    grid-template-columns: repeat(3, 3fr);/* nombre de bloque, là nous avons heure minutes seconde */
    grid-column-gap: 10px; /* espace entre les blocs heures minutes */
    height: var(--clockheight);
    background-image: linear-gradient( /* fond couleur de l'horloge */
      rgb(0, 0, 0) 0%,
      rgb(0, 0, 0) 20%,
      rgb(0, 0, 0) 50%,
      rgb(0, 0, 0) 100%
    );
    border-radius: var(--radius);
    box-shadow: inset 0 -3px 6px 3px rgba(0, 0, 0, 0.2), /* effet ombre */
                inset 0 1px 1px 1px rgba(0, 0, 0, 0.4),
                0 1px 1px 1px rgba(255, 255, 255, 0.3),
                0 -2px 4px 4px rgba(56, 56, 61, 0.5);

  }

  .flipper {
    position: relative;
    width: 100%;
    min-width: 60px; /* Réduit */
    height: 100%;
    transform-style: preserve-3d;
    perspective: 1600px;
  }

  .top,
  .bottom {
    box-shadow: 0 6px 6px 1px rgba(0, 0, 0, 0.5),
                0 2px 2px 1px rgba(255, 255, 255, 0.15);
    border-top: none;/*1px solid rgb(102, 103, 110);*/
    border-bottom: none /*1px solid #000;*/
  }

  .top {
    position: relative;
    width: 100%;
    height: calc(50% - 7px); /* Ajusté */
    background-image: linear-gradient(rgb(48, 49, 53) 0%, rgb(56, 57, 62) 100%);
    margin-top: 4px; /* Réduit */
    margin-bottom: -4px; /* Réduit */
    border-top-left-radius: calc(var(--radius) * 0.65);
    border-top-right-radius: calc(var(--radius) * 0.65);
  }

  .bottom {
    position: relative;
    width: 100%;
    height: calc(50% - 7px); /* Ajusté */
    background-image: linear-gradient(rgb(57, 58, 63) 0%, rgb(65, 65, 71) 100%);
    margin-top: 5px; /* Réduit */
    margin-bottom: 3px; /* Réduit */
    border-bottom-left-radius: calc(var(--radius) * 0.65);
    border-bottom-right-radius: calc(var(--radius) * 0.65);
  }

  .text {
    font-size: 42px; /* Réduit */
    display: block;
    position: absolute;
    overflow: hidden;
    width: 100%;
    height: 100%;
    line-height: 50px; /* Ajusté */
    text-align: center;
  }

  .bottom .text {
    line-height: 0;
  }

  .top.new,
  .bottom.new {
    position: absolute;
    left: 0;
    z-index: 12;
  }

  .top.new {
    top: 0;
    z-index: 1;
  }

  .top.new .text {
    backface-visibility: hidden;
  }

  .bottom.new {
    position: absolute;
    top: 0;
    height: calc(100% - 0px);
    transform: rotateX(0.5turn);
    z-index: 1;
    opacity: 0;
  }

  .flipper.flipping .top.new {
    transform-origin: bottom center;
    animation: rotate var(--rotationtime) 1 ease-in-out forwards;
  }

  .flipper.flipping .bottom.new {
    animation: rotatebottom var(--rotationtime) 1 ease-in-out forwards;
  }

  @keyframes rotatebottom {
    0% { opacity: 0; }
    49% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 1; }
  }

  @keyframes rotate {
    0% { transform: rotateX(0) translateY(0px); }
    100% { transform: rotateX(-180deg) translateY(-7px); } /* Ajusté */
  }

  .clock-container {
  display: flex;
  align-items: center;

opacity: 0.9;
  justify-content: center;
  gap: 15px; /* espace entre horloge et date */
  opacity: 0.8;
}

.date-box {
  height: 30px; /* ✅ Ajoute cette ligne pour fixer la hauteur */
  display: flex; /* ✅ Pour centrer verticalement le texte */
  align-items: center;
  justify-content: center;

  color: white;
  font-size: 24px;
  font-family: "Saira Extra Condensed", sans-serif;
  background-color: rgb(44, 44, 52);
  padding: 0 5px; /* padding vertical retiré car height gère ça maintenant */
  border-radius: 10px;
  box-shadow: 0 0 1px rgba(255,255,255,0.2);
}
.date-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.date-week-container {
  display: flex;
  gap: 10px; /* espace horizontal */
  align-items: center;
  justify-content: center;
}

.date-box, .week-box {
  width: 290px;
  height: 60px; /* Ajusté pour correspondre à l'horloge */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px; /* Ajusté pour correspondre à l'horloge */
  font-family: "Saira Extra Condensed", sans-serif;

  /* Fond noir avec gradient (comme l'horloge) */
  background-image: linear-gradient(
    rgb(0, 0, 0) 0%,
    rgb(0, 0, 0) 20%,
    rgb(0, 0, 0) 50%,
    rgb(0, 0, 0) 100%
  );

  /* Bord arrondi (comme l'horloge) */
  border-radius: var(--radius);

  /* Ombres (copiées depuis l'horloge) */
  box-shadow:
    inset 0 -3px 6px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px 1px rgba(0, 0, 0, 0.4),
    0 1px 1px 1px rgba(255, 255, 255, 0.3),
    0 -2px 4px 4px rgba(56, 56, 61, 0.5);
}


@media (max-width: 768px), (max-height: 500px) {
  .date-week-container {
    /*display: none !important;*/
  }
  .date-box {
    display: none !important;
  }
  .week-box {
    display: none !important;
  }
  .clock {
    margin-left: 0;
  }
}



.date-week-container {
 display: flex;
 gap: 10px; /* espace horizontal */
 align-items: center; /* Aligner verticalement les éléments */
 justify-content: center; /* Centrer horizontalement le contenu */
}

.week-with-image {
 display: flex;
 align-items: center; /* Assure l'alignement vertical au centre */
 gap: 10px;
}

.lvam-logo {
 height: 80px; /* Ou la hauteur que tu préfères */
 vertical-align: middle; /* Essayer d'aligner verticalement au milieu de la ligne */
}
</style>
  <div class="clock-container">
    <div class="clock">
      <!-- horloge existante (inchangée) -->
      <div class="flipper">
        <div class="top"><div class="text">00</div></div>
        <div class="bottom"><div class="text">00</div></div>
      </div>
      <div class="flipper">
        <div class="top"><div class="text">00</div></div>
        <div class="bottom"><div class="text">00</div></div>
      </div>
      <div class="flipper">
        <div class="top"><div class="text">00</div></div>
        <div class="bottom"><div class="text">00</div></div>
      </div>
    </div>

    <!-- Groupe date + semaine sur la même ligne -->
    <div class="date-week-container">
      <div class="date-box" id="dateBox"></div>
      <div class="week-with-image">
       <div class="week-box" id="weekBox"></div>
       <img src="https://www.lavieamulhouse.com/Accueil/images/Lvam.png" alt="Lvam" class="lvam-logo">
      </div>
     </div>


  <script>
    function updateDate() {
      const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
      const today = new Date();
      document.getElementById('dateBox').textContent = today.toLocaleDateString('fr-FR', options);

      // Calcul semaine
      const firstDayOfYear = new Date(today.getFullYear(), 0, 1);
      const pastDaysOfYear = (today - firstDayOfYear) / 86400000;
      const weekNumber = Math.ceil((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
      document.getElementById('weekBox').textContent = "Semaine " + weekNumber;
    }

    updateDate();
    setInterval(updateDate, 60000);
  </script>
</body>



  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js'></script>
  <script src="./script.js"></script>
</div>
<div id="canvas-container"></div>
<div class="content" id="content">
    <!-- ONGLETS -->
    <div class="tab-buttons">
        <button class="tab-button active" data-category="all">Tous</button>
        <button class="tab-button" data-category="Ville">Ville</button>
        <button class="tab-button" data-category="Extérieur">La vie à Mulhouse</button>
        <button class="tab-button" data-category="Divers">Divers</button>
    </div>

    <!-- CONTENEUR DES BOUTONS -->
    <div class="button-container" id="button-container">
        <!-- Les boutons seront insérés ici dynamiquement -->
    </div>
</div>

<!-- SECTION WEBCAM -->
<div class="webcam">
    <hr>
    <h1><strong>Mulhouse caméra touristique</strong></h1>
    <h2>La Ville de Mulhouse vous propose de voir la ville en direct depuis la Place de la Réunion via une <strong>caméra touristique</strong>.</h2>
    <p class="description">
        Découvrez le centre historique avec le Temple Saint-Étienne et l'Hôtel de Ville. Source :
        <a href="https://www.mulhouse.fr/webcam/" target="_blank" rel="noopener noreferrer">www.mulhouse.fr/webcam</a>
    </p>
    <p class="disclaimer">
        (<em>Images appartenant à la Ville de Mulhouse, non utilisables à des fins commerciales sans autorisation.</em>)
    </p>
    <p>
        <img id="imageActualisee" class="camera-image" src="proxy.php" alt="Caméra en direct de la Place de la Réunion à Mulhouse" />
    </p>
    <p id="prochaineActualisation"></p>
    <div class="full-screen-link">
        Plein écran :
        <a href="https://api.skaping.com/media/getLatest?format=jpg&amp;api_key=dcBSI-EWe4T-dEduK-EfbOt&amp;quality=large" target="_blank" rel="noopener noreferrer">Cliquez ici</a>
    </div>
    <hr>
    <div style="text-align: left; margin-top: 30px; font-size: 15px; line-height: 1.6;">
        <p class="full-screen-link">
            * le dispositif en place est une caméra touristique et non une webcam. La caméra touristique à la différence d’une webcam ne permet pas de reconnaître des personnes (fonction zoom inexistante), et pas de possibilité de revenir sur les enregistrements. La résolution d’image a été conçue de façon à assurer une belle visibilité de la Place de la Réunion sans donner la possibilité à l’internaute d’identifier les personnes.
            <a href="https://www.skaping.com/mulhouse/reunion" target="_blank" rel="noopener noreferrer">www.skaping.com</a>
        </p>
    </div>
    <hr>
</div>

<script>
    // Charger les données JSON
    fetch('get_config.php')
        .then(response => response.json())
        .then(data => {
            if (data.error && data.redirect) {
                alert(data.message || 'Erreur de configuration.');
                window.location.href = data.redirect;
                return;
            }
            if (data.configAdmin && data.configAdmin.max_width) {
                const content = document.getElementById('content');
                if (content) {
                    content.style.maxWidth = data.configAdmin.max_width;
                }
            }
            const buttons = data.buttons || [];
            const buttonContainer = document.getElementById('button-container');

            buttons.forEach(button => {
                const a = document.createElement('a');
                a.href = button.url;
                a.target = "_blank";
                a.className = "button";
                a.style.backgroundColor = button.color;
                a.style.color = button.text_color;
                a.title = button.text;

                if (button.icon) {
                    if (button.icon === 'mulhouse') {
                        const span = document.createElement('span');
                        span.style.display = 'inline-block';
                        span.style.width = '0.5em';
                        span.style.height = '0.5em';
                        span.style.marginRight = '18px';
                        span.style.verticalAlign = '-4px';
                        span.style.fill = 'currentColor';
                        span.innerHTML = `
                            <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
                                width="15.000000pt" height="15.000000pt" viewBox="0 0 40.000000 40.000000"
                                preserveAspectRatio="xMidYMid meet">
                                <g transform="translate(0.000000,40.000000) scale(0.100000,-0.100000)"
                                    fill="currentColor" stroke="none">
                                    <path d="M170 375 c15 -18 15 -17 -27 -39 -41 -21 -43 -20 -43 6 0 21 -1 20
                                    -31 -8 -29 -27 -29 -29 -10 -32 25 -4 25 -5 5 -45 -22 -42 -21 -42 -39 -27
                                    -13 11 -15 7 -15 -30 0 -37 2 -41 15 -30 18 15 17 15 39 -27 21 -41 20 -43 -6
                                    -43 -21 0 -20 -1 8 -31 27 -29 29 -29 32 -10 4 25 5 25 45 5 42 -22 42 -21 27
                                    -39 -11 -13 -7 -15 30 -15 37 0 41 2 30 15 -15 18 -15 17 27 39 40 20 41 20
                                    45 -5 3 -19 5 -19 32 10 28 30 29 31 8 31 -26 0 -27 2 -6 43 22 42 21 42 39
                                    27 13 -11 15 -7 15 30 0 37 -2 41 -15 30 -18 -15 -17 -15 -39 27 -21 41 -20
                                    43 6 43 21 0 20 1 -8 31 -27 29 -29 29 -32 10 -4 -25 -5 -25 -45 -5 -42 22
                                    -42 21 -27 39 11 13 7 15 -30 15 -37 0 -41 -2 -30 -15z m14 -92 c0 -17 -8 -39
                                    -18 -49 -18 -17 -74 -26 -82 -12 -9 14 26 68 54 82 36 20 46 16 46 -21z m76
                                    22 c29 -15 65 -68 56 -83 -8 -14 -64 -5 -82 12 -14 15 -21 49 -15 81 2 8 10 6
                                    41 -10z m-40 -105 c0 -13 -7 -20 -20 -20 -13 0 -20 7 -20 20 0 13 7 20 20 20
                                    13 0 20 -7 20 -20z m-54 -34 c17 -18 25 -74 12 -82 -4 -3 -21 2 -38 11 -29 15
                                    -65 68 -56 83 8 13 64 5 82 -12z m150 12 c3 -4 -2 -20 -10 -37 -16 -30 -69
                                    -66 -84 -57 -13 8 -6 62 11 81 16 19 69 26 83 13z"/>
                                </g>
                            </svg>
                        `;
                        a.insertBefore(span, a.firstChild);
                    } else {
                        const icon = document.createElement('i');
                        icon.className = `fas ${button.icon}`;
                        icon.style.marginRight = '5px';
                        a.appendChild(icon);
                    }
                }

                a.appendChild(document.createTextNode(button.text));
                a.dataset.category = button.category || 'Divers';

                buttonContainer.appendChild(a);
            });

            // Mise à jour de l'image du header
            if (data.configAdmin && data.configAdmin.fond_header) {
                const headerImg = document.getElementById('header-image');
                headerImg.src = data.configAdmin.fond_header;
            }

            // Gestion des onglets
            const tabs = document.querySelectorAll('.tab-button');
            const buttonsList = document.querySelectorAll('.button-container a');

            tabs.forEach(tab => {
                tab.addEventListener('click', () => {
                    const category = tab.dataset.category;

                    tabs.forEach(t => t.classList.remove('active'));
                    tab.classList.add('active');

                    buttonsList.forEach(btn => {
                        btn.classList.add('hidden');
                        if (category === 'all' || btn.dataset.category === category) {
                            btn.classList.remove('hidden');
                        }
                    });
                });
            });
        })
        .catch(error => {
            console.error('Erreur lors du chargement des boutons:', error);
            alert('Une erreur est survenue.');
        });
</script>

<script>
    function actualiserImage() {
        var image = document.getElementById('imageActualisee');
        var cheminImage = "//api.skaping.com/media/getLatest?format=jpg&api_key=dcBSI-EWe4T-dEduK-EfbOt&quality=large";
        image.src = cheminImage + '&t=' + new Date().getTime();
        var maintenant = new Date();
        var minutes = maintenant.getMinutes();
        var prochaineMinute = 5;
        if (minutes >= 35) {
            prochaineMinute = 5;
            maintenant.setHours(maintenant.getHours() + 1);
        } else if (minutes >= 4 && minutes < 35) {
            prochaineMinute = 35;
        }
        maintenant.setMinutes(prochaineMinute);
        maintenant.setSeconds(0);

        var tempsProchaineActualisation = maintenant.getTime() - new Date().getTime();
        setTimeout(actualiserImage, tempsProchaineActualisation);
        var heureProchaine = maintenant.getHours();
        var minuteProchaine = maintenant.getMinutes();
        document.getElementById('prochaineActualisation').innerHTML = "Prochaine actualisation à : " + heureProchaine + ":" + (minuteProchaine < 10 ? "0" + minuteProchaine : minuteProchaine);
    }

    actualiserImage();
    setTimeout(actualiserImage, 1800000);
</script>





















<script src="../AccueilScript/build/three.js"></script>
<script src="../AccueilScript/js/libs/stats.min.js"></script>

<!-- Charger le STLLoader -->
<script src="../AccueilScript/js/loaders/STLLoader.js"></script>

<script>
    var container, stats;
    var camera, scene, renderer;
    var group;
    var mouseX = 0, mouseY = 0;
    var windowHalfX = window.innerWidth / 2;
    var windowHalfY = window.innerHeight / 2;

    init();
    animate();

    function init() {
        // Utiliser le conteneur div pour l'animation
        container = document.getElementById('canvas-container');

        // Créer une caméra perspective
        camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
        camera.position.z = 1000; // Ajustez cette valeur pour un zoom plus grand

        // Créer une scène avec fond noir
        scene = new THREE.Scene();
        scene.background = new THREE.Color( 0x000000 ); // Fond noir

        // Créer un groupe pour les objets
        group = new THREE.Group();
        scene.add( group );

        // Initialiser le renderer WebGL
        renderer = new THREE.WebGLRenderer();
        renderer.setPixelRatio( window.devicePixelRatio );
        renderer.setSize( window.innerWidth, window.innerHeight );
        container.appendChild( renderer.domElement );

        // Ajouter des éclairages multicolores
        var light1 = new THREE.DirectionalLight( 0xffffff, 1 ); // Lumière blanche
        light1.position.set( 1, 1, 1 ).normalize();
        scene.add( light1 );

        var light2 = new THREE.DirectionalLight( 0xffffff, 1 ); // Lumière blanche
        light2.position.set( -1, 1, -1 ).normalize();
        scene.add( light2 );

        var light3 = new THREE.DirectionalLight( 0xffffff, 1 ); // Lumière blanche
        light3.position.set( 1, -1, -1 ).normalize();
        scene.add( light3 );

        var ambientLight = new THREE.AmbientLight( 0x808080, 0.5 ); // Lumière ambiante grisâtre
        scene.add( ambientLight );

        // Palette de couleurs rouges
        var redColors = [
            0xff0000, 0xcc0000, 0x990000, 0x660000, 0x330000,
            0xff3333, 0xff6666, 0xff9999, 0xffcccc, 0xff6666
        ];

        // Charger le fichier STL et multiplier les objets
        var loader = new THREE.STLLoader();
        loader.load( '../STL/Roue.stl', function ( geometry ) {

            // Ajouter plusieurs objets STL dans la scène avec des couleurs variées
            for ( var i = 0; i < 150; i++ ) {

                // Choisir une couleur aléatoire dans la palette
                var randomColor = redColors[Math.floor(Math.random() * redColors.length)];

                // Matériau pour l'objet STL avec une couleur rouge aléatoire
                var material = new THREE.MeshPhongMaterial({ color: randomColor });

                // Créer un mesh pour chaque objet STL
                var mesh = new THREE.Mesh( geometry, material );

                // Positionner les objets de manière aléatoire
                mesh.position.x = Math.random() * 2000 - 1000;
                mesh.position.y = Math.random() * 2000 - 1000;
                mesh.position.z = Math.random() * 2000 - 1000;
                mesh.rotation.x = Math.random() * 2 * Math.PI;
                mesh.rotation.y = Math.random() * 2 * Math.PI;
                mesh.rotation.z = Math.random() * 2 * Math.PI;

                // Ajouter l'objet à la scène
                group.add( mesh );
            }
        });

        // Gérer la redimensionnement de la fenêtre
        window.addEventListener( 'resize', onWindowResize, false );
    }

    function onWindowResize() {
        windowHalfX = window.innerWidth / 2;
        windowHalfY = window.innerHeight / 2;

        camera.aspect = window.innerWidth / window.innerHeight;
        camera.updateProjectionMatrix();

        renderer.setSize( window.innerWidth, window.innerHeight );
    }

    function animate() {
        requestAnimationFrame( animate );
        render();
    }

    function render() {
        camera.lookAt( scene.position );

        var currentSeconds = Date.now();
        group.rotation.x = Math.sin( currentSeconds * 0.0007 ) * 0.5;
        group.rotation.y = Math.sin( currentSeconds * 0.0003 ) * 0.5;
        group.rotation.z = Math.sin( currentSeconds * 0.0002 ) * 0.5;

        renderer.render( scene, camera );
    }
</script>

  <div class="child">
<a href="readme.html" target="_blank" rel="noopener noreferrer">Politique de confidentialité </a>
</div>
</body>
</html>
