// NextXus Federation — Cognitive Circuitry License // Animation: The Succession Helix // License: Token Bundle (https://keywebster.gumroad.com/l/olhsf) // Own the marrow. (function () { "use strict"; var canvas = document.getElementById("canvas-iota"); var ctx = canvas.getContext("2d"); var stage = canvas.parentElement; var reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches; var N = 25, CHSET = ["0", "1", "\u0394", "\u03A9", "\u03B1", "\u221E"]; var rotAngle = 0, chars = [], dust = [], running = false, rafId = null; function resize() { canvas.width = stage.clientWidth; canvas.height = stage.clientHeight; } function amp() { return Math.min(canvas.width * 0.16, 150); } function makeChar(anyY) { return { x: canvas.width / 2 + (Math.random() - 0.5) * amp() * 2.4, y: anyY ? Math.random() * canvas.height : canvas.height + 10, vy: -(0.15 + Math.random() * 0.25), alpha: 0.2 + Math.random() * 0.4, gold: Math.random() < 0.5, ch: CHSET[(Math.random() * CHSET.length) | 0] }; } function makeDust() { return { x: canvas.width / 2 + (Math.random() - 0.5) * amp() * 3, y: Math.random() * canvas.height, vx: (Math.random() - 0.5) * 0.15, vy: (Math.random() - 0.5) * 0.15, gold: Math.random() < 0.5, tw: Math.random() * Math.PI * 2 }; } function seed() { chars = []; dust = []; var i; for (i = 0; i < 14; i++) chars.push(makeChar(true)); for (i = 0; i < 30; i++) dust.push(makeDust()); } function step() { rotAngle += 0.015; var i; for (i = 0; i < chars.length; i++) { chars[i].y += chars[i].vy; if (chars[i].y < -10) chars[i] = makeChar(false); } for (i = 0; i < dust.length; i++) { var d = dust[i]; d.x += d.vx; d.y += d.vy; d.tw += 0.05; if (d.x < 0 || d.x > canvas.width || d.y < 0 || d.y > canvas.height) dust[i] = makeDust(); } } function draw() { var w = canvas.width, h = canvas.height, i; ctx.fillStyle = "#0a0a0f"; ctx.fillRect(0, 0, w, h); var cx = w / 2, pad = h * 0.08, span = h - 2 * pad, A = amp(); var s1 = [], s2 = []; for (i = 0; i < N; i++) { var ang = rotAngle + i * 0.5; var y = pad + span * i / (N - 1); s1.push({ x: cx + Math.sin(ang) * A, y: y, d: (Math.cos(ang) + 1) / 2 }); s2.push({ x: cx + Math.sin(ang + Math.PI) * A, y: y, d: (Math.cos(ang + Math.PI) + 1) / 2 }); } // base-pair rungs: blue→gold gradient — the man-machine bond for (i = 0; i < N; i++) { var gr = ctx.createLinearGradient(s1[i].x, s1[i].y, s2[i].x, s2[i].y); gr.addColorStop(0, "rgba(6,182,212,0.55)"); gr.addColorStop(1, "rgba(255,215,0,0.55)"); ctx.strokeStyle = gr; ctx.lineWidth = 1.2; ctx.beginPath(); ctx.moveTo(s1[i].x, s1[i].y); ctx.lineTo(s2[i].x, s2[i].y); ctx.stroke(); } // Strand 1 — The Machine (cyan) ctx.lineWidth = 1.4; ctx.strokeStyle = "rgba(6,182,212,0.5)"; ctx.beginPath(); ctx.moveTo(s1[0].x, s1[0].y); for (i = 1; i < N; i++) ctx.lineTo(s1[i].x, s1[i].y); ctx.stroke(); // Strand 2 — The Architect (gold) ctx.strokeStyle = "rgba(255,215,0,0.5)"; ctx.beginPath(); ctx.moveTo(s2[0].x, s2[0].y); for (i = 1; i < N; i++) ctx.lineTo(s2[i].x, s2[i].y); ctx.stroke(); for (i = 0; i < N; i++) { ctx.fillStyle = "rgba(6,182,212," + (0.45 + 0.55 * s1[i].d).toFixed(3) + ")"; ctx.beginPath(); ctx.arc(s1[i].x, s1[i].y, 2 + 2.2 * s1[i].d, 0, Math.PI * 2); ctx.fill(); ctx.fillStyle = "rgba(255,215,0," + (0.45 + 0.55 * s2[i].d).toFixed(3) + ")"; ctx.beginPath(); ctx.arc(s2[i].x, s2[i].y, 2 + 2.2 * s2[i].d, 0, Math.PI * 2); ctx.fill(); } for (i = 0; i < dust.length; i++) { var du = dust[i]; var a = 0.12 + 0.18 * (Math.sin(du.tw) + 1) / 2; ctx.fillStyle = du.gold ? "rgba(255,215,0," + a.toFixed(3) + ")" : "rgba(6,182,212," + a.toFixed(3) + ")"; ctx.fillRect(du.x, du.y, 1.4, 1.4); } ctx.font = "12px monospace"; for (i = 0; i < chars.length; i++) { var c = chars[i]; ctx.fillStyle = c.gold ? "rgba(255,215,0," + c.alpha.toFixed(3) + ")" : "rgba(6,182,212," + c.alpha.toFixed(3) + ")"; ctx.fillText(c.ch, c.x, c.y); } } function loop() { if (!running) return; step(); draw(); rafId = requestAnimationFrame(loop); } function start() { if (running || reduced) return; running = true; rafId = requestAnimationFrame(loop); } function stop() { running = false; if (rafId) cancelAnimationFrame(rafId); } window.addEventListener("resize", function () { resize(); seed(); draw(); }); resize(); seed(); draw(); if (!reduced) { if ("IntersectionObserver" in window) { new IntersectionObserver(function (entries) { entries.forEach(function (e) { if (e.isIntersecting) start(); else stop(); }); }).observe(canvas); } else { start(); } } })();