const swarmSize = 27; const rows = 20 const cols = 50 let swarms = [] function createSwarmGrid(rows, cols, size, cont) { const containerWidth = cols * size; const containerHeight = rows * size; const offsetX = (window.innerWidth - containerWidth) / 2; const offsetY = (window.innerHeight - containerHeight) / 2; for (let row = 0; row < rows; row++) { for (let col = 0; col < cols; col++) { const div = document.createElement('div'); div.classList.add('swarm'); const x = col * size; const y = row * size; div.style.left = `${x}px`; div.style.top = `${y}px`; div.dataset.originalX = x; div.dataset.originalY = y; div.innerHTML = `
`; document.querySelector("body").appendChild(div); swarms.push(div) } } } function handleMouseMove(e) { swarms.forEach((swarm, i) => { const originalX = parseFloat(swarm.dataset.originalX); const originalY = parseFloat(swarm.dataset.originalY); const distance = Math.hypot(e.clientX - originalX, e.clientY - originalY); if (distance < 300) { if (!swarm.dataset.transformed) { if (distance < 200 * Math.random()) { const angle = Math.atan2(e.clientY - originalY, e.clientX - originalX); let moveX = -Math.cos(angle) * Math.random() * 300; let moveY = -Math.sin(angle) * Math.random() * 300; swarm.children[0].style.transform = `translate(${moveX}px, ${moveY}px) rotate(${Math.random() * 90 - 45}deg)`; swarm.dataset.transformed = 'true'; } } } else { if (Math.floor(Math.random() * 15) == 0) { if (swarm.dataset.transformed) { swarm.children[0].style.transform = 'translate(0, 0)'; delete swarm.dataset.transformed; } } } }); } document.querySelector('body').addEventListener('mousemove', handleMouseMove); createSwarmGrid(rows, cols, swarmSize, "body"); $("body").append(` `)
The Key to Your Evolution

A strong community of creator, leaders & wealth builders mastering self and world building.

High LVL Newsletter

This is some text inside of a div block.
19Keys is one of the most influential thought leaders and our time.
high lvl media

Advertise with 19Keys

Reach MIllions monthly with High lve Media get your brand in front of a real audience adn expand your reach ans sales.

Join High Level Club

Gain access to 19keys private community focused on mental evolution , spiritual and financial success. Monthy Consultations to keep you aligned with your goal. High lvl University accces to free master class, e books, bts content etc  

PLATINUM PARTNErS

Explore Sponsorship Opportunities

Find the perfect sponsorship or partnership opportunities with 19Keys and one of his brands or social platforms.