{
  "id": "mui_network_pulse",
  "name": "Network Pulse",
  "width": 1200,
  "height": 720,
  "cornerRadius": 0,
  "fit": "Layout",
  "backgroundColor": "#05080a",
  "opacity": 1,
  "x": -600,
  "y": -360,
  "responsive": {
    "enabled": true,
    "mode": "constraint",
    "width": {
      "type": "fixed"
    },
    "height": {
      "type": "fixed"
    },
    "maintainAspectRatio": false,
    "scaleObjects": false,
    "breakpoints": [
      {
        "id": "bp_mobile",
        "name": "Mobile",
        "minWidth": 0,
        "maxWidth": 599
      },
      {
        "id": "bp_tablet",
        "name": "Tablet",
        "minWidth": 600,
        "maxWidth": 1023
      },
      {
        "id": "bp_desktop",
        "name": "Desktop",
        "minWidth": 1024
      }
    ]
  },
  "layoutProps": {
    "mode": "linear",
    "direction": "vertical",
    "gap": 0,
    "padding": {
      "top": 0,
      "right": 0,
      "bottom": 0,
      "left": 0
    },
    "alignItems": "stretch",
    "layoutSizingHorizontal": "fixed",
    "layoutSizingVertical": "fixed"
  },
  "seo": {
    "title": "Network Pulse — Exode Motion UI",
    "description": "A drifting node network where signals hop from edge to edge. Your cursor joins the network; click to broadcast a shockwave."
  },
  "stateMachine": {
    "inputs": [
      {
        "id": "in_caption",
        "name": "caption",
        "value": {
          "type": "Text",
          "value": "Global edge network",
          "defaultValue": "Global edge network"
        }
      },
      {
        "id": "in_nodes",
        "name": "nodes",
        "value": {
          "type": "Number",
          "value": 46,
          "defaultValue": 46
        }
      },
      {
        "id": "in_reach",
        "name": "reach",
        "value": {
          "type": "Number",
          "value": 1,
          "defaultValue": 1
        }
      },
      {
        "id": "in_speed",
        "name": "speed",
        "value": {
          "type": "Number",
          "value": 1,
          "defaultValue": 1
        }
      },
      {
        "id": "in_accent",
        "name": "accent",
        "value": {
          "type": "Text",
          "value": "#3dd6b5",
          "defaultValue": "#3dd6b5"
        }
      },
      {
        "id": "in_accent2",
        "name": "accent2",
        "value": {
          "type": "Text",
          "value": "#8b7bff",
          "defaultValue": "#8b7bff"
        }
      },
      {
        "id": "in_text",
        "name": "text",
        "value": {
          "type": "Text",
          "value": "#e6f2ee",
          "defaultValue": "#e6f2ee"
        }
      },
      {
        "id": "in_bg",
        "name": "bg",
        "value": {
          "type": "Text",
          "value": "#05080a",
          "defaultValue": "#05080a"
        }
      }
    ],
    "layers": [
      {
        "name": "Base",
        "entryStateId": "s_idle",
        "states": [
          {
            "id": "s_idle",
            "name": "Idle",
            "loop": true,
            "transitions": []
          }
        ]
      }
    ],
    "logicNodes": []
  },
  "animations": [],
  "physics": {
    "enabled": false,
    "gravity": {
      "x": 0,
      "y": 9.8
    }
  },
  "animationFlow": [],
  "navigation": [],
  "stateVariables": [],
  "objects": [
    {
      "id": "stage",
      "name": "Stage",
      "type": "Group",
      "transform": {
        "x": 0,
        "y": 0,
        "rotation": 0,
        "scale_x": 1,
        "scale_y": 1,
        "opacity": 1,
        "skew_x": 0,
        "skew_y": 0
      },
      "width": 1200,
      "height": 720,
      "geometry": {
        "type": "Rectangle",
        "width": 1200,
        "height": 720,
        "cornerRadius": 0
      },
      "cornerRadius": 0,
      "children": [],
      "clipContent": true,
      "style": {
        "fill": {
          "type": "Solid",
          "color": "#05080a",
          "opacity": 1
        },
        "effects": [
          {
            "id": "fx_network-pulse",
            "type": "CustomEffect",
            "name": "Network Pulse",
            "isEnabled": true,
            "params": {},
            "code": "/* Shared by every motion-ui effect (prepended to each one).\n   Rules for this file and the effects: the .bexode compiler minifies effect\n   code, so use explicit semicolons, block comments only, and never write a\n   minus followed by a negative value (it collapses to a decrement). */\n\n/* Read a live state-machine input, falling back to a default. */\nfunction inp(env, name, fallback) {\n  const v = env.inputs ? env.inputs[name] : undefined;\n  if (v === undefined || v === null || v === '') return fallback;\n  if (typeof fallback === 'number') {\n    const n = Number(v);\n    return isFinite(n) ? n : fallback;\n  }\n  if (typeof fallback === 'boolean') return v === true || v === 1 || v === 'true';\n  return v;\n}\n\n/* '#rgb' / '#rrggbb' to [r, g, b]; anything else falls back to white. */\nfunction rgbOf(hex) {\n  let h = String(hex || '').trim().replace('#', '');\n  if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];\n  if (!/^[0-9a-fA-F]{6}$/.test(h)) return [255, 255, 255];\n  const n = parseInt(h, 16);\n  return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n}\n\nfunction rgba(hex, a) {\n  const c = rgbOf(hex);\n  return 'rgba(' + c[0] + ',' + c[1] + ',' + c[2] + ',' + Math.max(0, Math.min(1, a)) + ')';\n}\n\nfunction mix(a, b, t) {\n  const x = rgbOf(a), y = rgbOf(b);\n  const r = Math.round(x[0] + (y[0] - x[0]) * t);\n  const g = Math.round(x[1] + (y[1] - x[1]) * t);\n  const bl = Math.round(x[2] + (y[2] - x[2]) * t);\n  return '#' + ((1 << 24) + (r << 16) + (g << 8) + bl).toString(16).slice(1);\n}\n\n/* A soft round glow, rendered once per colour and blitted with drawImage\n   (much cheaper than shadowBlur on every particle). */\nconst __glows = {};\nfunction glowSprite(hex) {\n  if (__glows[hex]) return __glows[hex];\n  const s = 64;\n  const c = document.createElement('canvas');\n  c.width = s; c.height = s;\n  const g = c.getContext('2d');\n  const gr = g.createRadialGradient(s / 2, s / 2, 0, s / 2, s / 2, s / 2);\n  gr.addColorStop(0, rgba(hex, 1));\n  gr.addColorStop(0.18, rgba(hex, 0.55));\n  gr.addColorStop(0.45, rgba(hex, 0.14));\n  gr.addColorStop(1, rgba(hex, 0));\n  g.fillStyle = gr;\n  g.fillRect(0, 0, s, s);\n  __glows[hex] = c;\n  return c;\n}\n\nfunction glow(ctx, hex, x, y, r, a) {\n  if (r <= 0 || a <= 0) return;\n  ctx.globalAlpha = Math.min(1, a);\n  ctx.drawImage(glowSprite(hex), x - r, y - r, r * 2, r * 2);\n  ctx.globalAlpha = 1;\n}\n\n/* Frame clock: seconds since start and a clamped delta. */\nfunction tick(S) {\n  const now = performance.now();\n  if (!S.t0) { S.t0 = now; S.last = now; }\n  S.dt = Math.min(0.05, Math.max(0.001, (now - S.last) / 1000));\n  S.last = now;\n  S.age = (now - S.t0) / 1000;\n  return S.dt;\n}\n\n/* Deterministic pseudo-random so layouts are stable across resizes. */\nfunction rng(seed) {\n  let s = seed >>> 0 || 1;\n  return function () {\n    s = (s * 1664525 + 1013904223) >>> 0;\n    return s / 4294967296;\n  };\n}\n\nfunction ease(x) { return x < 0.5 ? 4 * x * x * x : 1 + (Math.pow(2 * x - 2, 3)) / 2; }\nfunction clamp(v, a, b) { return v < a ? a : v > b ? b : v; }\n\nconst SANS = 'Inter, Helvetica, Arial, sans-serif';\nconst MONO = 'ui-monospace, Menlo, monospace';\n\nfunction roundRect(ctx, x, y, w, h, r) {\n  r = Math.min(r, w / 2, h / 2);\n  ctx.beginPath();\n  ctx.moveTo(x + r, y);\n  ctx.arcTo(x + w, y, x + w, y + h, r);\n  ctx.arcTo(x + w, y + h, x, y + h, r);\n  ctx.arcTo(x, y + h, x, y, r);\n  ctx.arcTo(x, y, x + w, y, r);\n  ctx.closePath();\n}\n\n/* Shared backdrop: flat colour, soft vignette and fine grain. */\nfunction backdrop(ctx, W, H, bg, tint, amt) {\n  ctx.fillStyle = bg;\n  ctx.fillRect(0, 0, W, H);\n  if (tint && amt > 0) {\n    const gr = ctx.createRadialGradient(W / 2, H * 0.45, 0, W / 2, H * 0.45, Math.max(W, H) * 0.7);\n    gr.addColorStop(0, rgba(tint, 0.10 * amt));\n    gr.addColorStop(1, rgba(tint, 0));\n    ctx.fillStyle = gr;\n    ctx.fillRect(0, 0, W, H);\n  }\n  const vg = ctx.createRadialGradient(W / 2, H / 2, Math.min(W, H) * 0.3, W / 2, H / 2, Math.max(W, H) * 0.8);\n  vg.addColorStop(0, 'rgba(0,0,0,0)');\n  vg.addColorStop(1, 'rgba(0,0,0,0.45)');\n  ctx.fillStyle = vg;\n  ctx.fillRect(0, 0, W, H);\n}\n\n/* Greedy word wrap with the current ctx.font. */\nfunction wrap(ctx, text, maxW) {\n  const out = [];\n  String(text).split('\\n').forEach(function (para) {\n    const words = para.split(' ');\n    let cur = '';\n    for (let i = 0; i < words.length; i++) {\n      const next = cur ? cur + ' ' + words[i] : words[i];\n      if (cur && ctx.measureText(next).width > maxW) { out.push(cur); cur = words[i]; } else cur = next;\n    }\n    out.push(cur);\n  });\n  return out;\n}\n\n/* Largest font size (up to max) at which text wraps into maxLines within maxW. */\nfunction fitFont(ctx, text, weight, family, maxW, maxLines, max, min) {\n  let fs = max;\n  while (fs > min) {\n    ctx.font = weight + ' ' + fs + 'px ' + family;\n    if (wrap(ctx, text, maxW).length <= maxLines) break;\n    fs = fs * 0.92;\n  }\n  ctx.font = weight + ' ' + fs + 'px ' + family;\n  return fs;\n}\n\n/* Smoothed pointer that idles along a slow figure-eight when the cursor is away. */\nfunction follow(S, env, W, H, k) {\n  const pt = env.pointer || {};\n  const t = S.age || 0;\n  const tx = pt.isHovered ? pt.localX : W / 2 + Math.sin(t * 0.37) * W * 0.3;\n  const ty = pt.isHovered ? pt.localY : H / 2 + Math.sin(t * 0.74) * H * 0.22;\n  if (S.px === undefined) { S.px = tx; S.py = ty; }\n  S.px += (tx - S.px) * Math.min(1, S.dt * (k || 6));\n  S.py += (ty - S.py) * Math.min(1, S.dt * (k || 6));\n  S.inside = !!pt.isHovered;\n  return pt;\n}\n\n/* Optional centred headline over a background effect. */\nfunction title(ctx, W, H, text, sub, ink, accent, bg) {\n  if (!text) return;\n  if (bg) {\n    /* Soft scrim so the headline reads over busy motion. */\n    const sc = ctx.createRadialGradient(W / 2, H / 2, 0, W / 2, H / 2, Math.min(W * 0.5, 560));\n    sc.addColorStop(0, rgba(bg, 0.72));\n    sc.addColorStop(1, rgba(bg, 0));\n    ctx.fillStyle = sc;\n    ctx.fillRect(0, 0, W, H);\n  }\n  ctx.textAlign = 'center';\n  ctx.textBaseline = 'alphabetic';\n  const maxW = Math.min(W * 0.86, 900);\n  const fs = fitFont(ctx, text, 600, SANS, maxW, 2, clamp(W * 0.065, 26, 72), 16);\n  const lines = wrap(ctx, text, maxW);\n  const lh = fs * 1.08;\n  const y0 = H / 2 - (lines.length * lh) / 2 + fs * 0.8 - (sub ? fs * 0.35 : 0);\n  ctx.fillStyle = ink;\n  lines.forEach(function (l, i) { ctx.fillText(l, W / 2, y0 + i * lh); });\n  if (sub) {\n    ctx.font = '500 ' + clamp(fs * 0.24, 11, 15) + 'px ' + MONO;\n    ctx.fillStyle = rgba(accent, 0.85);\n    ctx.fillText(String(sub).toUpperCase(), W / 2, y0 + (lines.length - 1) * lh + fs * 0.9);\n  }\n}\n\n/* Network Pulse: a drifting node network where signals hop edge to edge.\n   The cursor joins the network as a live node; click to fire a shockwave.\n   Inputs: nodes, reach, speed, caption, accent, accent2, bg, text. */\nlet S = null;\n\nfunction render(ctx, env) {\n  const W = env.width, H = env.height;\n  if (!S) S = { pulses: [], rings: [], wasDown: false, sent: 0, key: '' };\n  const dt = tick(S);\n  const t = S.age;\n\n  const count = Math.round(clamp(inp(env, 'nodes', 46), 8, 120));\n  const reach = inp(env, 'reach', 1);\n  const speed = inp(env, 'speed', 1);\n  const caption = String(inp(env, 'caption', 'Global edge network'));\n  const A = inp(env, 'accent', '#3dd6b5');\n  const B = inp(env, 'accent2', '#8b7bff');\n  const bg = inp(env, 'bg', '#05080a');\n  const ink = inp(env, 'text', '#e6f2ee');\n\n  /* Layout: jittered grid so nodes cover any aspect ratio evenly. */\n  const key = count + '|' + Math.round(W) + '|' + Math.round(H);\n  if (S.key !== key) {\n    const r = rng(7);\n    const cols = Math.max(2, Math.round(Math.sqrt(count * W / H)));\n    const rows = Math.max(2, Math.ceil(count / cols));\n    S.n = [];\n    for (let i = 0; i < count; i++) {\n      const c = i % cols, rw = Math.floor(i / cols);\n      S.n.push({\n        bx: (c + 0.5 + (r() - 0.5) * 0.8) / cols * W,\n        by: (rw + 0.5 + (r() - 0.5) * 0.8) / rows * H,\n        ph: r() * 6.28, sz: r() < 0.14 ? 2.6 : 1.4, heat: 0,\n      });\n    }\n    S.key = key;\n    S.pulses = [];\n  }\n  const s = Math.min(W, H);\n  const link = (Math.sqrt(W * H / count) * 1.55) * reach;\n  const pt = follow(S, env, W, H, 10);\n\n  ctx.save();\n  ctx.translate(-W / 2, -H / 2);\n  backdrop(ctx, W, H, bg, A, 0.8);\n\n  const N = S.n;\n  for (let i = 0; i < N.length; i++) {\n    const p = N[i];\n    p.x = p.bx + Math.sin(t * 0.3 * speed + p.ph) * s * 0.012;\n    p.y = p.by + Math.cos(t * 0.27 * speed + p.ph * 1.3) * s * 0.012;\n    p.heat *= Math.pow(0.15, dt);\n  }\n\n  /* Edges (and neighbour lists for pulses). */\n  const nb = [];\n  for (let i = 0; i < N.length; i++) nb.push([]);\n  ctx.lineWidth = 1;\n  for (let i = 0; i < N.length; i++) {\n    for (let j = i + 1; j < N.length; j++) {\n      const dx = N[i].x - N[j].x, dy = N[i].y - N[j].y;\n      const d = Math.sqrt(dx * dx + dy * dy);\n      if (d > link) continue;\n      nb[i].push(j); nb[j].push(i);\n      const heat = Math.max(N[i].heat, N[j].heat);\n      const a = (1 - d / link) * 0.16 + heat * 0.35;\n      ctx.strokeStyle = rgba(heat > 0.05 ? A : ink, a);\n      ctx.beginPath();\n      ctx.moveTo(N[i].x, N[i].y);\n      ctx.lineTo(N[j].x, N[j].y);\n      ctx.stroke();\n    }\n  }\n\n  /* The cursor is a node too. */\n  let nearest = -1, nd = 1e9;\n  for (let i = 0; i < N.length; i++) {\n    const dx = N[i].x - S.px, dy = N[i].y - S.py;\n    const d = Math.sqrt(dx * dx + dy * dy);\n    if (d < nd) { nd = d; nearest = i; }\n    if (S.inside && d < link * 1.2) {\n      ctx.strokeStyle = rgba(A, 0.5 * (1 - d / (link * 1.2)));\n      ctx.beginPath();\n      ctx.moveTo(S.px, S.py);\n      ctx.lineTo(N[i].x, N[i].y);\n      ctx.stroke();\n      N[i].heat = Math.max(N[i].heat, 0.5 * (1 - d / (link * 1.2)));\n    }\n  }\n\n  /* Spawn ambient pulses; clicks spawn a ring plus a fan of pulses. */\n  if (S.pulses.length < 14 + count * 0.4 && Math.random() < dt * 4 * speed) {\n    const a = Math.floor(Math.random() * N.length);\n    if (nb[a].length) S.pulses.push({ a: a, b: nb[a][Math.floor(Math.random() * nb[a].length)], u: 0, hops: 2 + Math.floor(Math.random() * 4), c: Math.random() < 0.5 ? A : B });\n  }\n  if (pt.isDown && !S.wasDown && S.inside && nearest >= 0) {\n    S.rings.push({ x: S.px, y: S.py, t: 0 });\n    for (let k = 0; k < nb[nearest].length; k++) S.pulses.push({ a: nearest, b: nb[nearest][k], u: 0, hops: 5, c: A });\n    N[nearest].heat = 1;\n    if (env.emit) env.emit('pulse');\n  }\n  S.wasDown = !!pt.isDown;\n\n  ctx.globalCompositeOperation = 'lighter';\n  for (let k = S.pulses.length - 1; k >= 0; k--) {\n    const q = S.pulses[k];\n    const a = N[q.a], b = N[q.b];\n    if (!a || !b) { S.pulses.splice(k, 1); continue; }\n    q.u += dt * speed * 1.6;\n    if (q.u >= 1) {\n      b.heat = 1;\n      S.sent++;\n      S.pulses.splice(k, 1);\n      if (q.hops > 0 && nb[q.b].length) {\n        const next = nb[q.b][Math.floor(Math.random() * nb[q.b].length)];\n        if (next !== q.a) S.pulses.push({ a: q.b, b: next, u: 0, hops: q.hops - 1, c: q.c });\n      }\n      continue;\n    }\n    const x = a.x + (b.x - a.x) * q.u, y = a.y + (b.y - a.y) * q.u;\n    const tx = a.x + (b.x - a.x) * Math.max(0, q.u - 0.25), ty = a.y + (b.y - a.y) * Math.max(0, q.u - 0.25);\n    const gr = ctx.createLinearGradient(tx, ty, x, y);\n    gr.addColorStop(0, rgba(q.c, 0));\n    gr.addColorStop(1, rgba(q.c, 0.9));\n    ctx.strokeStyle = gr;\n    ctx.lineWidth = 1.6;\n    ctx.beginPath();\n    ctx.moveTo(tx, ty);\n    ctx.lineTo(x, y);\n    ctx.stroke();\n    glow(ctx, q.c, x, y, 10, 0.8);\n  }\n  for (let k = S.rings.length - 1; k >= 0; k--) {\n    const r = S.rings[k];\n    r.t += dt;\n    if (r.t > 1.2) { S.rings.splice(k, 1); continue; }\n    ctx.strokeStyle = rgba(A, 0.6 * (1 - r.t / 1.2));\n    ctx.lineWidth = 1.5;\n    ctx.beginPath();\n    ctx.arc(r.x, r.y, ease(r.t / 1.2) * s * 0.45, 0, Math.PI * 2);\n    ctx.stroke();\n  }\n\n  /* Nodes. */\n  for (let i = 0; i < N.length; i++) {\n    const p = N[i];\n    if (p.heat > 0.05) glow(ctx, A, p.x, p.y, 8 + p.sz * 6 * p.heat, p.heat * 0.8);\n  }\n  ctx.globalCompositeOperation = 'source-over';\n  for (let i = 0; i < N.length; i++) {\n    const p = N[i];\n    ctx.fillStyle = p.heat > 0.1 ? mix(ink, A, p.heat) : rgba(ink, 0.55);\n    ctx.beginPath();\n    ctx.arc(p.x, p.y, p.sz + p.heat * 1.2, 0, Math.PI * 2);\n    ctx.fill();\n    if (p.sz > 2) {\n      ctx.strokeStyle = rgba(A, 0.25 + p.heat * 0.5);\n      ctx.beginPath();\n      ctx.arc(p.x, p.y, p.sz + 4 + Math.sin(t * 2 + p.ph) * 1.2, 0, Math.PI * 2);\n      ctx.stroke();\n    }\n  }\n  if (S.inside) {\n    glow(ctx, A, S.px, S.py, 18, 0.5);\n    ctx.fillStyle = '#ffffff';\n    ctx.beginPath();\n    ctx.arc(S.px, S.py, 2.4, 0, Math.PI * 2);\n    ctx.fill();\n  }\n\n  /* HUD. */\n  const pad = clamp(s * 0.05, 14, 32);\n  const fs = clamp(s * 0.022, 10, 12);\n  ctx.font = '500 ' + fs + 'px ' + MONO;\n  ctx.textBaseline = 'alphabetic';\n  ctx.textAlign = 'left';\n  ctx.fillStyle = A;\n  ctx.beginPath();\n  ctx.arc(pad + 3, pad + fs * 0.65, 3, 0, Math.PI * 2);\n  ctx.globalAlpha = 0.5 + 0.5 * Math.sin(t * 4);\n  ctx.fill();\n  ctx.globalAlpha = 1;\n  ctx.fillStyle = rgba(ink, 0.8);\n  ctx.fillText(caption.toUpperCase(), pad + 14, pad + fs);\n  ctx.fillStyle = rgba(ink, 0.4);\n  ctx.textAlign = 'right';\n  ctx.fillText(N.length + ' NODES · ' + S.sent.toLocaleString('en-US') + ' SIGNALS', W - pad, pad + fs);\n  ctx.textAlign = 'left';\n  ctx.fillText(S.inside ? 'CLICK TO BROADCAST' : 'LIVE', pad, H - pad);\n\n  ctx.restore();\n}\n"
          }
        ]
      },
      "layoutProps": {
        "layoutSizingHorizontal": "fill",
        "layoutSizingVertical": "fill"
      },
      "zIndex": 1,
      "interactions": []
    }
  ]
}
