fork download
  1.  
Success #stdin #stdout 0.04s 26056KB
stdin
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>I LOVE YOU</title>
  <style>
    body {
      background-color: white;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      font-family: sans-serif;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(65, 15px);
      grid-template-rows: repeat(10, 15px);
      gap: 2px;
    }
    .cell {
      width: 15px;
      height: 15px;
      border: 1px solid #ccc;
      background-color: white;
      transition: background-color 0.3s;
    }
    .on {
      background-color: deeppink;
    }
  </style>
</head>
<body>
  <div class="grid" id="grid"></div>

  <script>
    const grid = document.getElementById('grid');
    const rows = 10;
    const cols = 65;

    const pixelsOn = [
      [1, 0],[2, 0],[3, 0],[4, 0],[5, 0],[6, 0],
      [1, 4],[2, 4],[3, 4],[4, 4],[5, 4],[6, 4],[6, 5],[6, 6],
      [1, 9],[1, 10],[1, 11],[2, 9],[2, 11],[3, 9],[3, 11],
      [4, 9],[4, 11],[5, 9],[5, 11],[6, 9],[6, 10],[6, 11],
      [1, 14],[2, 14],[3, 14],[4, 14],[5, 15],[6, 16],
      [5, 17],[1, 18],[2, 18],[3, 18],[4, 18],
      [1, 21],[2, 21],[3, 21],[4, 21],[5, 21],[6, 21],
      [1, 22],[3, 22],[6, 22],
      [1, 25],[2, 25],[3, 25],[3, 26],[4, 26],[5, 26],[6, 26],
      [1, 29],[1, 30],[1, 31],[2, 29],[2, 31],[3, 29],[3, 31],
      [4, 29],[4, 31],[5, 29],[5, 31],[6, 29],[6, 30],[6, 31],
      [1, 34],[2, 34],[3, 34],[4, 34],[5, 34],[6, 34],
      [1, 36],[2, 36],[3, 36],[4, 36],[5, 36],[6, 36],[6, 35]
    ];

    const cells = [];

    // สร้าง grid
    for (let r = 0; r < rows; r++) {
      for (let c = 0; c < cols; c++) {
        const cell = document.createElement('div');
        cell.classList.add('cell');
        grid.appendChild(cell);
        cells.push(cell);
      }
    }

    // ฟังก์ชันเปิด cell ทีละจุด
    function animatePixels(pixels, delay = 30) {
      pixels.forEach(([r, c], index) => {
        setTimeout(() => {
          const cellIndex = r * cols + c;
          cells[cellIndex].classList.add('on');
        }, index * delay);
      });
    }

    // เริ่ม animation
    animatePixels(pixelsOn);
  </script>
</body>
</html>
stdout
Standard output is empty