{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"thin-arrow-sliding-down-vertical-rule-on-photo-hero","type":"registry:block","title":"Thin Arrow Sliding Down a Vertical Rule on Photo Hero","description":"","dependencies":[],"files":[{"path":"components/we-inc/thin-arrow-sliding-down-vertical-rule-on-photo-hero.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\n// Change these first: --m5rul-loop (one slide of the arrow), --m5rul-sun (arrow and number colour), the 86px travel in m5rul-run (keep it under the rule height), --m5rul-box (frame height).\n// Same markup, styles and script as the plain HTML version.\nconst CSS = `\n.m5rul { position: relative; box-sizing: border-box; height: var(--m5rul-box); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; font-family: \"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif; -webkit-font-smoothing: antialiased; }\n/* To use on a real page: delete height and overflow above, make the hero 100vh, and set BOX = null in the script. */\n.m5rul *, .m5rul *::before, .m5rul *::after { box-sizing: border-box; }\n.m5rul:focus-visible { outline: 3px solid var(--m5rul-focus); outline-offset: -3px; }\n.m5rul [tabindex=\"-1\"]:focus { outline: none; }\n.m5rul-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n.m5rul-hint { position: sticky; top: 0; height: 0; z-index: 6; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }\n.m5rul-hint span { margin: 10px 0 0; padding: 4px 11px; border-radius: 999px; background: var(--m5rul-hintbg); color: var(--m5rul-hintfg); font-size: 11.5px; letter-spacing: .04em; transition: opacity .5s ease; }\n.m5rul[data-touched] .m5rul-hint span { opacity: 0; }\n@media (max-width: 600px) { .m5rul-hint { justify-content: flex-end; } .m5rul-hint span { margin-right: 10px; } }\n.m5rul-hero { position: relative; min-height: var(--m5rul-box); }\n.m5rul-cue { -webkit-tap-highlight-color: transparent; transition: opacity .45s ease, transform .45s ease, visibility 0s linear 0s; }\n.m5rul-cue:focus-visible { outline: 2px solid var(--m5rul-focus); outline-offset: 4px; }\n/* Faded once the marker below the hero is in view; the loop is paused while hidden or off screen. */\n.m5rul[data-gone] .m5rul-cue { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }\n.m5rul[data-gone] .m5rul-cue *, .m5rul[data-off] .m5rul-cue * { animation-play-state: paused !important; }\n.m5rul-mark { height: 1px; margin-bottom: -1px; }\n/* Reduced motion: the cue stands still at full strength and the link jumps instead of gliding. */\n@media (prefers-reduced-motion: reduce) {\n  .m5rul *, .m5rul *::before, .m5rul *::after { animation: none !important; transition: none !important; }\n}\n.m5rul { --m5rul-box: 620px; --m5rul-bg: #12202a; --m5rul-ink: #ffffff; --m5rul-quiet: #d8e0e3; --m5rul-sun: #f0c674; --m5rul-focus: #ffffff; --m5rul-hintbg: rgba(18,32,42,.72); --m5rul-hintfg: #fff; --m5rul-loop: 2.8s;\n  background: var(--m5rul-bg); color: var(--m5rul-ink); }\n.m5rul-hero { overflow: hidden; display: flex; flex-direction: column; padding: 26px clamp(20px, 5vw, 60px) 40px; }\n.m5rul-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }\n.m5rul-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,20,27,.88) 0%, rgba(10,20,27,.5) 42%, rgba(10,20,27,0) 70%), linear-gradient(180deg, rgba(10,20,27,.45), rgba(10,20,27,0) 22%); }\n.m5rul-brand, .m5rul-low { position: relative; }\n.m5rul-brand { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }\n.m5rul-low { margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 40px; }\n.m5rul-cue { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 4px 6px 4px 0; color: var(--m5rul-ink); text-decoration: none; }\n.m5rul-rule { width: 16px; height: 120px; display: block; overflow: visible; }\n.m5rul-rule path { fill: none; stroke-linecap: round; stroke-linejoin: round; }\n.m5rul-track { stroke: rgba(255,255,255,.35); stroke-width: 1; }\n.m5rul-head path { stroke: var(--m5rul-sun); stroke-width: 1.8; }\n.m5rul-head { transform-box: view-box; animation: m5rul-run var(--m5rul-loop) cubic-bezier(.55,0,.3,1) infinite; }\n.m5rul-label { display: flex; flex-direction: column; gap: 4px; max-width: 8em; font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: .02em; }\n.m5rul-num { color: var(--m5rul-sun); font-size: 11px; letter-spacing: .16em; }\n.m5rul-cue:hover .m5rul-label { text-decoration: underline; text-underline-offset: 4px; }\n/* The arrow slides down the thin rule, fades near the end, then comes back in at the top. */\n@keyframes m5rul-run {\n  0% { transform: translateY(0); opacity: 0; }\n  12%, 62% { opacity: 1; }\n  80% { transform: translateY(86px); opacity: 0; }\n  100% { transform: translateY(86px); opacity: 0; }\n}\n.m5rul-copy { max-width: 560px; padding-bottom: 4px; }\n.m5rul-eyebrow { margin: 0 0 12px; color: var(--m5rul-sun); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }\n.m5rul-h { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 700; line-height: 1; letter-spacing: -.03em; }\n.m5rul-lede { margin: 16px 0 0; max-width: 30em; color: var(--m5rul-quiet); font-size: 16px; line-height: 1.6; }\n.m5rul-next { padding: 60px clamp(20px, 5vw, 60px) 76px; background: #eef2f1; color: #14232c; }\n.m5rul-h2 { margin: 0 0 22px; font-size: 30px; letter-spacing: -.02em; }\n.m5rul-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 28px; }\n.m5rul-list li { padding: 18px 0; border-top: 2px solid #14232c; }\n.m5rul-list h3 { margin: 0; font-size: 17px; }\n.m5rul-list p { margin: 6px 0 0; color: #455760; font-size: 15px; line-height: 1.55; }\n@media (max-width: 640px) {\n  .m5rul-low { grid-template-columns: 1fr; gap: 26px; }\n  .m5rul-cue { order: 2; flex-direction: row; align-items: center; }\n  .m5rul-rule { height: 72px; }\n  .m5rul-head { animation-name: m5rul-run-short; }\n  .m5rul-label { max-width: none; }\n}\n@keyframes m5rul-run-short { 0% { transform: translateY(0); opacity: 0; } 12%, 60% { opacity: 1; } 80%, 100% { transform: translateY(40px); opacity: 0; } }\n@media (prefers-reduced-motion: reduce) { .m5rul-head { opacity: 1; transform: translateY(40px); } }\n`;\n\nexport default function ThinArrowSlidingDownVerticalRule() {\n  const rootRef = useRef<any>(null);\n\n  // Fades the cue when a marker below the hero scrolls into view, pauses the loop off screen,\n  // and glides to the next section on click (a plain jump when reduced motion is requested).\n  useEffect(() => {\n    const root: any = rootRef.current;\n    if (!root) return;\n    var off = [];\n    var BOX = root; // the scrolling box; set to null when the hero is on the page itself\n    var cue = root.querySelector(\".m5rul-cue\"), mark = root.querySelector(\".m5rul-mark\");\n    var reduce = matchMedia(\"(prefers-reduced-motion: reduce)\");\n    function on(el, n, f, o) { el.addEventListener(n, f, o); off.push(function () { el.removeEventListener(n, f, o); }); }\n    function watch(cb, opts, el) { var o = new IntersectionObserver(cb, opts); o.observe(el); off.push(function () { o.disconnect(); }); }\n    // Fade the cue once the marker just below the hero comes into view (or has gone past the top).\n    watch(function (es) {\n      var e = es[0], top = e.rootBounds ? e.rootBounds.top : 0;\n      root.toggleAttribute(\"data-gone\", e.isIntersecting || e.boundingClientRect.top < top);\n    }, { root: BOX, rootMargin: \"0px 0px -12% 0px\" }, mark);\n    // Pause the loop while the whole piece is off screen.\n    watch(function (es) { root.toggleAttribute(\"data-off\", !es[0].isIntersecting); }, {}, root);\n    on(BOX || window, \"scroll\", function () { root.setAttribute(\"data-touched\", \"\"); }, { passive: true, once: true });\n    function go(ev) {\n      var t = root.querySelector(cue.getAttribute(\"href\"));\n      if (!t) return;\n      ev.preventDefault();\n      var y = BOX ? t.getBoundingClientRect().top - BOX.getBoundingClientRect().top + BOX.scrollTop : t.getBoundingClientRect().top + scrollY;\n      (BOX || window).scrollTo({ top: y, behavior: reduce.matches ? \"auto\" : \"smooth\" });\n      t.focus({ preventScroll: true });\n    }\n    on(cue, \"click\", go);\n    return () => off.forEach((f: any) => f());\n  }, []);\n\n  return (\n    <section ref={rootRef} className=\"m5rul\" data-m5rul=\"\" tabIndex=\"0\" aria-label=\"Ridgeback Walking first screen, scrollable\">\n      <style>{CSS}</style>\n      <div className=\"m5rul-hint\" aria-hidden=\"true\"><span>Scroll inside</span></div>\n      <header className=\"m5rul-hero\">\n        <img className=\"m5rul-photo\" src=\"https://images.pexels.com/photos/19273401/pexels-photo-19273401.jpeg?auto=compress&cs=tinysrgb&w=1600\" alt=\"A grassy mountain ridge in early morning light with a narrow footpath along its crest\" width=\"1600\" height=\"900\" />\n        <div className=\"m5rul-shade\" aria-hidden=\"true\"></div>\n        <p className=\"m5rul-brand\">Ridgeback Walking</p>\n        <div className=\"m5rul-low\">\n          <a className=\"m5rul-cue\" href=\"#m5rul-next\">\n            <svg className=\"m5rul-rule\" viewBox=\"0 0 16 120\" aria-hidden=\"true\" focusable=\"false\">\n              <path className=\"m5rul-track\" d=\"M8 2V118\" />\n              <g className=\"m5rul-head\"><path d=\"M8 4V30\" /><path d=\"M3.5 25.5L8 30l4.5-4.5\" /></g>\n            </svg>\n            <span className=\"m5rul-label\"><span className=\"m5rul-num\">01</span>Routes for this season</span>\n          </a>\n          <div className=\"m5rul-copy\">\n            <p className=\"m5rul-eyebrow\">Guided hill days, small groups</p>\n            <h1 className=\"m5rul-h\">Follow the ridge, not the crowd.</h1>\n            <p className=\"m5rul-lede\">Full-day walks led by local guides who know where the path forks and when the weather turns. Lunch is carried; maps are ours.</p>\n          </div>\n        </div>\n      </header>\n      <div className=\"m5rul-mark\" aria-hidden=\"true\"></div>\n      <section className=\"m5rul-next\" id=\"m5rul-next\" tabIndex=\"-1\" aria-labelledby=\"m5rul-routes\">\n        <h2 className=\"m5rul-h2\" id=\"m5rul-routes\">Routes for this season</h2>\n        <ul className=\"m5rul-list\">\n          <li><h3>The long crest</h3><p>Eighteen kilometres along the main ridge, steady climbs, open views most of the way.</p></li>\n          <li><h3>Two tarns loop</h3><p>A shorter circuit past two mountain lakes, good for a first hill day.</p></li>\n          <li><h3>Dawn summit</h3><p>An early start with head torches to reach the top as the light comes up.</p></li>\n        </ul>\n      </section>\n    </section>\n  );\n}\n"}]}
