{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"corrugated-cardboard-parcel-with-printed-paper-tape-that-peels-back-and-four-flaps-that-fold-open-over-a-folded-jumper","type":"registry:block","title":"Corrugated Cardboard Parcel with Printed Paper Tape That Peels Back and Four Flaps That Fold Open over a Folded Jumper","description":"Unboxing animation in CSS 3D: printed tape peels off a carton, the flaps fold open and tissue parts over a jumper. Copy the React code or HTML free.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/corrugated-cardboard-parcel-with-printed-paper-tape-that-peels-back-and-four-flaps-that-fold-open-over-a-folded-jumper.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { animate, motion, useMotionValue, useReducedMotion, useSpring, useTransform } from \"framer-motion\";\nimport type { ReactNode } from \"react\";\n\n/** Everything printed on the carton and packed inside it. */\nconst parcel = {\n  courier: \"Fennick Parcel Co.\",\n  tape: \"FENNICK PARCEL CO.  /  PACKED BY HAND  /  \",\n  order: \"Order 48-2217\",\n  to: [\"Ines Calder\", \"14 Tannery Row\", \"Halewick HW3 9QT\"],\n  route: \"HW3\",\n  bay: \"07\",\n  item: \"Fisherman rib jumper\",\n  detail: \"Marigold lambswool, size M\",\n  maker: \"Marrow Knitwear\",\n  photo: { src: \"https://images.pexels.com/photos/1487703/pexels-photo-1487703.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Close view of a marigold yellow cable knit jumper\", tone: \"#d99413\" },\n};\n\n// Design pixels in the carton's own space: x runs along it, y across it, z up off the table.\nconst W = 340;\nconst D = 236;\nconst H = 186;\nconst F = D / 2; // every flap is half the short side, as on a real regular slotted carton\nconst T = 5; // board thickness\nconst TAPE = 46; // tape width\nconst TAB = 58; // how far the tape runs down the end wall\nconst FILL = H - 42; // height of the packed contents\nconst SCENE_W = 900;\nconst SCENE_H = 600;\nconst TURN = 33;\nconst TIP = 54;\n// resting angles of the four flaps when the box is open, in degrees from closed\nconst BACK_OPEN = 109;\nconst LEFT_OPEN = 116;\nconst FRONT_OPEN = 203;\nconst RIGHT_OPEN = 207;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst svg = (s: string) => `url(\"data:image/svg+xml,${encodeURIComponent(s)}\")`;\n\n// paper fibre for the kraft liner, and a crumpled sheet for the tissue\nconst fibre = svg(\n  \"<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='f' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.9 0.32' numOctaves='3' seed='8' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.26  0 0 0 0 0.15  0 0 0 0 0.05  0 0 0 -1.5 0.94'/></filter><rect width='260' height='260' filter='url(#f)'/></svg>\",\n);\nconst mottle = svg(\n  \"<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='m' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.012 0.02' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.9  0 0 0 0 0.72  0 0 0 -0.7 0.36'/></filter><rect width='400' height='400' filter='url(#m)'/></svg>\",\n);\nconst crumple = svg(\n  \"<svg xmlns='http://www.w3.org/2000/svg' width='340' height='340'><filter id='t' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.022 0.03' numOctaves='4' seed='5'/><feDiffuseLighting surfaceScale='5.5' diffuseConstant='1.16' lighting-color='#fffdf7'><feDistantLight azimuth='220' elevation='58'/></feDiffuseLighting></filter><rect width='340' height='340' filter='url(#t)'/></svg>\",\n);\n\nconst KRAFT = \"#c39a64\";\nconst KRAFT_IN = \"#c9a26d\";\nconst INK = \"#4a3015\";\nconst RED = \"#c5311f\";\nconst TAPE_PAPER = \"#efe6d3\";\nconst flutesX = \"repeating-linear-gradient(90deg, rgba(255,240,214,0.07) 0 3.5px, rgba(60,34,8,0.07) 3.5px 7px)\";\nconst flutesY = \"repeating-linear-gradient(180deg, rgba(255,240,214,0.07) 0 3.5px, rgba(60,34,8,0.07) 3.5px 7px)\";\nconst cutEdgeX = \"linear-gradient(180deg, #e2c598 0 1px, rgba(0,0,0,0) 1px 4px, #a98250 4px), repeating-linear-gradient(90deg, #7d5c33 0 1px, #d6b684 1px 2.6px, #9c7747 2.6px 4px)\";\nconst cutEdgeY = \"linear-gradient(90deg, #e2c598 0 1px, rgba(0,0,0,0) 1px 4px, #a98250 4px), repeating-linear-gradient(180deg, #7d5c33 0 1px, #d6b684 1px 2.6px, #9c7747 2.6px 4px)\";\n\nconst board = (ribs: string, base = KRAFT) => ({ backgroundColor: base, backgroundImage: `${ribs}, ${fibre}, ${mottle}`, backgroundSize: \"auto, 260px 260px, 400px 400px\" });\n\nconst barcode = [2, 1, 1, 3, 1, 2, 2, 1, 3, 1, 1, 2, 1, 3, 2, 1, 1, 1, 3, 2, 1, 2, 1, 1, 3, 1, 2, 1, 2, 3, 1, 1, 2, 1];\n\n/** One flap with real thickness: printed outside, plain inside and a fluted cut edge all round. */\nfunction Flap({ w, h, ribs, shade, children }: { w: number; h: number; ribs: string; shade: string; children?: ReactNode }) {\n  return (\n    <>\n      <div className=\"absolute left-0 top-0 overflow-hidden\" style={{ width: w, height: h, backfaceVisibility: \"hidden\", ...board(ribs) }}>\n        {children}\n        <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(128deg, rgba(255,246,226,0.2) 0%, rgba(255,246,226,0) 42%, rgba(40,22,4,0.1) 100%)\", boxShadow: \"inset 0 0 0 1px rgba(90,58,22,0.28), inset 0 0 14px rgba(90,58,22,0.14)\" }} />\n      </div>\n      <div className=\"absolute left-0 top-0\" style={{ width: w, height: h, transform: `translateZ(${-T}px)`, ...board(ribs, KRAFT_IN) }}>\n        <div className=\"absolute inset-0\" style={{ background: shade, boxShadow: \"inset 0 0 0 1px rgba(90,58,22,0.3)\" }} />\n      </div>\n      <div className=\"absolute left-0 top-0\" style={{ width: w, height: T, transformOrigin: \"50% 0\", transform: \"rotateX(-90deg)\", background: cutEdgeX }} />\n      <div className=\"absolute left-0\" style={{ top: h - T, width: w, height: T, transformOrigin: \"50% 100%\", transform: \"rotateX(90deg)\", background: cutEdgeX }} />\n      <div className=\"absolute left-0 top-0\" style={{ width: T, height: h, transformOrigin: \"0 50%\", transform: \"rotateY(90deg)\", background: cutEdgeY }} />\n      <div className=\"absolute top-0\" style={{ left: w - T, width: T, height: h, transformOrigin: \"100% 50%\", transform: \"rotateY(-90deg)\", background: cutEdgeY }} />\n    </>\n  );\n}\n\nfunction TapePrint({ flip = false }: { flip?: boolean }) {\n  return (\n    <span className=\"absolute inset-0 overflow-hidden\" style={{ backgroundColor: TAPE_PAPER, backgroundImage: `linear-gradient(180deg, rgba(255,255,255,0.5) 0 10%, rgba(255,255,255,0) 34%, rgba(90,60,20,0.1) 100%), ${fibre}`, backgroundSize: \"auto, 200px 200px\" }}>\n      <span className=\"absolute inset-x-0 top-[5px] h-px\" style={{ background: RED, opacity: 0.85 }} />\n      <span className=\"absolute inset-x-0 bottom-[5px] h-px\" style={{ background: RED, opacity: 0.85 }} />\n      <span className=\"absolute left-0 top-1/2 block whitespace-nowrap font-mono text-[10.5px] font-bold uppercase leading-none tracking-[0.2em]\" style={{ color: RED, transform: `translateY(-50%)${flip ? \" rotate(180deg)\" : \"\"}` }}>\n        {parcel.tape.repeat(4)}\n      </span>\n    </span>\n  );\n}\n\nexport default function CardboardParcelUnboxing() {\n  const reduce = !!useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const [open, setOpen] = useState(true);\n  const timers = useRef<number[]>([]);\n  const state = useRef({ paused: false, touched: false });\n\n  const flapSpring = { stiffness: 62, damping: 9.5, mass: 1 };\n  const peel = useMotionValue(1); // 0 = taped shut, 1 = tape off\n  const fBack = useSpring(1, flapSpring);\n  const fFront = useSpring(0.9, { stiffness: 54, damping: 8.5, mass: 1.1 });\n  const fLeft = useSpring(1, flapSpring);\n  const fRight = useSpring(1, { stiffness: 58, damping: 8.5, mass: 1 });\n  const tissue = useSpring(0.5, { stiffness: 46, damping: 12 });\n  const px = useMotionValue(0);\n  const py = useMotionValue(0);\n  const rz = useSpring(useTransform(px, (v) => TURN + v * 5), { stiffness: 50, damping: 14 });\n  const rx = useSpring(useTransform(py, (v) => TIP - v * 3.5), { stiffness: 50, damping: 14 });\n\n  const backT = useTransform(fBack, (v) => `translateZ(${H + T}px) rotateX(${(v * BACK_OPEN).toFixed(2)}deg)`);\n  const frontT = useTransform(fFront, (v) => `translateZ(${H + T}px) rotateX(${(-v * FRONT_OPEN).toFixed(2)}deg)`);\n  const leftT = useTransform(fLeft, (v) => `translateZ(${H}px) rotateY(${(-v * LEFT_OPEN).toFixed(2)}deg)`);\n  const rightT = useTransform(fRight, (v) => `translateZ(${H}px) rotateY(${(v * RIGHT_OPEN).toFixed(2)}deg)`);\n  const frontShade = useTransform(fFront, (v) => clamp((v - 0.55) * 2.2, 0, 1));\n  const rightShade = useTransform(fRight, (v) => clamp((v - 0.55) * 2.2, 0, 1));\n  const inside = useTransform(fBack, (v) => clamp(v * 3, 0, 1));\n\n  // the tape: a strip stuck across the seam whose free end lifts, folds back and curls as it is pulled\n  const stuck = useTransform(peel, (p) => `inset(0 ${(clamp((p - 0.14) / 0.86, 0, 1) * 100).toFixed(2)}% 0 0)`);\n  const tailT = useTransform(peel, (p) => {\n    const q = clamp((p - 0.14) / 0.86, 0, 1);\n    const a = 90 - clamp(p / 0.3, 0, 1) * 222;\n    return `translate3d(${(W * (1 - q) + (p < 0.14 ? 1 : 0)).toFixed(1)}px, ${D / 2 - TAPE / 2}px, ${H + T + 1}px) rotateY(${a.toFixed(1)}deg)`;\n  });\n  const tailW = useTransform(peel, (p) => clamp(TAB + W * clamp((p - 0.14) / 0.86, 0, 1), TAB, 132));\n  const curlT = useTransform(peel, (p) => `rotateY(${(-clamp((p - 0.08) / 0.3, 0, 1) * 52).toFixed(1)}deg)`);\n  const tailO = useTransform(peel, (p) => clamp((0.99 - p) / 0.07, 0, 1));\n  const offO = useTransform(peel, (p) => clamp((p - 0.9) / 0.1, 0, 1));\n  const partL = useTransform(tissue, (v) => `translateZ(${FILL + 5}px) rotateY(${(-v * 30).toFixed(1)}deg) scaleX(${(1 - v * 0.68).toFixed(3)})`);\n  const partR = useTransform(tissue, (v) => `translateZ(${FILL + 6}px) rotateY(${(v * 30).toFixed(1)}deg) scaleX(${(1 - v * 0.66).toFixed(3)})`);\n\n  const play = useCallback(\n    (to: boolean) => {\n      timers.current.forEach((t) => window.clearTimeout(t));\n      timers.current = [];\n      setOpen(to);\n      if (reduce) {\n        [fBack, fFront, fLeft, fRight, tissue].forEach((m) => m.jump(to ? 1 : 0));\n        peel.set(to ? 1 : 0);\n        return;\n      }\n      const at = (ms: number, fn: () => void) => timers.current.push(window.setTimeout(fn, ms));\n      if (to) {\n        animate(peel, 1, { duration: 1.05, ease: [0.35, 0, 0.25, 1] });\n        at(900, () => fBack.set(1));\n        at(1040, () => fFront.set(1));\n        at(1380, () => fLeft.set(1));\n        at(1480, () => fRight.set(1));\n        at(1900, () => tissue.set(1));\n      } else {\n        tissue.set(0);\n        at(380, () => fLeft.set(0));\n        at(470, () => fRight.set(0));\n        at(980, () => fBack.set(0));\n        at(1120, () => fFront.set(0));\n        at(1900, () => animate(peel, 0, { duration: 0.95, ease: [0.3, 0, 0.2, 1] }));\n      }\n    },\n    [fBack, fFront, fLeft, fRight, peel, reduce, tissue],\n  );\n\n  // self-playing demo: start packed open, then seal it and cut it open again until someone takes over\n  useEffect(() => {\n    if (reduce) {\n      fFront.jump(1);\n      tissue.jump(1);\n      return;\n    }\n    // the last of the unpacking settles as the page loads\n    fFront.set(1);\n    tissue.set(1);\n    const s = state.current;\n    let shut = false;\n    let id = window.setTimeout(function tick() {\n      if (s.touched) return;\n      if (!s.paused && !document.hidden) {\n        shut = !shut;\n        play(!shut);\n      }\n      id = window.setTimeout(tick, shut ? 4300 : 6400);\n    }, 3700);\n    return () => {\n      window.clearTimeout(id);\n      timers.current.forEach((t) => window.clearTimeout(t));\n    };\n  }, [fFront, play, reduce, tissue]);\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    const scene = sceneRef.current;\n    if (!wrap || !scene) return;\n    const measure = () => {\n      const sc = clamp(wrap.clientWidth / (SCENE_W - 60), 0.42, 1.16);\n      wrap.style.height = `${Math.round(SCENE_H * sc + 70)}px`;\n      scene.style.transform = `translateX(-50%) scale(${sc.toFixed(4)})`;\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(wrap);\n    return () => ro.disconnect();\n  }, []);\n\n  const toggle = () => {\n    state.current.touched = true;\n    play(!open);\n  };\n  const onMove = (e: React.PointerEvent) => {\n    if (reduce || e.pointerType === \"touch\") return;\n    const r = e.currentTarget.getBoundingClientRect();\n    px.set(((e.clientX - r.left) / r.width) * 2 - 1);\n    py.set(((e.clientY - r.top) / r.height) * 2 - 1);\n  };\n\n  const p3 = \"preserve-3d\" as const;\n\n  return (\n    <section className=\"relative overflow-hidden bg-[#1b3140]\">\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"radial-gradient(62% 58% at 46% 46%, #3d6278 0%, #264557 44%, #152733 100%)\" }} />\n      <div\n        ref={wrapRef}\n        onPointerMove={onMove}\n        onPointerEnter={() => (state.current.paused = true)}\n        onPointerLeave={() => {\n          state.current.paused = false;\n          px.set(0);\n          py.set(0);\n        }}\n        className=\"relative mx-auto w-full overflow-hidden\"\n        style={{ height: SCENE_H + 70 }}\n      >\n        <div ref={sceneRef} onClick={toggle} className=\"absolute left-1/2 top-0 cursor-pointer select-none\" style={{ width: SCENE_W, height: SCENE_H, transformOrigin: \"50% 0\", transform: \"translateX(-50%)\", perspective: \"2800px\", perspectiveOrigin: \"50% 36%\" }}>\n          <motion.div aria-hidden={false} className=\"absolute\" style={{ left: SCENE_W / 2 - W / 2 + 6, top: SCENE_H / 2 - D / 2 + 92, width: W, height: D, transformStyle: p3, rotateX: rx, rotateZ: rz }}>\n            {/* shadows on the table */}\n            <div aria-hidden=\"true\" className=\"absolute rounded-[30px] bg-black\" style={{ left: -4, top: 6, width: W + 120, height: D + 96, filter: \"blur(30px)\", opacity: 0.5 }} />\n            <div aria-hidden=\"true\" className=\"absolute bg-black\" style={{ left: 3, top: 3, width: W + 6, height: D + 6, filter: \"blur(6px)\", opacity: 0.6 }} />\n\n            {/* the strip of tape after it has been pulled off, lying on the table */}\n            <motion.div aria-hidden=\"true\" className=\"absolute\" style={{ left: W + 30, top: D - 50, width: 176, height: TAPE, opacity: offO, transform: \"translateZ(1px) rotate(-64deg)\" }}>\n              <div className=\"absolute inset-0 bg-black\" style={{ filter: \"blur(6px)\", opacity: 0.5, transform: \"translate(5px, 7px)\" }} />\n              <div className=\"absolute inset-0 overflow-hidden rounded-[1px]\">\n                <TapePrint />\n                <span className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(0,0,0,0.22) 0%, rgba(255,255,255,0.3) 14%, rgba(0,0,0,0.12) 34%, rgba(255,255,255,0.26) 52%, rgba(0,0,0,0.16) 76%, rgba(255,255,255,0.22) 90%, rgba(0,0,0,0.24) 100%)\" }} />\n              </div>\n            </motion.div>\n\n            {/* floor, then the two inside walls */}\n            <div className=\"absolute\" style={{ left: 0, top: 0, width: W, height: D, transform: \"translateZ(2px)\", background: \"#6f5231\" }} />\n            <div className=\"absolute\" style={{ left: 0, top: -H, width: W, height: H, transformOrigin: \"50% 100%\", transform: \"rotateX(-90deg)\", ...board(flutesX, KRAFT_IN) }}>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(180deg, rgba(255,244,222,0.16) 0%, rgba(60,36,10,0.08) 22%, rgba(40,22,4,0.5) 100%), linear-gradient(90deg, rgba(40,22,4,0.4) 0%, rgba(40,22,4,0) 34%)\" }} />\n            </div>\n            <div className=\"absolute\" style={{ left: -H, top: 0, width: H, height: D, transformOrigin: \"100% 50%\", transform: \"rotateY(90deg)\", ...board(flutesY, \"#b08955\") }}>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(40,22,4,0.1) 0%, rgba(40,22,4,0.22) 26%, rgba(30,16,2,0.62) 100%)\" }} />\n            </div>\n\n            {/* what is packed inside */}\n            <motion.div className=\"absolute\" style={{ left: 3, top: 3, width: W - 6, height: D - 6, transform: `translateZ(${FILL}px)`, opacity: inside, backgroundColor: parcel.photo.tone }}>\n              <img src={parcel.photo.src} alt={parcel.photo.alt} draggable={false} className=\"absolute inset-0 h-full w-full object-cover\" />\n              <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(40,18,0,0.62) 0%, rgba(40,18,0,0.16) 22%, rgba(40,18,0,0) 44%), linear-gradient(180deg, rgba(40,18,0,0.6) 0%, rgba(40,18,0,0.12) 26%, rgba(40,18,0,0) 48%), linear-gradient(0deg, rgba(40,18,0,0.2) 0%, rgba(40,18,0,0) 14%)\" }} />\n              {/* the fold of the jumper and the paper band round it */}\n              <div aria-hidden=\"true\" className=\"absolute inset-y-0\" style={{ left: \"72%\", width: 26, background: \"linear-gradient(90deg, rgba(60,28,0,0) 0%, rgba(60,28,0,0.34) 46%, rgba(255,226,150,0.3) 56%, rgba(255,226,150,0) 100%)\" }} />\n              <div className=\"absolute inset-y-0 overflow-hidden\" style={{ left: \"30%\", width: 104, backgroundColor: \"#f3ecdc\", backgroundImage: fibre, backgroundSize: \"220px 220px\", boxShadow: \"0 0 0 0.5px rgba(60,36,10,0.4), 5px 4px 9px rgba(50,24,0,0.5)\" }}>\n                <div className=\"absolute inset-x-0 top-0 h-[38%]\" style={{ background: \"linear-gradient(180deg, rgba(40,18,0,0.4), rgba(40,18,0,0))\" }} />\n                <div className=\"absolute left-1/2 top-[56%] w-[92px] -translate-x-1/2 -translate-y-1/2 text-center\" style={{ color: INK }}>\n                  <div className=\"mx-auto mb-[7px] grid h-[26px] w-[26px] place-items-center rounded-full text-[13px] font-black leading-none\" style={{ border: `1.5px solid ${INK}` }}>\n                    M\n                  </div>\n                  <div className=\"text-[11px] font-black uppercase leading-[1.05] tracking-[0.08em]\">{parcel.maker}</div>\n                  <div className=\"mx-auto my-[5px] h-px w-[40px]\" style={{ background: INK }} />\n                  <div className=\"font-mono text-[6.5px] uppercase leading-[1.5] tracking-[0.14em]\">{parcel.item}</div>\n                  <div className=\"font-mono text-[6.5px] uppercase leading-[1.5] tracking-[0.14em]\">{parcel.detail}</div>\n                </div>\n              </div>\n            </motion.div>\n            {/* two sheets of tissue that part and bunch against the ends */}\n            <motion.div aria-hidden=\"true\" className=\"absolute\" style={{ left: 4, top: 4, width: W / 2 + 6, height: D - 8, transformOrigin: \"0 50%\", transform: partL, opacity: inside, backgroundColor: \"#f6f1e6\", backgroundImage: crumple, backgroundSize: \"300px 300px\", boxShadow: \"4px 3px 10px rgba(50,24,0,0.45)\" }}>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(60,34,8,0.42) 0%, rgba(60,34,8,0) 30%), linear-gradient(180deg, rgba(60,34,8,0.4) 0%, rgba(60,34,8,0) 30%)\" }} />\n            </motion.div>\n            <motion.div aria-hidden=\"true\" className=\"absolute\" style={{ left: W / 2 - 10, top: 4, width: W / 2 + 6, height: D - 8, transformOrigin: \"100% 50%\", transform: partR, opacity: inside, backgroundColor: \"#f8f3e8\", backgroundImage: crumple, backgroundSize: \"300px 300px\", backgroundPosition: \"120px 70px\", boxShadow: \"-4px 3px 10px rgba(50,24,0,0.45)\" }}>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(180deg, rgba(60,34,8,0.36) 0%, rgba(60,34,8,0) 28%)\" }} />\n            </motion.div>\n\n            {/* front wall, printed with handling marks */}\n            <div className=\"absolute overflow-hidden\" style={{ left: 0, top: D - H, width: W, height: H, transformOrigin: \"50% 100%\", transform: \"rotateX(-90deg)\", ...board(flutesX) }}>\n              <div className=\"absolute bottom-[18px] left-[20px] flex items-end gap-[12px]\" style={{ color: INK, opacity: 0.82 }}>\n                <svg aria-hidden=\"true\" viewBox=\"0 0 150 46\" className=\"h-[46px] w-[150px]\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinejoin=\"round\" strokeLinecap=\"round\">\n                  <rect x=\"1.5\" y=\"1.5\" width=\"43\" height=\"43\" />\n                  <path d=\"M15 37V13M9 19l6-7 6 7M30 37V13M24 19l6-7 6 7M8 40h30\" />\n                  <rect x=\"53.5\" y=\"1.5\" width=\"43\" height=\"43\" />\n                  <path d=\"M66 9h18l-2 12a7 7 0 0 1-14 0zM75 28v9M68 38h14\" />\n                  <rect x=\"105.5\" y=\"1.5\" width=\"43\" height=\"43\" />\n                  <path d=\"M113 24a14 14 0 0 1 28 0zM127 24v11a4 4 0 0 1-8 0M127 7v3\" />\n                </svg>\n                <div className=\"pb-[1px] font-mono text-[8px] font-bold uppercase leading-[1.45] tracking-[0.2em]\">\n                  <div>This way up</div>\n                  <div>Fragile, keep dry</div>\n                  <div className=\"opacity-70\">Board 32 ECT / single wall</div>\n                </div>\n              </div>\n              <div className=\"absolute right-[18px] top-[20px] text-right text-[21px] font-black uppercase leading-[0.9] tracking-[0.02em]\" style={{ color: INK, opacity: 0.8 }}>\n                Fennick\n                <div className=\"mt-[4px] font-mono text-[7.5px] font-bold tracking-[0.34em]\">Parcel Co.</div>\n              </div>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(180deg, rgba(255,244,222,0.22) 0, rgba(255,244,222,0) 6px, rgba(40,22,4,0) 55%, rgba(40,22,4,0.2) 100%), linear-gradient(90deg, rgba(255,244,222,0.08), rgba(40,22,4,0.08))\", boxShadow: \"inset 0 0 0 1px rgba(90,58,22,0.3)\" }} />\n              <motion.div aria-hidden=\"true\" className=\"absolute inset-x-0 top-0 h-[78%]\" style={{ opacity: frontShade, background: \"linear-gradient(180deg, rgba(30,16,2,0.6) 0%, rgba(30,16,2,0.42) 62%, rgba(30,16,2,0) 100%)\" }} />\n            </div>\n\n            {/* right end wall */}\n            <div className=\"absolute overflow-hidden\" style={{ left: W - H, top: 0, width: H, height: D, transformOrigin: \"100% 50%\", transform: \"rotateY(90deg)\", ...board(flutesY, \"#a98150\") }}>\n              <div className=\"absolute left-0\" style={{ top: D, width: D, height: H, transformOrigin: \"0 0\", transform: \"rotate(-90deg)\" }}>\n                <div className=\"absolute bottom-[20px] left-[22px] px-[9px] py-[6px] text-center text-white\" style={{ background: RED, transform: \"rotate(-3deg)\", boxShadow: \"0 0 0 2px #f6efe2, 1px 2px 3px rgba(40,22,4,0.4)\" }}>\n                  <div className=\"text-[15px] font-black uppercase leading-none tracking-[0.12em]\">Fragile</div>\n                  <div className=\"mt-[3px] font-mono text-[6px] font-bold uppercase leading-none tracking-[0.2em]\">Handle with care</div>\n                </div>\n                <div className=\"absolute bottom-[22px] right-[20px] font-mono text-[7px] font-bold uppercase leading-[1.5] tracking-[0.2em]\" style={{ color: INK, opacity: 0.75 }}>\n                  <div>Gross 0.9 kg</div>\n                  <div>34 x 24 x 19 cm</div>\n                </div>\n              </div>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(255,244,222,0.14) 0, rgba(255,244,222,0) 6px, rgba(40,22,4,0.1) 50%, rgba(40,22,4,0.34) 100%)\", boxShadow: \"inset 0 0 0 1px rgba(90,58,22,0.3)\" }} />\n              <motion.div aria-hidden=\"true\" className=\"absolute inset-y-0 left-0 w-[76%]\" style={{ opacity: rightShade, background: \"linear-gradient(90deg, rgba(30,16,2,0.55) 0%, rgba(30,16,2,0.36) 62%, rgba(30,16,2,0) 100%)\" }} />\n            </div>\n\n            {/* the two short flaps, folded in first */}\n            <motion.div className=\"absolute left-0 top-0\" style={{ width: F, height: D, transformStyle: p3, transformOrigin: \"0 50%\", transform: leftT }}>\n              <Flap w={F} h={D} ribs={flutesY} shade=\"linear-gradient(90deg, rgba(40,22,4,0.3) 0%, rgba(255,244,222,0.12) 30%, rgba(255,244,222,0.2) 100%)\" />\n            </motion.div>\n            <motion.div className=\"absolute top-0\" style={{ left: W - F, width: F, height: D, transformStyle: p3, transformOrigin: \"100% 50%\", transform: rightT }}>\n              <Flap w={F} h={D} ribs={flutesY} shade=\"linear-gradient(270deg, rgba(40,22,4,0.24) 0%, rgba(255,244,222,0.06) 26%, rgba(255,244,222,0.16) 100%)\" />\n            </motion.div>\n\n            {/* the two long flaps that meet under the tape */}\n            <motion.div className=\"absolute left-0 top-0\" style={{ width: W, height: F, transformStyle: p3, transformOrigin: \"50% 0\", transform: backT }}>\n              <Flap w={W} h={F} ribs={flutesX} shade=\"linear-gradient(180deg, rgba(40,22,4,0.3) 0%, rgba(255,244,222,0.14) 28%, rgba(255,244,222,0.26) 100%)\">\n                <div className=\"absolute left-[22px] top-[20px] font-mono text-[8px] font-bold uppercase leading-[1.5] tracking-[0.22em]\" style={{ color: INK, opacity: 0.8 }}>\n                  <div>Open this side</div>\n                  <div className=\"opacity-70\">Pull the tape, do not cut</div>\n                </div>\n                <div className=\"absolute right-[24px] top-[16px] grid h-[58px] w-[58px] place-items-center rounded-full text-center font-mono text-[6.5px] font-bold uppercase leading-[1.35] tracking-[0.14em]\" style={{ color: INK, opacity: 0.72, border: `1.5px solid ${INK}`, transform: \"rotate(-9deg)\" }}>\n                  <span>\n                    Packed\n                    <br />\n                    <span className=\"text-[13px] font-black tracking-normal\">No. 12</span>\n                    <br />\n                    Halewick\n                  </span>\n                </div>\n              </Flap>\n            </motion.div>\n            <motion.div className=\"absolute left-0\" style={{ top: D - F, width: W, height: F, transformStyle: p3, transformOrigin: \"50% 100%\", transform: frontT }}>\n              <Flap w={W} h={F} ribs={flutesX} shade=\"linear-gradient(0deg, rgba(40,22,4,0.2) 0%, rgba(255,244,222,0.1) 26%, rgba(255,244,222,0.22) 100%)\">\n                {/* the courier's label */}\n                <div className=\"absolute overflow-hidden rounded-[2px] bg-[#fbfaf5] text-neutral-900\" style={{ left: 22, top: 30, width: 176, height: 78, transform: \"rotate(-1.4deg)\", boxShadow: \"0 0 0 0.5px rgba(40,22,4,0.4), 1px 2px 2px rgba(40,22,4,0.3)\" }}>\n                  <div className=\"absolute left-[7px] top-[6px] bg-neutral-900 px-[5px] py-[3px] text-[8px] font-black uppercase leading-none tracking-[0.12em] text-white\">Fennick</div>\n                  <div className=\"absolute left-[62px] top-[8px] font-mono text-[5.5px] font-bold uppercase leading-none tracking-[0.16em]\">Tracked 48</div>\n                  <div className=\"absolute left-[7px] top-[23px] font-mono text-[6px] font-semibold uppercase leading-[1.42] tracking-[0.06em]\">\n                    {parcel.to.map((l) => (\n                      <div key={l}>{l}</div>\n                    ))}\n                  </div>\n                  <div className=\"absolute bottom-[6px] left-[7px] flex h-[19px] items-stretch gap-[1px]\">\n                    {barcode.map((b, i) => (\n                      <span key={i} className={i % 2 ? \"\" : \"bg-neutral-900\"} style={{ width: b * 1.15 }} />\n                    ))}\n                  </div>\n                  <div className=\"absolute inset-y-0 right-0 w-[58px] border-l border-neutral-900 text-center\">\n                    <div className=\"mt-[9px] text-[22px] font-black leading-none tracking-[-0.02em]\">{parcel.route}</div>\n                    <div className=\"mx-auto mt-[6px] w-[40px] bg-neutral-900 py-[3px] text-[13px] font-black leading-none text-white\">{parcel.bay}</div>\n                    <div className=\"mt-[6px] font-mono text-[5px] font-bold uppercase leading-none tracking-[0.16em]\">Bay</div>\n                  </div>\n                </div>\n              </Flap>\n            </motion.div>\n\n            {/* tape across the seam */}\n            <motion.div aria-hidden=\"true\" className=\"absolute left-0\" style={{ top: D / 2 - TAPE / 2, width: W, height: TAPE, transform: `translateZ(${H + T + 0.8}px)`, clipPath: stuck }}>\n              <TapePrint />\n              <span className=\"absolute inset-0\" style={{ boxShadow: \"inset 0 0 0 0.5px rgba(90,58,22,0.4)\", background: \"linear-gradient(180deg, rgba(0,0,0,0) 46%, rgba(60,34,8,0.2) 49.5%, rgba(255,255,255,0.3) 51%, rgba(0,0,0,0) 54%)\" }} />\n            </motion.div>\n            <motion.div aria-hidden=\"true\" className=\"absolute left-0 top-0\" style={{ width: tailW, height: TAPE, transformStyle: p3, transformOrigin: \"0 50%\", transform: tailT, opacity: tailO }}>\n              <span className=\"absolute inset-0\" style={{ backfaceVisibility: \"hidden\" }}>\n                <TapePrint />\n              </span>\n              <span className=\"absolute inset-0\" style={{ transform: \"translateZ(-0.6px)\", background: \"linear-gradient(90deg, #cfc2a4 0%, #e9dfc8 30%, #f7f0df 62%, #d8ccb0 100%)\", boxShadow: \"inset 0 0 0 0.5px rgba(90,58,22,0.35)\" }} />\n              <motion.span className=\"absolute top-0 block\" style={{ left: \"100%\", width: 44, height: TAPE, transformOrigin: \"0 50%\", transform: curlT, background: \"linear-gradient(90deg, #d8ccb0 0%, #f7f0df 44%, #c9bc9c 100%)\", boxShadow: \"inset 0 0 0 0.5px rgba(90,58,22,0.35)\" }} />\n            </motion.div>\n          </motion.div>\n        </div>\n\n        <p className=\"pointer-events-none absolute bottom-7 left-4 font-mono text-[11px] uppercase leading-relaxed tracking-[0.18em] text-sky-100/80 sm:bottom-8 sm:left-8\">\n          <span className=\"text-white\">{parcel.order}</span>\n          <span className=\"hidden sm:block\">\n            {parcel.item}, {parcel.courier}\n          </span>\n        </p>\n        <button\n          type=\"button\"\n          onClick={toggle}\n          aria-pressed={open}\n          className=\"absolute bottom-4 right-4 min-h-[44px] rounded-full bg-[#f3ecdc] px-5 font-mono text-[11px] font-bold uppercase tracking-[0.18em] text-[#1b3140] shadow-[0_6px_16px_rgba(0,0,0,0.35)] outline-none transition-transform duration-200 hover:-translate-y-0.5 focus-visible:ring-4 focus-visible:ring-white/80 active:translate-y-0 motion-reduce:transition-none sm:bottom-7 sm:right-8\"\n        >\n          {open ? \"Tape it shut\" : \"Open the box\"}\n        </button>\n      </div>\n    </section>\n  );\n}\n"}]}
