/* The small mesh inside the "It learns" core on section 2. Same idea as the section cores, drawn once and left to the CSS to animate. */ (function () { var g = document.querySelector('[data-teachmesh]'); if (!g) return; var NS = 'http://www.w3.org/2000/svg'; var N = 14, pts = []; for (var i = 0; i < N; i++) { var a = (i / N) * Math.PI * 2; var r = 30 + (i % 3) * 15; pts.push({ x: 80 + Math.cos(a) * r, y: 80 + Math.sin(a) * r }); } // wire each to the one three along, which reads as a mesh rather than a ring pts.forEach(function (p, i) { var q = pts[(i + 3) % N]; var l = document.createElementNS(NS, 'line'); l.setAttribute('x1', p.x.toFixed(1)); l.setAttribute('y1', p.y.toFixed(1)); l.setAttribute('x2', q.x.toFixed(1)); l.setAttribute('y2', q.y.toFixed(1)); l.setAttribute('opacity', '0.4'); g.appendChild(l); }); pts.forEach(function (p, i) { var c = document.createElementNS(NS, 'circle'); c.setAttribute('cx', p.x.toFixed(1)); c.setAttribute('cy', p.y.toFixed(1)); c.setAttribute('r', i % 3 === 0 ? '2.6' : '1.4'); c.setAttribute('opacity', i % 3 === 0 ? '0.95' : '0.5'); g.appendChild(c); }); })();