<!DOCTYPE html>

<html lang="fr">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>L'Adresse - Créateur Visuels IA</title>

  <style>

    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

    

    body {

      font-family: 'Inter', sans-serif;

      background: linear-gradient(135deg, #0a0f14, #11212b);

      color: #ffffff;

      margin: 0;

      padding: 0;

      min-height: 100vh;

    }


    .container {

      max-width: 820px;

      margin: 40px auto;

      padding: 30px;

      background: rgba(255,255,255,0.06);

      border-radius: 24px;

      box-shadow: 0 20px 40px rgba(0,0,0,0.4);

      backdrop-filter: blur(10px);

    }


    header {

      text-align: center;

      margin-bottom: 30px;

    }


    .logo {

      width: 180px;

      margin-bottom: 15px;

    }


    h1 {

      font-size: 28px;

      font-weight: 700;

      color: #ffffff;

      margin: 0;

    }


    .subtitle {

      color: #00d4b8;

      font-size: 18px;

      margin-top: 8px;

    }


    .drop-zone {

      border: 3px dashed #007380;

      border-radius: 20px;

      padding: 70px 30px;

      text-align: center;

      transition: all 0.3s ease;

      background: rgba(0, 115, 128, 0.08);

    }


    .drop-zone:hover {

      background: rgba(0, 115, 128, 0.15);

      border-color: #00d4b8;

    }


    .preview {

      margin-top: 25px;

      max-width: 100%;

      border-radius: 16px;

      box-shadow: 0 10px 25px rgba(0,0,0,0.3);

    }


    select, button {

      width: 100%;

      padding: 16px;

      margin: 15px 0;

      border-radius: 16px;

      font-size: 17px;

      font-weight: 600;

    }


    select {

      background: #1a2a35;

      border: 2px solid #007380;

      color: white;

    }


    button {

      background: #007380;

      color: white;

      border: none;

      cursor: pointer;

      transition: all 0.3s;

    }


    button:hover {

      background: #00d4b8;

      transform: translateY(-3px);

    }


    #result {

      margin-top: 30px;

      padding: 20px;

      background: rgba(0, 211, 184, 0.1);

      border-radius: 16px;

      border: 1px solid #007380;

    }

  </style>

</head>

<body>

  <div class="container">

    <header>

      <img src="logo.png" alt="L'Adresse" class="logo">

      <h1>L'Adresse</h1>

      <p class="subtitle">Visuels & Vidéos IA pour tes réseaux sociaux</p>

    </header>


    <div class="drop-zone" id="dropZone">

      <h2>📤 Envoie ta photo ou vidéo</h2>

      <p>Glisse-dépose ici ou clique pour choisir</p>

      <input type="file" id="fileInput" accept="image/*,video/*" style="display:none;">

      <button onclick="document.getElementById('fileInput').click()" style="background:#ffffff; color:#007380; width:auto; padding:12px 30px; font-size:16px;">

        Choisir un fichier

      </button>

      <p style="font-size:14px; opacity:0.7; margin-top:15px;">

        JPG, PNG, MP4, MOV — Max 50 Mo

      </p>

    </div>


    <div id="previewArea" style="display:none; margin-top:25px;">

      <h3 style="color:#00d4b8;">Aperçu :</h3>

      <img id="imagePreview" class="preview" style="display:none;">

      <video id="videoPreview" class="preview" controls style="display:none; max-height:420px;"></video>

    </div>


    <select id="format">

      <option value="">Choisis le format réseaux sociaux</option>

      <option value="reel">Reel / TikTok (9:16 vertical)</option>

      <option value="story">Story Instagram (9:16)</option>

      <option value="post">Post carré Instagram / Facebook</option>

      <option value="carousel">Carrousel (plusieurs slides)</option>

      <option value="linkedin">Post LinkedIn</option>

    </select>


    <button onclick="genererVisuel()"> Générer mon visuel avec l’IA</button>


    <div id="result" style="display:none;">

      <h3 style="text-align:center; color:#00d4b8;"> Ton visuel est en cours de création...</h3>

      <div id="generatedContent" style="text-align:center;"></div>

    </div>

  </div>


  <script>

    const dropZone = document.getElementById('dropZone');

    const fileInput = document.getElementById('fileInput');

    const previewArea = document.getElementById('previewArea');

    const imagePreview = document.getElementById('imagePreview');

    const videoPreview = document.getElementById('videoPreview');


    dropZone.addEventListener('click', () => fileInput.click());

    fileInput.addEventListener('change', e => handleFile(e.target.files[0]));


    dropZone.addEventListener('dragover', e => { e.preventDefault(); dropZone.style.borderColor = '#00d4b8'; });

    dropZone.addEventListener('dragleave', () => dropZone.style.borderColor = '#007380');

    dropZone.addEventListener('drop', e => {

      e.preventDefault();

      dropZone.style.borderColor = '#007380';

      handleFile(e.dataTransfer.files[0]);

    });


    function handleFile(file) {

      if (!file) return;

      const reader = new FileReader();

      if (file.type.startsWith('image/')) {

        reader.onload = e => {

          imagePreview.src = e.target.result;

          imagePreview.style.display = 'block';

          videoPreview.style.display = 'none';

        };

      } else if (file.type.startsWith('video/')) {

        reader.onload = e => {

          videoPreview.src = e.target.result;

          videoPreview.style.display = 'block';

          imagePreview.style.display = 'none';

        };

      }

      reader.readAsDataURL(file);

      previewArea.style.display = 'block';

    }


    function genererVisuel() {

      const format = document.getElementById('format').value;

      if (!format) {

        alert("Veuillez choisir un format réseaux sociaux !");

        return;

      }

      const result = document.getElementById('result');

      result.style.display = 'block';

      document.getElementById('generatedContent').innerHTML = `

        <p style="font-size:18px; margin:20px 0;">Génération avec IA en cours...</p>

        <p>Dans la version finale, tu recevras ici ton visuel ou vidéo prêt à publier.</p>

        <img src="https://picsum.photos/id/1015/800/1422" style="max-width:100%; border-radius:16px; margin-top:15px;" alt="Exemple">

      `;

    }

  </script>

</body>

</html>