{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"heat-shimmer-desert-gradient-background","type":"registry:block","title":"Heat Shimmer Desert Gradient","description":"","dependencies":[],"files":[{"path":"components/we-inc/heat-shimmer-desert-gradient-background.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\n// How far the heat bends the horizon, and how long one shimmer cycle takes.\nconst BEND = 10;\nconst SHIMMER = \"8s\";\n\nconst MESAS = \"M-20 386 L130 386 L158 356 L262 352 L284 386 L560 386 L586 370 L640 368 L662 386 L960 386 L992 344 L1146 338 L1172 386 L1460 386 L1460 392 L-20 392 Z\";\nconst MIRAGE = \"M-20 392 L130 392 L158 414 L262 418 L284 392 L560 392 L586 404 L640 406 L662 392 L960 392 L992 424 L1146 430 L1172 392 L1460 392 Z\";\n\nconst css = `\n.hts-grain{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23g%29'/%3E%3C/svg%3E\");mix-blend-mode:multiply;opacity:.3}\n`;\n\nexport default function HeatShimmerDesertGradient() {\n  const rootRef = useRef<HTMLElement>(null);\n  const svgRef = useRef<SVGSVGElement>(null);\n\n  // The shimmer is an SVG animation: stop it for reduced motion and pause it off screen.\n  useEffect(() => {\n    const root = rootRef.current;\n    const svg = svgRef.current;\n    if (!root || !svg) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n      svg.pauseAnimations();\n      return;\n    }\n    const io = new IntersectionObserver(([entry]) => (entry.isIntersecting ? svg.unpauseAnimations() : svg.pauseAnimations()));\n    io.observe(root);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section ref={rootRef} className=\"relative isolate flex min-h-[640px] items-start overflow-hidden bg-[#f1dfc0]\">\n      <style>{css}</style>\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 -z-10\">\n        <svg ref={svgRef} className=\"absolute inset-0 block h-full w-full\" viewBox=\"0 0 1440 640\" preserveAspectRatio=\"xMidYMax slice\">\n          <defs>\n            <linearGradient id=\"hts-air\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n              <stop offset=\"0\" stopColor=\"#efe3cc\" />\n              <stop offset=\".45\" stopColor=\"#f4dfba\" />\n              <stop offset=\".72\" stopColor=\"#f6d6a4\" />\n            </linearGradient>\n            <linearGradient id=\"hts-ground\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n              <stop offset=\"0\" stopColor=\"#e9c08c\" />\n              <stop offset=\".35\" stopColor=\"#d49a62\" />\n              <stop offset=\"1\" stopColor=\"#a86a3c\" />\n            </linearGradient>\n            <radialGradient id=\"hts-glare\" cx=\".5\" cy=\".5\" r=\".5\">\n              <stop offset=\"0\" stopColor=\"#fffaf0\" stopOpacity=\".95\" />\n              <stop offset=\".4\" stopColor=\"#fff3dc\" stopOpacity=\".45\" />\n              <stop offset=\"1\" stopColor=\"#fff3dc\" stopOpacity=\"0\" />\n            </radialGradient>\n            <filter id=\"hts-wobble\" x=\"-2%\" y=\"-20%\" width=\"104%\" height=\"140%\">\n              <feTurbulence type=\"fractalNoise\" baseFrequency=\".004 .07\" numOctaves={2} seed={4} result=\"air\">\n                <animate attributeName=\"baseFrequency\" dur={SHIMMER} values=\".004 .07;.005 .085;.004 .07\" repeatCount=\"indefinite\" />\n              </feTurbulence>\n              <feDisplacementMap in=\"SourceGraphic\" in2=\"air\" scale={BEND} xChannelSelector=\"R\" yChannelSelector=\"G\" />\n            </filter>\n          </defs>\n          <rect width=\"1440\" height=\"640\" fill=\"url(#hts-air)\" />\n          <circle cx=\"1060\" cy=\"90\" r=\"320\" fill=\"url(#hts-glare)\" />\n          <g transform=\"translate(0 92)\">\n          <g filter=\"url(#hts-wobble)\">\n            <rect x=\"-20\" y=\"384\" width=\"1480\" height=\"200\" fill=\"url(#hts-ground)\" />\n            <path d={MESAS} fill=\"#cf9a6c\" opacity=\".45\" />\n            <path d={MIRAGE} fill=\"#f6dcb2\" opacity=\".5\" />\n            <rect x=\"-20\" y=\"372\" width=\"1480\" height=\"30\" fill=\"#f8dfb6\" opacity=\".55\" />\n            </g>\n          </g>\n        </svg>\n        <div className=\"hts-grain absolute inset-0\" />\n      </div>\n      <div className=\"mx-auto w-full max-w-5xl px-6 pb-[200px] pt-[88px] sm:px-10 sm:pb-[210px] sm:pt-[96px]\">\n        <p className=\"text-[13px] font-bold uppercase tracking-[0.18em] text-[#8a4a1e]\">Saltpan Overland</p>\n        <h1 className=\"mt-4 max-w-[42rem] text-[32px] font-bold leading-[1.08] tracking-tight text-[#2b1a0c] sm:text-[56px]\">Three days across the dry lakes, with camp set before dusk.</h1>\n        <p className=\"mt-[18px] max-w-[32rem] text-lg leading-relaxed text-[#4d3420]\">Guided four-wheel-drive trips for up to eight people. We carry the water, the shade and the spare tyres.</p>\n        <a href=\"#\" className=\"mt-7 inline-flex h-12 items-center rounded-lg bg-[#2b1a0c] px-6 text-[15px] font-semibold text-[#fbefdc] hover:bg-[#4a2d16] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2b1a0c] focus-visible:ring-offset-2 focus-visible:ring-offset-[#f1dfc0]\">See the route</a>\n      </div>\n    </section>\n  );\n}\n"}]}
