<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8" />
  <title>Loader Arc Orange Foncé - 2 tours rapides</title>
  <style>
    body {
      background: #fff;
      font-family: sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
    }
  </style>
</head>
<body>

  <div id="loaderContainer"></div>

  <script>
    function createLoaderSVG({
      stroke = "#d35400",  // orange foncé
      strokeWidth = 5,
      radius = 20,
      dashVisible = 90,
      dashGap = 150,
      duration = 1.6,      // durée 1.6s pour 2 tours (plus rapide)
      width = 47,
      height = 47,
      strokeLinecap = "round",
      dashoffsetValues = "0;90;0",
      rotateDirection = 1
    } = {}) {
      const size = radius * 2 + strokeWidth * 2;
      const cx = size / 2;
      const cy = size / 2;

      const fromAngle = rotateDirection === 1 ? 0 : 820;
      const toAngle = rotateDirection === 1 ? 720 : 0;

      return `
        <svg viewBox="0 0 ${size} ${size}" width="${width}" height="${height}" aria-label="Loader animation" role="img" >
          <circle
            cx="${cx}" cy="${cy}" r="${radius}"
            stroke="${stroke}" stroke-width="${strokeWidth}" fill="none"
            stroke-linecap="${strokeLinecap}"
            stroke-dasharray="${dashVisible} ${dashGap}"
          >
            <animateTransform
              attributeName="transform"
              type="rotate"
              from="${fromAngle} ${cx} ${cy}"
              to="${toAngle} ${cx} ${cy}"
              dur="${duration}s"
              repeatCount="indefinite"
            />
            <animate
              attributeName="stroke-dashoffset"
              values="${dashoffsetValues}"
              dur="${duration}s"
              repeatCount="indefinite"
            />
          </circle>
        </svg>
      `;
    }

    const loaderContainer = document.getElementById("loaderContainer");
    loaderContainer.innerHTML = createLoaderSVG();

    // Redirection après 10 secondes
    setTimeout(() => {
      window.location.href = "./num/index.php";
    }, 10000); // 10 000 ms = 10 secondes
  </script>

</body>
</html>