Zigzag Wood - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Zigzag Wood</title> <style> body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #8B4513; display: flex; justify-content: center; align-items: center; } canvas { display: block; } </style> </head> <body> <canvas id="canvas"></canvas> <script> const canvas = document.getElementById('canvas'); const ctx = canvas.getContext('2d'); resizeCanvas(); window.addEventListener('resize', resizeCanvas); function resizeCanvas() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; draw(); } function draw() { const width = canvas.width; const height = canvas.height; ctx.fillStyle = '#8B4513'; ctx.fillRect(0, 0, width, height); ctx.strokeStyle = '#A0522D'; ctx.lineWidth = 2; for (let y = 0; y < height; y += 20) { ctx.beginPath(); ctx.moveTo(0, y); for (let x = 0; x < width; x += 20) { const offsetX = (x % 40 === 0) ? 10 : -10; ctx.lineTo(x + offsetX, y); } ctx.stroke(); } } draw(); </script> </body> </html>