{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"reversible-sequin-portrait-panel-that-flips-to-gold-foil-where-the-pointer-brushes","type":"registry:block","title":"Reversible Sequin Portrait Panel That Flips to Gold Foil Where the Pointer Brushes","description":"Cursor effect in WebGL: a panel of flip sequins printed with a portrait, where each disc you brush swings over to its gold back. Free React and HTML code.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/reversible-sequin-portrait-panel-that-flips-to-gold-foil-where-the-pointer-brushes.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport type { PointerEvent as ReactPointerEvent } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n// The picture printed across the fronts of the sequins.\nconst portrait = {\n  name: \"Ultramarine\",\n  src: \"https://images.pexels.com/photos/28969185/pexels-photo-28969185.jpeg?auto=compress&cs=tinysrgb&w=900\",\n  alt: \"A person with short bleached hair looking upward, one hand in their hair, lit pink against a bright blue backdrop\",\n};\n/** The colour of the backs, as red, green and blue from 0 to 1. */\nconst FOIL = { name: \"Gold\", rgb: [0.86, 0.61, 0.2] };\n\n/** Sequins across the panel. Fewer makes each disc larger. */\nconst COLS = 30;\n/** Row spacing as a share of the column spacing. Below 1 the rows overlap like scales. */\nconst ROW = 0.8;\n/** Brush width in sequins: the pointer, and the hand that strokes the cloth when nobody is touching it. */\nconst BRUSH = 2.3;\nconst DEMO_BRUSH = 2.9;\n\nconst VERT = `attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }`;\n\nconst FRAG = `precision highp float;\nuniform vec2 u_res;\nuniform vec2 u_grid;\nuniform vec2 u_span;\nuniform vec2 u_shift;\nuniform float u_pitch;\nuniform float u_rp;\nuniform sampler2D u_a;\nuniform vec3 u_foil;\nuniform sampler2D u_state;\nuniform float u_img;\nuniform vec3 u_light;\nconst float R = 0.66;\nconst float OFF = 0.28;\n\nfloat hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvec2 cover(vec2 uv, float img){\n  float A = u_span.x / u_span.y;\n  vec2 t = uv;\n  if (img > A) t.x = (uv.x - 0.5) * A / img + 0.5;\n  else t.y = (uv.y - 0.5) * img / A + 0.5;\n  return clamp(t, 0.0, 1.0);\n}\n\nvoid main(){\n  vec2 px = vec2(gl_FragCoord.x, u_res.y - gl_FragCoord.y);\n  vec2 q = px / u_pitch - u_shift;\n  float r0 = floor((q.y - 0.7) / u_rp + 0.5);\n  float best = -1.0e5;\n  vec4 outc = vec4(0.0);\n  // The net the sequins are sewn to, seen in the gaps while one is on edge.\n  vec2 inner = step(vec2(0.55, 0.7), q) * step(q, u_span - u_shift * 2.0 - vec2(0.6, 0.7));\n  outc = vec4(vec3(0.07, 0.06, 0.07), 1.0) * inner.x * inner.y;\n  float aa = 1.6 / (u_pitch * R);\n  vec3 L = normalize(u_light);\n  vec3 Hh = normalize(L + vec3(0.0, 0.0, 1.0));\n\n  for (int j = -2; j <= 2; j++){\n    float r = r0 + float(j);\n    if (r < 0.0 || r >= u_grid.y) continue;\n    float odd = mod(r, 2.0);\n    float c0 = floor(q.x - 0.6 - 0.5 * odd + 0.5);\n    for (int i = -1; i <= 1; i++){\n      float c = c0 + float(i);\n      if (c < 0.0 || c >= u_grid.x) continue;\n      float f = texture2D(u_state, (vec2(c, r) + 0.5) / u_grid).r;\n      float ang = f * 3.14159265;\n      float ca = cos(ang);\n      float sa = sin(ang);\n      vec2 hinge = vec2(c + 0.5 * odd + 0.6, r * u_rp + 0.7);\n      vec2 cen = hinge + vec2(0.0, OFF * ca);\n      float ry = R * max(abs(ca), 0.07);\n      vec2 l = (q - cen) / vec2(R, ry);\n      float d = length(l);\n      if (d > 1.0) continue;\n      // Hanging down, a row lies over the row beneath it. Flipped up it is the other way round. One on edge stands proud of both.\n      float z = mix(-r, r, f) + 5.0 * sa;\n      if (z < best) continue;\n      best = z;\n\n      float front = step(0.0, ca);\n      float sgn = front * 2.0 - 1.0;\n      float id = hash(vec2(c, r));\n      float id2 = hash(vec2(r + 7.3, c + 1.7));\n      vec2 uvp = (mix(q, cen, 0.45) + u_shift) / u_span;\n      vec3 foil = u_foil * (0.74 + 0.42 * id2) + vec3(0.07, -0.01, -0.05) * (id - 0.5);\n      vec3 base = mix(foil, texture2D(u_a, cover(uvp, u_img)).rgb, front);\n      // A sequin is a flat disc of foil, barely dished, sewn on at its own small angle. So each one lights up whole, at a different moment from its neighbours.\n      vec2 tilt = (vec2(id, id2) - 0.5) * 0.84;\n      vec3 n = normalize(vec3(l.x * 0.07 + tilt.x, l.y * 0.07 * sgn + tilt.y - sa * 1.5, 1.0));\n      float dif = max(dot(n, L), 0.0);\n      float facing = max(dot(n, Hh), 0.0);\n      float away = l.y * sgn;\n      // The row lying over this one shades the half nearest the stitch.\n      float ao = mix(0.5, 1.0, smoothstep(-0.95, -0.05, away));\n      float metal = mix(1.0, 0.72, front);\n      vec3 col = base * (0.50 + 0.62 * dif) * ao;\n      col += base * pow(facing, 14.0) * 0.55 * metal * ao;\n      col += mix(vec3(1.0), base, 0.35) * pow(facing, 90.0) * 0.95 * metal;\n      // The stamped edge is a hair proud: lit on the side facing the lamp, dark on the other.\n      float rim = smoothstep(0.84, 0.96, d);\n      col *= 1.0 + 0.42 * rim * dot(normalize(l + 0.0001), normalize(L.xy));\n      // The sewing hole.\n      float hd = length(q - hinge);\n      col = mix(col, vec3(0.05, 0.04, 0.05), (1.0 - smoothstep(0.035, 0.07, hd)) * 0.8);\n      float edge = 1.0 - smoothstep(1.0 - aa, 1.0, d);\n      outc = mix(outc, vec4(col, 1.0), edge);\n    }\n  }\n  gl_FragColor = vec4(outc.rgb * outc.a, outc.a);\n}`;\n\n/** A small repeatable random source, so the idle strokes are the same on every load. */\nfunction seeded(seed: number) {\n  let s = seed;\n  return () => {\n    s = (s * 1664525 + 1013904223) % 4294967296;\n    return s / 4294967296;\n  };\n}\n\nexport default function ReversibleSequinPortraitPanelThatFlipsToGoldFoilWhereThePointerBrushes() {\n  const reduce = useReducedMotion();\n  const panel = useRef<HTMLDivElement>(null);\n  const canvas = useRef<HTMLCanvasElement>(null);\n  const first = useRef<HTMLImageElement>(null);\n  /** The pointer in panel fractions, the face the current stroke lays down, and when it last moved. */\n  const hand = useRef({ x: 0.5, y: 0.5, px: 0.5, py: 0.5, side: 1, at: -1e6, fresh: true, moved: false });\n  const sweep = useRef<{ side: number; at: number } | null>(null);\n  const [live, setLive] = useState(false);\n  const [top, setTop] = useState(0);\n\n  useEffect(() => {\n    const el = panel.current;\n    const cv = canvas.current;\n    const one = first.current;\n    if (!el || !cv || !one) return;\n    const gl = cv.getContext(\"webgl\", { antialias: false, alpha: true, premultipliedAlpha: true });\n    if (!gl) return;\n\n    const compile = (type: number, source: string) => {\n      const shader = gl.createShader(type)!;\n      gl.shaderSource(shader, source);\n      gl.compileShader(shader);\n      return shader;\n    };\n    const program = gl.createProgram()!;\n    gl.attachShader(program, compile(gl.VERTEX_SHADER, VERT));\n    gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAG));\n    gl.linkProgram(program);\n    if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return;\n    gl.useProgram(program);\n    gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());\n    gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n    const at = gl.getAttribLocation(program, \"a\");\n    gl.enableVertexAttribArray(at);\n    gl.vertexAttribPointer(at, 2, gl.FLOAT, false, 0, 0);\n    const u = (name: string) => gl.getUniformLocation(program, name);\n    gl.uniform1i(u(\"u_a\"), 0);\n    gl.uniform1i(u(\"u_state\"), 1);\n    gl.uniform3f(u(\"u_foil\"), FOIL.rgb[0], FOIL.rgb[1], FOIL.rgb[2]);\n    gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\n\n    const texture = (unit: number, filter: number) => {\n      gl.activeTexture(gl.TEXTURE0 + unit);\n      gl.bindTexture(gl.TEXTURE_2D, gl.createTexture());\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filter);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);\n    };\n\n    // The cloth: how far over each sequin is (0 hangs down showing the first face, 1 is flipped up), how fast it is turning, and where it is headed.\n    let rows = 1;\n    let spanW = COLS + 0.76;\n    let spanH = 1;\n    let shiftY = 0.3;\n    let flip = new Float32Array(0);\n    let vel = new Float32Array(0);\n    let goal = new Float32Array(0);\n    let stiff = new Float32Array(0);\n    let bytes = new Uint8Array(0);\n    const cellX = (c: number, r: number) => c + 0.5 * (r % 2) + 0.6;\n    const cellY = (r: number) => r * ROW + 0.7;\n\n    const layout = () => {\n      const ratio = Math.min(window.devicePixelRatio || 1, 2);\n      cv.width = Math.max(1, Math.round(el.clientWidth * ratio));\n      cv.height = Math.max(1, Math.round(el.clientHeight * ratio));\n      gl.viewport(0, 0, cv.width, cv.height);\n      const pitch = cv.width / spanW;\n      spanH = cv.height / pitch;\n      const fit = Math.max(2, Math.floor((spanH - 2.0) / ROW) + 1);\n      shiftY = (spanH - ((fit - 1) * ROW + 1.4)) / 2;\n      const fresh = fit !== rows || flip.length !== COLS * fit;\n      if (fresh) {\n        rows = fit;\n        const n = COLS * rows;\n        flip = new Float32Array(n);\n        vel = new Float32Array(n);\n        goal = new Float32Array(n);\n        stiff = new Float32Array(n);\n        bytes = new Uint8Array(n);\n        const rnd = seeded(7);\n        for (let r = 0; r < rows; r++) {\n          for (let c = 0; c < COLS; c++) {\n            const i = r * COLS + c;\n            stiff[i] = 70 + rnd() * 90;\n            flip[i] = 0;\n            goal[i] = 0;\n          }\n        }\n      }\n      if (fresh) opening();\n      gl.uniform2f(u(\"u_res\"), cv.width, cv.height);\n      gl.uniform2f(u(\"u_grid\"), COLS, rows);\n      gl.uniform2f(u(\"u_span\"), spanW, spanH);\n      gl.uniform2f(u(\"u_shift\"), 0.02, shiftY);\n      gl.uniform1f(u(\"u_pitch\"), pitch);\n      gl.uniform1f(u(\"u_rp\"), ROW);\n    };\n\n    /** Lay every sequin within reach of the segment over to one face. Distances are in sequins. */\n    const brush = (x0: number, y0: number, x1: number, y1: number, reach: number, side: number) => {\n      const steps = Math.max(1, Math.ceil(Math.hypot(x1 - x0, y1 - y0) / 0.6));\n      for (let s = 0; s <= steps; s++) {\n        const x = x0 + ((x1 - x0) * s) / steps;\n        const y = y0 + ((y1 - y0) * s) / steps;\n        const rA = Math.max(0, Math.floor((y - reach - 0.7) / ROW));\n        const rB = Math.min(rows - 1, Math.ceil((y + reach - 0.7) / ROW));\n        for (let r = rA; r <= rB; r++) {\n          const cA = Math.max(0, Math.floor(x - reach - 1.1));\n          const cB = Math.min(COLS - 1, Math.ceil(x + reach));\n          for (let c = cA; c <= cB; c++) {\n            if (Math.hypot(cellX(c, r) - x, cellY(r) - y) < reach) goal[r * COLS + c] = side;\n          }\n        }\n      }\n    };\n    const sideAt = (x: number, y: number) => {\n      const r = Math.min(rows - 1, Math.max(0, Math.round((y - 0.7) / ROW)));\n      const c = Math.min(COLS - 1, Math.max(0, Math.round(x - 0.6 - 0.5 * (r % 2))));\n      return goal[r * COLS + c] > 0.5 ? 1 : 0;\n    };\n\n    let ready = false;\n    let visible = true;\n    let raf = 0;\n    let last = 0;\n    const started = performance.now();\n    const rnd = seeded(21);\n    // The idle hand. It lays a stroke of foil, lays a second, then goes back and brushes the first away, so there are never more than two on the cloth.\n    type Path = { x0: number; y0: number; x1: number; y1: number; bend: number; tall: boolean };\n    const along = (p: Path, k: number): [number, number] => {\n      const e = k * k * (3 - 2 * k);\n      const arc = Math.sin(Math.PI * e) * p.bend;\n      return [p.x0 + (p.x1 - p.x0) * e + (p.tall ? arc : 0), p.y0 + (p.y1 - p.y0) * e + (p.tall ? 0 : arc)];\n    };\n    const slant = (): Path => {\n      const tall = rnd() > 0.5;\n      const a = rnd() > 0.5 ? 0.06 + rnd() * 0.3 : 0.64 + rnd() * 0.3;\n      const b = a < 0.5 ? 0.6 + rnd() * 0.34 : 0.06 + rnd() * 0.34;\n      return tall\n        ? { x0: a * spanW, y0: -2, x1: b * spanW, y1: spanH + 2, bend: (rnd() - 0.5) * spanW * 0.4, tall }\n        : { x0: -2, y0: a * spanH, x1: spanW + 2, y1: b * spanH, bend: (rnd() - 0.5) * spanH * 0.3, tall };\n    };\n    const laid: Path[] = [];\n    let demo: { path: Path; side: number; from: number; lx: number; ly: number } | null = null;\n    let demoNext = started + 1100;\n    let turn = 0;\n    const opening = () => {\n      // It opens with one stroke of foil already brushed up from the lower corner.\n      const first: Path = { x0: -2, y0: spanH * 0.5, x1: spanW * 0.66, y1: spanH + 2, bend: spanH * 0.1, tall: false };\n      laid.length = 0;\n      laid.push(first);\n      let [lx, ly] = along(first, 0);\n      for (let k = 0.02; k <= 1; k += 0.02) {\n        const [x, y] = along(first, k);\n        brush(lx, ly, x, y, DEMO_BRUSH, 1);\n        lx = x;\n        ly = y;\n      }\n      for (let i = 0; i < flip.length; i++) flip[i] = goal[i];\n    };\n\n    const draw = (t: number) => {\n      for (let i = 0; i < flip.length; i++) bytes[i] = Math.max(0, Math.min(255, Math.round(flip[i] * 255)));\n      gl.activeTexture(gl.TEXTURE1);\n      gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, COLS, rows, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, bytes);\n      const h = hand.current;\n      // The lamp drifts a little, and leans toward the pointer, which is what makes the glints travel.\n      gl.uniform3f(u(\"u_light\"), -0.42 + 0.3 * Math.sin(t * 0.55) + (h.x - 0.5) * 0.5, -0.5 + 0.22 * Math.cos(t * 0.41) + (h.y - 0.5) * 0.4, 0.78);\n      gl.clearColor(0, 0, 0, 0);\n      gl.clear(gl.COLOR_BUFFER_BIT);\n      gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n    };\n\n    const applyHand = () => {\n      const h = hand.current;\n      const w = spanW;\n      const hgt = spanH;\n      if (h.moved) {\n        const x = h.x * w - 0.02;\n        const y = h.y * hgt - shiftY;\n        const px = h.px * w - 0.02;\n        const py = h.py * hgt - shiftY;\n        if (h.fresh) {\n          h.side = 1 - sideAt(x, y);\n          h.fresh = false;\n          brush(x, y, x, y, BRUSH, h.side);\n        } else brush(px, py, x, y, BRUSH, h.side);\n        h.px = h.x;\n        h.py = h.y;\n        h.moved = false;\n      }\n    };\n    // With motion reduced nothing swings: a stroke or the button turns its sequins over at once and the cloth is drawn again.\n    const still = () => {\n      if (!reduce || !ready) return;\n      applyHand();\n      const sw = sweep.current;\n      if (sw) goal.fill(sw.side);\n      sweep.current = null;\n      flip.set(goal);\n      draw(0);\n    };\n\n    const loop = (stamp: number) => {\n      if (ready) {\n        const t = (stamp - started) / 1000;\n        const dt = Math.min(last ? (stamp - last) / 1000 : 0.016, 0.033);\n        last = stamp;\n        const h = hand.current;\n\n        applyHand();\n\n        // With nobody touching it, an unseen hand strokes the cloth one way and then the other.\n        if (stamp - h.at > 2600) {\n          if (stamp >= demoNext) {\n            const lay = turn % 2 === 0 || !laid.length;\n            const path = lay ? slant() : laid.shift()!;\n            if (lay) laid.push(path);\n            const [sx, sy] = along(path, 0);\n            demo = { path, side: lay ? 1 : 0, from: stamp, lx: sx, ly: sy };\n            turn++;\n            demoNext = stamp + 2500;\n          }\n          if (demo) {\n            const k = (stamp - demo.from) / 1500;\n            if (k <= 1) {\n              const [x, y] = along(demo.path, k);\n              brush(demo.lx, demo.ly, x, y, DEMO_BRUSH + (demo.side ? 0 : 0.7), demo.side);\n              demo.lx = x;\n              demo.ly = y;\n            } else demo = null;\n          }\n        } else demoNext = stamp + 600;\n\n        // The button below sends one stroke across the whole panel.\n        const sw = sweep.current;\n        if (sw) {\n          const p = (stamp - sw.at) / 900;\n          for (let r = 0; r < rows; r++) for (let c = 0; c < COLS; c++) if (c / COLS + 0.12 * Math.sin(r * 0.7) < p * 1.2 - 0.1) goal[r * COLS + c] = sw.side;\n          if (p > 1.1) sweep.current = null;\n        }\n\n        // Each sequin swings over on its own spring and settles with a small wobble.\n        for (let i = 0; i < flip.length; i++) {\n          const k = stiff[i];\n          vel[i] += ((goal[i] - flip[i]) * k - vel[i] * 1.25 * Math.sqrt(k)) * dt;\n          flip[i] += vel[i] * dt;\n        }\n        draw(t);\n      }\n      raf = visible && !document.hidden && !reduce ? requestAnimationFrame(loop) : 0;\n    };\n    const wake = () => {\n      if (!raf && visible && !document.hidden) {\n        last = 0;\n        raf = requestAnimationFrame(loop);\n      }\n    };\n\n    const upload = () => {\n      if (ready || !one.complete || !one.naturalWidth) return;\n      try {\n        texture(0, gl.LINEAR);\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, one);\n        texture(1, gl.NEAREST);\n        gl.uniform1f(u(\"u_img\"), one.naturalWidth / one.naturalHeight);\n        ready = true;\n        setLive(true);\n        if (reduce) draw(0);\n      } catch {\n        // A picture could not be read into the shader: the still version underneath stays on show.\n        ready = false;\n      }\n    };\n\n    const ro = new ResizeObserver(() => {\n      layout();\n      if (reduce && ready) draw(0);\n    });\n    ro.observe(el);\n    const io = new IntersectionObserver(([entry]) => {\n      visible = entry.isIntersecting;\n      wake();\n    });\n    io.observe(el);\n    document.addEventListener(\"visibilitychange\", wake);\n    el.addEventListener(\"sequins-touched\", still);\n    one.addEventListener(\"load\", upload);\n    layout();\n    upload();\n    wake();\n\n    return () => {\n      cancelAnimationFrame(raf);\n      ro.disconnect();\n      io.disconnect();\n      document.removeEventListener(\"visibilitychange\", wake);\n      el.removeEventListener(\"sequins-touched\", still);\n      one.removeEventListener(\"load\", upload);\n    };\n  }, [reduce]);\n\n  function stroke(e: ReactPointerEvent<HTMLDivElement>) {\n    const r = e.currentTarget.getBoundingClientRect();\n    const h = hand.current;\n    const now = performance.now();\n    const x = (e.clientX - r.left) / r.width;\n    const y = (e.clientY - r.top) / r.height;\n    // A new stroke starts on a press, on entering the cloth, or after the hand has rested. It lays down whichever face is not showing where it begins.\n    if (e.type !== \"pointermove\" || now - h.at > 320) {\n      h.fresh = true;\n      h.px = x;\n      h.py = y;\n    }\n    h.x = x;\n    h.y = y;\n    h.at = now;\n    h.moved = true;\n    e.currentTarget.dispatchEvent(new Event(\"sequins-touched\"));\n  }\n\n  function sweepAll() {\n    const side = top === 0 ? 1 : 0;\n    setTop(side);\n    sweep.current = { side, at: performance.now() };\n    hand.current.at = performance.now();\n    panel.current?.dispatchEvent(new Event(\"sequins-touched\"));\n  }\n\n  const next = top === 0 ? FOIL.name : portrait.name;\n\n  return (\n    <section className=\"relative isolate flex min-h-[800px] w-full flex-col items-center justify-center overflow-hidden bg-[#e7e3dc] px-4 py-14\">\n      <style>{`\n        .rsp-still { clip-path: polygon(0 52%, 22% 62%, 46% 100%, 12% 100%, 0 84%); }\n        @media (prefers-reduced-motion: reduce) { .rsp-fade { transition: none; } }\n      `}</style>\n      <div aria-hidden=\"true\" className=\"absolute inset-0 -z-10\" style={{ background: \"radial-gradient(62% 52% at 44% 36%, #f4f1ec 0%, #e7e3dc 60%, #d9d4cb 100%)\" }} />\n\n      <div\n        ref={panel}\n        onPointerMove={stroke}\n        onPointerDown={stroke}\n        onPointerEnter={stroke}\n        className=\"relative aspect-[4/5] w-[min(88vw,480px)] cursor-crosshair touch-pan-y\"\n      >\n        <div aria-hidden=\"true\" className=\"absolute inset-x-[7%] bottom-[-4%] top-[12%] rounded-[40px] bg-[#4a3d2c]/60 blur-2xl\" />\n        <div aria-hidden=\"true\" className=\"absolute inset-x-[3%] bottom-[0.5%] top-[4%] rounded-[10px] bg-[#2b241b]/55 blur-[6px]\" />\n        {/* The still version, on show until the shader is ready and whenever WebGL is missing. */}\n        <div className={`rsp-fade absolute inset-[2.5%] overflow-hidden rounded-md bg-[#3b6fd0] transition-opacity duration-500 ${live ? \"opacity-0\" : \"opacity-100\"}`}>\n          <img ref={first} src={portrait.src} alt={portrait.alt} crossOrigin=\"anonymous\" width={900} height={1350} className=\"absolute inset-0 h-full w-full object-cover\" />\n          <div aria-hidden=\"true\" className=\"rsp-still absolute inset-0 bg-[#e0ad3f]\" />\n        </div>\n        <canvas ref={canvas} aria-hidden=\"true\" className={`rsp-fade absolute inset-0 h-full w-full transition-opacity duration-500 ${live ? \"opacity-100\" : \"opacity-0\"}`} />\n      </div>\n\n      <div className=\"mt-8 flex w-[min(88vw,480px)] items-center justify-between gap-4 px-1 text-[13px]\">\n        <p className=\"text-neutral-700\">Stroke the sequins.</p>\n        <button\n          type=\"button\"\n          onClick={sweepAll}\n          className=\"min-h-[40px] shrink-0 rounded-full bg-neutral-900 px-4 text-[13px] font-medium text-white transition-colors hover:bg-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2 focus-visible:ring-offset-[#e7e3dc]\"\n        >\n          Brush it all to {next}\n        </button>\n      </div>\n    </section>\n  );\n}\n"}]}
