document.addEventListener("DOMContentLoaded", () => { const e = Math.PI, i = Math.PI / 2, w = Math.PI / 12; var t, o, h, n, a, r = document.querySelector("#art-plum-canvas"); const g = Math.random, v = 30, x = 6; let c = !1; const m = () => ({ width: window.innerWidth, height: window.innerHeight }); let p = ([r, t = 400, o = 400, h] = [r, m().width, m().height], n = r.getContext("2d"), k = window.devicePixelRatio || 1, a = n.webkitBackingStorePixelRatio || n.mozBackingStorePixelRatio || n.msBackingStorePixelRatio || n.oBackingStorePixelRatio || n.backingStorePixelRatio || 1, h = h || k / a, r.style.width = t + "px", r.style.height = o + "px", r.width = h * t, r.height = h * o, n.scale(h, h), { ctx: n, dpi: h }).ctx, u = [], d = []; const P = (t, e, i, o = { value: 0 }) => { var h, n, a = g() * x; o.value += 1;[a = 0, s = 0, h, n = 0] = [t, e, a, i]; let [r, c] = [a + h * Math.cos(n), s + h * Math.sin(n)]; p.beginPath(), p.moveTo(t, e), p.lineTo(r, c), p.stroke(); const d = i + g() * w, l = i - g() * w; var s, a = m(); r < -100 || r > a.width + 100 || c < -100 || c > a.height + 100 || (s = o.value <= v ? .8 : .5, g() < s && u.push(() => P(r, c, d, o)), g() < s && u.push(() => P(r, c, l, o))) }; let l = performance.now(); const s = () => .6 * g() + .2; var k = () => { const t = m(); p.clearRect(0, 0, t.width, t.height), p.lineWidth = 1, p.strokeStyle = "rgba(255, 255, 255, 0.05)", d = [], u = [() => P(s() * t.width, -5, i), () => P(s() * t.width, t.height + 5, -i), () => P(-5, s() * t.height, 0), () => P(t.width + 5, s() * t.height, e)], t.width < 500 && (u = u.slice(0, 2)), c = !1 }; window.addEventListener("resize", k), k(), setInterval(() => { performance.now() - l < 25 || (d = u, u = [], l = performance.now(), d.length ? d.forEach(t => { g() < .5 ? u.push(t) : t() }) : c = !0) }, 25) });
