Skip to content

Contact Us

Outdoor Supply Pro
201 Alston Blvd, Suite C, #550, Hampstead, NC 28443
855-964-4205
help@outdoorsupplypro.com
Business Hours Mon-Fri 9am EST-5pm EST
script> document.addEventListener('DOMContentLoaded', function () { const canvas = document.getElementById('snowCanvas'); const ctx = canvas.getContext('2d'); // Resize canvas to match window size function resizeCanvas() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; } resizeCanvas(); window.addEventListener('resize', resizeCanvas); // Create snowflake properties const numFlakes = 100; const flakes = []; for (let i = 0; i < numFlakes; i++) { flakes.push({ x: Math.random() * canvas.width, // X position y: Math.random() * canvas.height, // Y position radius: Math.random() * 3 + 1, // Size of the snowflake speed: Math.random() * 1 + 0.5, // Falling speed drift: Math.random() * 2 - 1 // Drift left/right }); } // Animate the snowflakes function drawSnow() { ctx.clearRect(0, 0, canvas.width, canvas.height); flakes.forEach(flake => { ctx.beginPath(); ctx.arc(flake.x, flake.y, flake.radius, 0, Math.PI * 2); ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'; ctx.fill(); // Update snowflake position flake.y += flake.speed; flake.x += flake.drift; // Reset position if it falls out of view if (flake.y > canvas.height) { flake.y = 0; flake.x = Math.random() * canvas.width; } if (flake.x > canvas.width || flake.x < 0) { flake.x = Math.random() * canvas.width; } }); requestAnimationFrame(drawSnow); } drawSnow(); });