{
  "id": "flight-path-hero",
  "kind": "element",
  "title": "Flight path hero",
  "summary": "A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.",
  "url": "https://enrichr.dev/elements/flight-path-hero.html",
  "section": "hero",
  "techniques": [
    "text-animation",
    "stagger",
    "reveal",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS",
    "SVG"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "cinematic",
    "bold"
  ],
  "intents": [
    "animated fullscreen menu overlay",
    "hamburger menu open animation",
    "split text menu links reveal",
    "travel style photo hero",
    "menu that rotates the page away"
  ],
  "status": "tested",
  "params": [
    {
      "key": "title",
      "label": "Headline",
      "type": "text",
      "value": "Take your next build somewhere new"
    },
    {
      "key": "links",
      "label": "Menu links (comma separated)",
      "type": "text",
      "value": "Home, Library, Elements, Pricing, Contact"
    },
    {
      "key": "cta",
      "label": "Nav button",
      "type": "text",
      "value": "Open library"
    },
    {
      "key": "flight",
      "label": "Plane pass (s, 0 parks it)",
      "type": "range",
      "min": 0,
      "max": 40,
      "step": 1,
      "value": 14
    },
    {
      "key": "speed",
      "label": "Menu speed",
      "type": "range",
      "min": 0.25,
      "max": 2,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "photo",
      "label": "Hero photo",
      "type": "select",
      "options": [
        [
          "corgi-1",
          "Corgi puppy on orange"
        ],
        [
          "corgi-2",
          "Corgi in a flower field"
        ],
        [
          "corgi-3",
          "Corgi on a rock"
        ],
        [
          "corgi-4",
          "Two dogs on a dirt road"
        ],
        [
          "corgi-5",
          "Corgi lying on white"
        ],
        [
          "corgi-6",
          "Corgi standing on white"
        ]
      ],
      "value": "corgi-4"
    },
    {
      "key": "accent",
      "label": "Accent",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "ink",
      "label": "Ink",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "cream",
      "label": "Cream (type and buttons)",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "tint",
      "label": "Menu glass tint",
      "type": "color",
      "value": "#050d0a"
    }
  ],
  "license": "Free to use in personal and client projects during the preview. Final licence terms will be published here before any paid tier starts; ask before reselling the code as a collection.",
  "contract": "function mount(root, opts) -> { update(partialOpts), destroy() }; root must contain the element markup",
  "exports": {
    "claude": "Add the \"Flight path hero\" element to this project.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSteps:\n1. Look at the project first to see its framework and where components, styles and static files live. Follow its conventions.\n2. Fetch https://enrichr.dev/elements/flight-path-hero.json if you can read URLs (fields: source.markup, source.css, source.js, params); otherwise use the source at the end of this message.\n3. Add the files, mount it where I tell you (default: the top of the home page), and pass the settings below as the opts.\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n5. Run the dev server and check it. with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "chatgpt": "I want the \"Flight path hero\" element on my website. Below is its complete source. Please:\n1. Build one self-contained index.html that I can open locally to see it working (put the CSS in a <style> tag and the JavaScript in a <script> tag, with the markup in the body).\n2. Then explain, step by step, which parts go where in my own site, and how to mount it. My stack is: [tell me yours, or say \"plain HTML\"].\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "cursor": "Add the \"Flight path hero\" element to this codebase.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nUse Composer / agent mode. First search the repo for how components, styles and scripts are organised, then add the files in the matching places, mount it on the page I name, and run the app to confirm it works. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nOptional: save this as .cursor/rules/enrichr-flight-path-hero.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Flight path hero element\nalwaysApply: false\n---\nmount(root, opts) expects the element markup inside root and returns { update, destroy }. Always call destroy() on unmount and never edit the ef- class names.",
    "v0": "Create a Next.js (App Router) client component for the \"Flight path hero\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- flight-path-hero.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nUse this component as the wrapper (adjust the import paths):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./flight-path-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FlightPathHero(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRender it on the home page so I can see it. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "lovable": "Add the \"Flight path hero\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- flight-path-hero.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nWrapper component (src/components/FlightPathHero.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./flight-path-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FlightPathHero(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRemove the \"use client\" line if it is not needed. Show it on the home page. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "bolt": "Create a small Vite project (vanilla JavaScript, no framework unless I already have one) that shows the \"Flight path hero\" element.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, then a script tag), style.css (the CSS below), flight-path-hero.js (the JavaScript below) and main.js that sets the container's innerHTML to the markup and calls mount(container, opts) with the settings below. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "replit": "Create a new HTML, CSS and JavaScript Repl that shows the \"Flight path hero\" element. No packages, no server code.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, link style.css, load flight-path-hero.js and then main.js), style.css (the CSS below), flight-path-hero.js (the JavaScript below), main.js (sets the container's innerHTML to the markup, then calls mount(container, opts) with the settings below). Press Run to preview. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "figma": "Designer handoff notes for the \"Flight path hero\" element (Enrichr Library). Figma cannot run this JavaScript inside a design file, so use it as a motion reference and hand the code to a developer.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nWhat it does: The menu is one timeline written as a function of its time, so pressing the button again simply runs the clock backwards, as GSAP's reverse does. Over 0.8 seconds on a power3 in-out curve the menu's clip path grows from a flat line at the top to a slanted sheet (bottom right at 120%, bottom left at 100%) while the page underneath turns 18 degrees, grows 30% and drops from its top left corner. The menu photos zoom to 110% over 1 second. From 0.2 seconds each link's letters, wrapped one by one in clipping boxes, drop from two lines above into place over 0.5 seconds, 0.01 seconds apart, on a power2 in-out curve, and the two button bars fold into a cross over 0.4 seconds on a back-out curve. Hovering or focusing a link fades every photo out over 0.5 seconds and fades that link's photo in while zooming it to 118%; leaving brings back the first photo. The headline uses the same letter drop when the hero is first seen, and each letter carries a slice of one lime-to-cream gradient so the whole headline reads as one fill. The plane follows an SVG path with getPointAtLength, turning with the curve, and the contrail is the same path drawn up to the plane with a dash offset.\nAccessibility: The menu button is a real button with aria-expanded and a label that switches between open and close. Closed, the menu is visibility: hidden, so its links are out of the tab order. Links and the headline keep their full text as an aria-label while the letter spans are hidden from screen readers. Escape closes the menu and returns focus to the button. With prefers-reduced-motion the menu opens and closes instantly, the letters do not drop, and the plane stays parked mid-arc.\n\nTunable settings:\n- Headline: text, default Take your next build somewhere new\n- Menu links (comma separated): text, default Home, Library, Elements, Pricing, Contact\n- Nav button: text, default Open library\n- Plane pass (s, 0 parks it): range 0 to 40, step 1, default 14\n- Menu speed: range 0.25 to 2, step 0.05, default 1\n- Hero photo: select (Corgi puppy on orange / Corgi in a flower field / Corgi on a rock / Two dogs on a dirt road / Corgi lying on white / Corgi standing on white), default corgi-4\n- Accent: color, default #e6ff55\n- Ink: color, default #0c1e18\n- Cream (type and buttons): color, default #fbf8f1\n- Menu glass tint: color, default #050d0a\n\nCurrent settings:\n{{SETTINGS}}\n\nFor the developer: Element contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nIn Figma:\n- Draw the resting state as a frame and the end state as a second frame; link them with Smart Animate to show the motion in a prototype.\n- Put the settings above in the frame's notes or Dev Mode annotations so the developer matches them.\n- Link https://enrichr.dev/elements/flight-path-hero.html in the handoff: the live demo and the copy-ready code are there. Developers can paste the prompts for Claude, Cursor or v0 from the Export menu.\nNothing is copied from another designer's file; this is original code from Enrichr.",
    "framer": "Add the \"Flight path hero\" element to Framer as a code component. Framer code components are React, so wrap the vanilla code like this. Check it in the Framer editor, as Framer's component API can change.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. In Framer: Assets > Code > New component. Name it FlightPathHero.\n2. Paste the JavaScript below into a separate code file named flight-path-hero.js in the same project, with  export { mount };  and  export const markup = \"<the markup string>\";  added. Put the CSS into the component as a <style> tag.\n3. Component:\n```tsx\nimport { addPropertyControls, ControlType } from \"framer\"\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./flight-path-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FlightPathHero(props: any) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n\naddPropertyControls(FlightPathHero, {\n  title: { type: ControlType.String, title: \"Headline\", defaultValue: \"Take your next build somewhere new\" },\n  links: { type: ControlType.String, title: \"Menu links (comma separated)\", defaultValue: \"Home, Library, Elements, Pricing, Contact\" },\n  cta: { type: ControlType.String, title: \"Nav button\", defaultValue: \"Open library\" },\n  flight: { type: ControlType.Number, title: \"Plane pass\", min: 0, max: 40, step: 1, defaultValue: 14 },\n  speed: { type: ControlType.Number, title: \"Menu speed\", min: 0.25, max: 2, step: 0.05, defaultValue: 1 },\n  photo: { type: ControlType.Enum, title: \"Hero photo\", options: [\"corgi-1\",\"corgi-2\",\"corgi-3\",\"corgi-4\",\"corgi-5\",\"corgi-6\"], optionTitles: [\"Corgi puppy on orange\",\"Corgi in a flower field\",\"Corgi on a rock\",\"Two dogs on a dirt road\",\"Corgi lying on white\",\"Corgi standing on white\"], defaultValue: \"corgi-4\" },\n  accent: { type: ControlType.Color, title: \"Accent\", defaultValue: \"#e6ff55\" },\n  ink: { type: ControlType.Color, title: \"Ink\", defaultValue: \"#0c1e18\" },\n  cream: { type: ControlType.Color, title: \"Cream (type and buttons)\", defaultValue: \"#fbf8f1\" },\n  tint: { type: ControlType.Color, title: \"Menu glass tint\", defaultValue: \"#050d0a\" },\n})\n```\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "webflow": "Add the \"Flight path hero\" element to a Webflow site with an Embed element. Test it on the published or preview site: scripts in embeds may not run inside the Designer canvas.\n\nThis is the \"Flight path hero\" element from the Enrichr Library: A photo hero with a gradient headline that drops in letter by letter, a plane flying a soft contrail, and a menu button that wipes a full-screen menu down while the page swings away.\nPage: https://enrichr.dev/elements/flight-path-hero.html\nMachine-readable spec: https://enrichr.dev/elements/flight-path-hero.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. Add an Embed element where it should appear. Paste a <style> block with the CSS, one container <div id=\"enrichr-flight-path-hero\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-flight-path-hero\"), { ...your settings... });\n   (set the container's innerHTML to the markup first, as in the contract).\n2. Embed elements have a size limit (check Webflow's current number). If the code is longer, host the JS and CSS as files and link them from Custom code in the page settings, then keep only the container and the mount call in the Embed.\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}"
  },
  "exportTools": [
    "claude",
    "chatgpt",
    "cursor",
    "v0",
    "lovable",
    "bolt",
    "replit",
    "figma",
    "framer",
    "webflow"
  ],
  "accessibility": "The menu button is a real button with aria-expanded and a label that switches between open and close. Closed, the menu is visibility: hidden, so its links are out of the tab order. Links and the headline keep their full text as an aria-label while the letter spans are hidden from screen readers. Escape closes the menu and returns focus to the button. With prefers-reduced-motion the menu opens and closes instantly, the letters do not drop, and the plane stays parked mid-arc.",
  "performance": "Only transforms, opacity and the clip path change. The plane and contrail sit in their own layer, so the photo underneath is never repainted. The menu glass uses a large backdrop blur, which costs most on slow phones, so it only exists while the menu is open. The plane loop pauses off screen and in hidden tabs; the menu only animates while it moves.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/bNqOjmJ",
  "source": {
    "markup": "<div class=\"ef-fph\">\n  <header class=\"ef-fph__nav\">\n    <div class=\"ef-fph__bar\">\n      <a class=\"ef-fph__logo\" href=\"#\" aria-label=\"Enrichr home\"><svg viewBox=\"0 0 50 50\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\"/></svg><span>Enrichr</span></a>\n      <button type=\"button\" class=\"ef-fph__toggle\" aria-expanded=\"false\" aria-label=\"Open menu\"><span class=\"ef-fph__line ef-fph__line--top\"></span><span class=\"ef-fph__line ef-fph__line--bot\"></span></button>\n      <a class=\"ef-fph__btn ef-fph__navbtn\" href=\"#\"><span class=\"ef-fph__btn-txt\">Open library</span><svg width=\"18\" height=\"14\" viewBox=\"0 0 18 14\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m17.76 6.857-5.727-5.688a.821.821 0 0 0-1.147.01.81.81 0 0 0-.01 1.139l4.33 4.3H.819a.821.821 0 0 0-.578.238.81.81 0 0 0 .578 1.388h14.389l-4.33 4.3a.813.813 0 0 0-.19.892.813.813 0 0 0 .765.505.824.824 0 0 0 .581-.248l5.727-5.688a.81.81 0 0 0 0-1.148Z\"/></svg></a>\n    </div>\n  </header>\n  <div class=\"ef-fph__overlay\">\n    <div class=\"ef-fph__bgs\" aria-hidden=\"true\"></div>\n    <nav class=\"ef-fph__links\" aria-label=\"Menu\">\n      <ul class=\"ef-fph__main\"></ul>\n      <ul class=\"ef-fph__socials\">\n        <li><a href=\"#\">Instagram</a></li>\n        <li><a href=\"#\">YouTube</a></li>\n        <li><a href=\"#\">GitHub</a></li>\n      </ul>\n    </nav>\n  </div>\n  <div class=\"ef-fph__page\">\n    <section class=\"ef-fph__hero\">\n      <img class=\"ef-fph__photo\" src=\"/img/library/corgi-4.jpg\" alt=\"Two dogs running down a dirt road\" decoding=\"async\">\n      <svg class=\"ef-fph__sky\" viewBox=\"0 0 1280 720\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\" focusable=\"false\">\n        <path class=\"ef-fph__trail ef-fph__trail--glow\" d=\"M-80 470 C 240 330, 560 70, 1360 -60\"/>\n        <path class=\"ef-fph__trail ef-fph__trail--core\" d=\"M-80 470 C 240 330, 560 70, 1360 -60\"/>\n        <g class=\"ef-fph__plane\">\n          <g transform=\"scale(1.35)\">\n            <path class=\"ef-fph__plane-body\" d=\"M46 0 C42 -4 32 -5.5 18 -5.5 L-28 -5.5 L-38 -18 L-45 -18 L-41 -4.5 L-46 -2 L-46 2 L-30 5.5 L18 5.5 C32 5.5 42 4 46 0 Z\"/>\n            <path class=\"ef-fph__plane-wing\" d=\"M10 1 L-8 15 L-15 15 L-6 1 Z\"/>\n            <path class=\"ef-fph__plane-wing\" d=\"M-36 -2 L-46 -9 L-49 -9 L-44 -2 Z\"/>\n            <path class=\"ef-fph__plane-win\" d=\"M30 -3 L36 -3 C38 -2.4 39 -1.6 39.6 -1 L30 -1 Z\"/>\n          </g>\n        </g>\n      </svg>\n      <div class=\"ef-fph__wrap\">\n        <h2 class=\"ef-fph__title\"></h2>\n        <div class=\"ef-fph__cta\">\n          <span class=\"ef-fph__accent\" aria-hidden=\"true\"><i></i><i></i><svg viewBox=\"0 0 50 50\" focusable=\"false\"><path fill=\"currentColor\" d=\"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\"/></svg></span>\n          <p class=\"ef-fph__txt\">From capture to rebuild, we map how a page moves. You get the details, so you can focus on making something of your own.</p>\n          <a class=\"ef-fph__btn ef-fph__ctabtn\" href=\"#\"><span class=\"ef-fph__btn-txt\">Start building</span><svg width=\"18\" height=\"14\" viewBox=\"0 0 18 14\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m17.76 6.857-5.727-5.688a.821.821 0 0 0-1.147.01.81.81 0 0 0-.01 1.139l4.33 4.3H.819a.821.821 0 0 0-.578.238.81.81 0 0 0 .578 1.388h14.389l-4.33 4.3a.813.813 0 0 0-.19.892.813.813 0 0 0 .765.505.824.824 0 0 0 .581-.248l5.727-5.688a.81.81 0 0 0 0-1.148Z\"/></svg></a>\n        </div>\n      </div>\n    </section>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-fph { --ef-fph-acc: #e6ff55; --ef-fph-ink: #0c1e18; --ef-fph-cream: #fbf8f1; --ef-fph-tint: #050d0a;\n  position: relative; flex: 1 0 auto; width: 100%; height: 100%; min-height: 36rem; box-sizing: border-box; overflow: hidden; border-radius: 1rem; isolation: isolate;\n  background: var(--ef-fph-ink); color: color-mix(in srgb, var(--ef-fph-cream) 85%, transparent); font-family: \"Instrument Sans\", system-ui, sans-serif; font-size: 18px; font-weight: 400; line-height: 23px; letter-spacing: -0.36px; container-type: inline-size; }\n.ef-fph *, .ef-fph *::before, .ef-fph *::after { box-sizing: border-box; }\n.ef-fph a { color: inherit; text-decoration: none; }\n.ef-fph ul { margin: 0; padding: 0; list-style: none; }\n.ef-fph li { margin: 0; padding: 0; opacity: 1; list-style: none; }\n\n/* nav bar */\n.ef-fph__nav { position: absolute; top: 18px; left: 0; z-index: 40; width: 100%; }\n.ef-fph__bar { max-width: 1440px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }\n.ef-fph__logo { display: flex; align-items: center; gap: 8px; color: var(--ef-fph-cream) !important; font-family: \"Parkinsans\", \"Space Grotesk\", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 0; text-shadow: 0 1px 12px rgba(5, 13, 10, 0.35); }\n.ef-fph__logo svg { width: 30px; height: 30px; display: block; color: var(--ef-fph-acc); filter: drop-shadow(0 1px 8px rgba(5, 13, 10, 0.35)); }\n.ef-fph__toggle { position: relative; width: 44px; height: 44px; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: var(--ef-fph-cream); cursor: pointer; }\n.ef-fph__line { display: block; width: 29px; height: 2px; background: var(--ef-fph-ink); transform-origin: 50% 50%; }\n.ef-fph__toggle:focus-visible, .ef-fph__btn:focus-visible, .ef-fph__logo:focus-visible { outline: 3px solid var(--ef-fph-acc); outline-offset: 3px; }\n.ef-fph__btn { display: flex; gap: 10px; padding: 14px; border-radius: 10px; background: var(--ef-fph-cream); color: var(--ef-fph-ink) !important; font-family: \"Bebas Neue\", \"Parkinsans\", sans-serif; font-size: 20px; line-height: 1; letter-spacing: 0.02em; align-items: center; justify-content: center; text-transform: uppercase; }\n.ef-fph__btn svg { display: block; flex: none; }\n\n/* overlay menu */\n.ef-fph__overlay { position: absolute; inset: 0; z-index: 30; clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); visibility: hidden; pointer-events: none; }\n.ef-fph__bgs { position: absolute; inset: 0; z-index: -1; background: var(--ef-fph-cream); pointer-events: none; }\n.ef-fph__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; display: block; }\n.ef-fph__links { width: 50%; height: 100%; padding: 44px 30px; display: flex; gap: 10px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: color-mix(in srgb, var(--ef-fph-tint) 24%, transparent); -webkit-backdrop-filter: blur(67px); backdrop-filter: blur(67px); }\n.ef-fph__main { color: var(--ef-fph-cream); font-family: \"Bebas Neue\", \"Parkinsans\", sans-serif; font-size: clamp(2rem, 4.862cqi + 0.936rem, 5.313rem); line-height: 90%; letter-spacing: -0.5px; }\n.ef-fph__main li { width: fit-content; margin: 0 auto 10px; transition: opacity 0.3s ease; }\n.ef-fph__main a { display: block; line-height: 93%; color: var(--ef-fph-cream); }\n.ef-fph__main a:focus-visible { outline: 3px solid var(--ef-fph-acc); outline-offset: 4px; }\n.ef-fph__main:has(li:hover) li:not(:hover), .ef-fph__main:has(li:focus-within) li:not(:focus-within) { opacity: 0.5; }\n.ef-fph__w { display: inline-block; white-space: nowrap; }\n.ef-fph__m { display: inline-block; overflow: clip; vertical-align: top; }\n.ef-fph__c { display: inline-block; will-change: transform; }\n.ef-fph__socials ul, .ef-fph__socials { display: flex; gap: 14px; color: var(--ef-fph-cream); font-size: clamp(1rem, 0.55cqi + 0.88rem, 1.375rem); font-weight: 600; line-height: normal; letter-spacing: -0.44px; }\n.ef-fph__socials a:hover { text-decoration: underline; }\n.ef-fph__socials a:focus-visible { outline: 3px solid var(--ef-fph-acc); outline-offset: 3px; }\n\n/* page content */\n.ef-fph__page { position: absolute; inset: 0; z-index: 1; will-change: transform; transform-origin: 0 0; }\n.ef-fph__hero { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 36px 0; overflow: hidden; background: var(--ef-fph-ink); }\n.ef-fph__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; display: block; }\n.ef-fph__hero::after { content: \"\"; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(5, 13, 10, 0.62) 0%, rgba(5, 13, 10, 0.18) 48%, rgba(5, 13, 10, 0) 70%), linear-gradient(180deg, rgba(5, 13, 10, 0.32) 0%, rgba(5, 13, 10, 0) 22%); }\n.ef-fph__sky { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; will-change: transform; }\n.ef-fph__trail { fill: none; stroke: var(--ef-fph-cream); stroke-linecap: round; }\n.ef-fph__trail--glow { stroke-width: 34; opacity: 0.13; }\n.ef-fph__trail--core { stroke-width: 4; opacity: 0.34; }\n.ef-fph__plane-body { fill: var(--ef-fph-cream); stroke: color-mix(in srgb, var(--ef-fph-ink) 55%, transparent); stroke-width: 0.8; }\n.ef-fph__plane-wing { fill: color-mix(in srgb, var(--ef-fph-cream) 82%, var(--ef-fph-ink)); stroke: color-mix(in srgb, var(--ef-fph-ink) 55%, transparent); stroke-width: 0.8; }\n.ef-fph__plane-win { fill: var(--ef-fph-ink); opacity: 0.75; }\n.ef-fph__wrap { position: relative; z-index: 2; width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }\n.ef-fph .ef-fph__title { position: relative; margin: 0; max-width: 751px; font-family: \"Bebas Neue\", \"Parkinsans\", sans-serif; font-size: clamp(2.75rem, 7.89cqi + 1rem, 8.125rem); font-weight: 400; line-height: 0.99; letter-spacing: -0.01em; text-transform: uppercase; color: var(--ef-fph-cream); opacity: 1; }\n.ef-fph__title .ef-fph__c { color: transparent; -webkit-background-clip: text; background-clip: text; background-image: linear-gradient(0deg, var(--ef-fph-acc) 0%, var(--ef-fph-cream) 100%); background-repeat: no-repeat; }\n.ef-fph__cta { z-index: 0; flex: none; max-width: 385px; padding: 22px 18px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--ef-fph-tint) 59%, transparent) 0%, color-mix(in srgb, #005236 59%, transparent) 80.77%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }\n.ef-fph__accent { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--ef-fph-cream) 92%, transparent); color: var(--ef-fph-ink); }\n.ef-fph__accent i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.45; }\n.ef-fph__accent svg { width: 24px; height: 24px; margin-left: 4px; display: block; }\n.ef-fph .ef-fph__txt { margin: 12px 0 14px; font-size: 18px; line-height: 23px; color: color-mix(in srgb, var(--ef-fph-cream) 85%, transparent); opacity: 1; max-width: none; }\n.ef-fph__ctabtn { background: var(--ef-fph-acc); font-size: 22px; }\n@container (max-width: 760px) {\n  .ef-fph__wrap { flex-direction: column; align-items: flex-start; }\n  .ef-fph__links { width: 100%; }\n  .ef-fph__navbtn { display: none; }\n}\n@media (prefers-reduced-motion: reduce) { .ef-fph__main li { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Flight path hero: a photo hero with a gradient headline, a glass call-to-action card and a small plane that flies along\n// a soft contrail arc. The menu button plays one timeline: the menu sheet wipes down from the top with a slanted clip\n// path (0.8 s, power3 in-out) while the page underneath swings away, turning 18 degrees and growing 30% from its top left\n// corner; the menu photos zoom to 110% over 1 s; each link's letters drop into place from two lines above, 0.01 s apart\n// (0.5 s, power2 in-out, starting at 0.2 s); and the two button bars fold into a cross on a back-out curve. Pressing the\n// button again plays the same timeline backwards. Hovering or focusing a link cross-fades the menu photo to that link's\n// photo and zooms it to 118%; the other links dim to half. The headline letters drop in the same way when the hero is\n// first seen. Reduced motion opens and closes the menu instantly, skips the letter drops and parks the plane mid-arc.\n// The plane loop pauses off screen and in hidden tabs. Escape closes the menu.\n// mount(root, { title, links (comma separated), cta (nav button text), flight (seconds per plane pass, 0 = parked),\n//               speed (menu timeline speed), photo (corgi-1 to corgi-6), accent, ink, cream, tint (menu glass) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-fph\");\n  var overlay = root.querySelector(\".ef-fph__overlay\");\n  var bgs = root.querySelector(\".ef-fph__bgs\");\n  var list = root.querySelector(\".ef-fph__main\");\n  var page = root.querySelector(\".ef-fph__page\");\n  var toggle = root.querySelector(\".ef-fph__toggle\");\n  var lineTop = root.querySelector(\".ef-fph__line--top\");\n  var lineBot = root.querySelector(\".ef-fph__line--bot\");\n  var title = root.querySelector(\".ef-fph__title\");\n  var photo = root.querySelector(\".ef-fph__photo\");\n  var navTxt = root.querySelector(\".ef-fph__navbtn .ef-fph__btn-txt\");\n  var plane = root.querySelector(\".ef-fph__plane\");\n  var core = root.querySelector(\".ef-fph__trail--core\");\n  var glow = root.querySelector(\".ef-fph__trail--glow\");\n  var MENU_PHOTOS = [\"corgi-3\", \"corgi-1\", \"corgi-2\", \"corgi-6\", \"corgi-5\", \"corgi-4\"];\n  var ALT = { \"corgi-1\": \"A corgi puppy against an orange wall\", \"corgi-2\": \"A corgi smiling in a field of flowers\", \"corgi-3\": \"A corgi standing on a rock outdoors\", \"corgi-4\": \"Two dogs running down a dirt road\", \"corgi-5\": \"A corgi lying on a white background\", \"corgi-6\": \"A corgi standing on a white background\" };\n  var opts = {}, imgs = [], links = [], tweens = [], raf = 0, last = 0, destroyed = false, visible = true, io = null, ro = null, offs = [];\n  var t = 0, dir = 0, T = 1, H = 1, flightClock = 0.32, titleChars = [], introT = -1, trailLen = 1;\n\n  // GSAP eases\n  function inOut(n) { return function (p) { return p < 0.5 ? Math.pow(2 * p, n) / 2 : 1 - Math.pow(2 * (1 - p), n) / 2; }; }\n  var P3IO = inOut(4), P2IO = inOut(3);\n  function backOut(c) { return function (p) { var q = 1 - p; return 1 - q * q * ((c + 1) * q - c); }; }\n  var BACK = backOut(1.5);\n  function clamp(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function esc(s) { return String(s).replace(/[&<>\"]/g, function (c) { return { \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\" }[c]; }); }\n\n  // SplitText with masks: words stay together, each letter sits in its own clipping box\n  function split(el, text) {\n    el.setAttribute(\"aria-label\", text);\n    el.innerHTML = String(text).split(/\\s+/).filter(Boolean).map(function (w) {\n      return '<span class=\"ef-fph__w\" aria-hidden=\"true\">' + Array.prototype.map.call(w, function (ch) { return '<span class=\"ef-fph__m\"><span class=\"ef-fph__c\">' + esc(ch) + \"</span></span>\"; }).join(\"\") + \"</span>\";\n    }).join(\" \");\n    return [].slice.call(el.querySelectorAll(\".ef-fph__c\"));\n  }\n\n  // hover tweens on the menu photos (opacity and scale), keyed so the newest one on a property takes over\n  function tween(key, dur, ease, get, set, to) { tweens = tweens.filter(function (x) { return x.key !== key; }); tweens.push({ key: key, s: performance.now(), d: dur * 1000, e: ease, from: get(), set: set, to: to }); kick(); }\n  function runTweens(n) {\n    for (var i = 0; i < tweens.length; i++) {\n      var w = tweens[i], p = w.d <= 0 ? 1 : clamp((n - w.s) / w.d);\n      w.set(w.from + (w.to - w.from) * w.e(p));\n      if (p >= 1) { tweens.splice(i, 1); i--; }\n    }\n  }\n  function setImg(im) { im.el.style.opacity = im.op.toFixed(3); im.el.style.transform = \"scale(\" + im.sc.toFixed(4) + \")\"; }\n  function hoverIn(index) {\n    var d = reduce ? 0 : 0.5, target = imgs[(index + 1) % imgs.length];\n    imgs.forEach(function (im, k) { if (im === target) return; tween(\"o\" + k, d, P2IO, function () { return im.op; }, function (v) { im.op = v; setImg(im); }, 0); });\n    var k = imgs.indexOf(target);\n    tween(\"o\" + k, d, P3IO, function () { return target.op; }, function (v) { target.op = v; setImg(target); }, 1);\n    tween(\"s\" + k, d, P3IO, function () { return target.sc; }, function (v) { target.sc = v; setImg(target); }, 1.18);\n  }\n  function hoverOut() {\n    var d = reduce ? 0 : 0.5;\n    imgs.forEach(function (im, k) {\n      if (k) tween(\"o\" + k, d, P2IO, function () { return im.op; }, function (v) { im.op = v; setImg(im); }, 0);\n      tween(\"s\" + k, d, P2IO, function () { return im.sc; }, function (v) { im.sc = v; setImg(im); }, 1);\n    });\n    var first = imgs[0];\n    tween(\"o0\", d, P3IO, function () { return first.op; }, function (v) { first.op = v; setImg(first); }, 1);\n  }\n\n  // The menu timeline as a pure function of its time t (seconds), so it plays the same forwards and backwards.\n  function render() {\n    var c = P3IO(clamp(t / 0.8)), z = P3IO(clamp(t / 1));\n    if (t <= 0) { overlay.style.clipPath = \"\"; }\n    else if (t >= 0.8) overlay.style.clipPath = \"none\";\n    else overlay.style.clipPath = \"polygon(0% 0%, 100% 0%, 100% \" + (120 * c).toFixed(3) + \"%, 0% \" + (100 * c).toFixed(3) + \"%)\";\n    page.style.transform = c ? \"translateY(\" + (0.4 * H * c).toFixed(2) + \"px) rotate(\" + (18 * c).toFixed(3) + \"deg) scale(\" + (1 + 0.3 * c).toFixed(4) + \")\" : \"\";\n    if (dir) imgs.forEach(function (im) { im.sc = 1 + 0.1 * z; setImg(im); });\n    links.forEach(function (chars) {\n      chars.forEach(function (ch, i) {\n        var e = P2IO(clamp((t - 0.2 - i * 0.01) / 0.5));\n        ch.style.transform = \"translateY(\" + (-200 + 200 * e).toFixed(2) + \"%)\";\n      });\n    });\n    var b = BACK(clamp((t - 0.2) / 0.4));\n    lineTop.style.transform = b ? \"translateY(\" + (4 * b).toFixed(3) + \"px) rotate(\" + (45 * b).toFixed(3) + \"deg) scaleX(\" + (1 - 0.2 * b).toFixed(4) + \")\" : \"\";\n    lineBot.style.transform = b ? \"translateY(\" + (-4 * b).toFixed(3) + \"px) rotate(\" + (-45 * b).toFixed(3) + \"deg) scaleX(\" + (1 - 0.2 * b).toFixed(4) + \")\" : \"\";\n  }\n  function setOpen(open) {\n    overlay.style.visibility = t > 0 ? \"visible\" : \"hidden\";\n    overlay.style.pointerEvents = t >= T && open ? \"auto\" : \"none\";\n    toggle.setAttribute(\"aria-expanded\", open ? \"true\" : \"false\");\n    toggle.setAttribute(\"aria-label\", open ? \"Close menu\" : \"Open menu\");\n  }\n  function play(d) {\n    dir = d;\n    if (reduce) { t = d > 0 ? T : 0; render(); imgs.forEach(function (im) { im.sc = d > 0 ? 1.1 : 1; setImg(im); }); dir = 0; setOpen(d > 0); return; }\n    overlay.style.visibility = \"visible\"; overlay.style.pointerEvents = \"none\";\n    toggle.setAttribute(\"aria-expanded\", d > 0 ? \"true\" : \"false\");\n    toggle.setAttribute(\"aria-label\", d > 0 ? \"Close menu\" : \"Open menu\");\n    kick();\n  }\n  function onToggle() { play(t >= T ? -1 : 1); }\n\n  // plane along the arc: position and heading from the path, contrail drawn up to the plane\n  function flight(p) {\n    var L = trailLen, pt = core.getPointAtLength(L * p), ahead = core.getPointAtLength(Math.min(L, L * p + 2)), back = core.getPointAtLength(Math.max(0, L * p - 2));\n    var a = Math.atan2(ahead.y - back.y, ahead.x - back.x) * 180 / Math.PI;\n    plane.setAttribute(\"transform\", \"translate(\" + pt.x.toFixed(1) + \",\" + pt.y.toFixed(1) + \") rotate(\" + a.toFixed(2) + \")\");\n    var fade = p > 0.85 ? 1 - (p - 0.85) / 0.15 : p < 0.04 ? p / 0.04 : 1;\n    core.style.strokeDashoffset = (L * (1 - p)).toFixed(1); glow.style.strokeDashoffset = (L * (1 - p)).toFixed(1);\n    core.style.opacity = (0.34 * fade).toFixed(3); glow.style.opacity = (0.13 * fade).toFixed(3);\n    plane.style.opacity = p > 0.96 ? ((1 - p) / 0.04).toFixed(3) : p < 0.02 ? (p / 0.02).toFixed(3) : \"1\";\n  }\n  function titleIntro(n) {\n    var e = (n - introT) / 1000, done = true;\n    titleChars.forEach(function (ch, i) {\n      var p = clamp((e - i * 0.01) / 0.5); if (p < 1) done = false;\n      ch.style.transform = p >= 1 ? \"\" : \"translateY(\" + (-200 + 200 * P2IO(p)).toFixed(2) + \"%)\";\n    });\n    if (done) introT = -2;\n  }\n\n  function kick() { if (!raf && !destroyed) { last = performance.now(); raf = requestAnimationFrame(loop); } }\n  function loop(n) {\n    raf = 0;\n    var dt = Math.min(0.05, (n - last) / 1000 || 0); last = n;\n    var more = false;\n    if (dir) {\n      t += dt * dir * opts.speed;\n      if (t >= T) { t = T; render(); dir = 0; setOpen(true); }\n      else if (t <= 0) { t = 0; render(); dir = 0; setOpen(false); }\n      else { render(); more = true; }\n    }\n    if (tweens.length) { runTweens(n); more = more || tweens.length > 0; }\n    if (introT >= 0) { titleIntro(n); more = more || introT >= 0; }\n    if (!reduce && opts.flight > 0 && visible && !document.hidden) { flightClock = (flightClock + dt / opts.flight) % 1; flight(flightClock); more = true; }\n    if (more) raf = requestAnimationFrame(loop);\n  }\n\n  function on(el, type, f) { el.addEventListener(type, f); offs.push(function () { el.removeEventListener(type, f); }); }\n  var linkOffs = [];\n  function buildLinks() {\n    linkOffs.forEach(function (f) { f(); }); linkOffs = [];\n    list.textContent = \"\"; links = [];\n    var names = String(opts.links).split(\",\").map(function (s) { return s.trim(); }).filter(Boolean).slice(0, 8);\n    names.forEach(function (name, i) {\n      var li = document.createElement(\"li\"), a = document.createElement(\"a\"); a.href = \"#\";\n      links.push(split(a, name.toUpperCase()));\n      li.appendChild(a); list.appendChild(li);\n      var enter = function () { hoverIn(i); }, leave = function () { hoverOut(); };\n      li.addEventListener(\"mouseenter\", enter); li.addEventListener(\"mouseleave\", leave);\n      a.addEventListener(\"focus\", enter); a.addEventListener(\"blur\", leave);\n      linkOffs.push(function () { li.removeEventListener(\"mouseenter\", enter); li.removeEventListener(\"mouseleave\", leave); a.removeEventListener(\"focus\", enter); a.removeEventListener(\"blur\", leave); });\n    });\n    var longest = links.reduce(function (m, c) { return Math.max(m, c.length); }, 1);\n    T = Math.max(1, 0.2 + 0.5 + 0.01 * (longest - 1));\n    bgs.textContent = \"\"; imgs = [];\n    for (var k = 0; k < names.length + 1; k++) {\n      var im = document.createElement(\"img\"); im.className = \"ef-fph__bg\"; im.alt = \"\"; im.decoding = \"async\";\n      im.src = \"/img/library/\" + MENU_PHOTOS[k % MENU_PHOTOS.length] + \".jpg\";\n      bgs.appendChild(im);\n      var rec = { el: im, op: k ? 0 : 1, sc: t > 0 ? 1 + 0.1 * P3IO(clamp(t)) : 1 }; setImg(rec); imgs.push(rec);\n    }\n    render();\n  }\n  function shadeTitle() {\n    var h = title.offsetHeight || 1;\n    titleChars.forEach(function (ch) {\n      var top = ch.parentNode.offsetTop;\n      ch.style.backgroundSize = \"100% \" + h + \"px\";\n      ch.style.backgroundPosition = \"0 \" + (-top) + \"px\";\n    });\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ title: \"Take your next build somewhere new\", links: \"Home, Library, Elements, Pricing, Contact\", cta: \"Open library\", flight: 14, speed: 1, photo: \"corgi-4\", accent: \"#e6ff55\", ink: \"#0c1e18\", cream: \"#fbf8f1\", tint: \"#050d0a\" }, opts, next || {});\n    opts.flight = Math.max(0, num(opts.flight, 14)); opts.speed = Math.max(0.2, num(opts.speed, 1));\n    [\"accent\", \"ink\", \"cream\", \"tint\"].forEach(function (k) { box.style.setProperty(\"--ef-fph-\" + (k === \"accent\" ? \"acc\" : k), opts[k]); });\n    navTxt.textContent = opts.cta;\n    var ph = /^corgi-[1-6]$/.test(opts.photo) ? opts.photo : \"corgi-4\";\n    if (photo.getAttribute(\"src\") !== \"/img/library/\" + ph + \".jpg\") { photo.src = \"/img/library/\" + ph + \".jpg\"; photo.alt = ALT[ph]; }\n    if (opts.title !== prev.title) { titleChars = split(title, opts.title); shadeTitle(); }\n    if (opts.links !== prev.links) buildLinks();\n    if (reduce || !opts.flight) flight(0.5);\n    kick();\n  }\n\n  trailLen = core.getTotalLength() || 1;\n  core.style.strokeDasharray = glow.style.strokeDasharray = trailLen.toFixed(1);\n  H = Math.max(1, box.clientHeight);\n  update(o);\n  on(toggle, \"click\", onToggle);\n  on(box, \"keydown\", function (e) { if (e.key === \"Escape\" && t > 0 && dir >= 0) { play(-1); toggle.focus(); } });\n  if (!reduce) { titleChars.forEach(function (ch) { ch.style.transform = \"translateY(-200%)\"; }); }\n  if (\"IntersectionObserver\" in window) {\n    io = new IntersectionObserver(function (e) {\n      visible = e[0].isIntersecting;\n      if (visible && introT === -1 && !reduce) introT = performance.now();\n      if (visible) kick();\n    }); io.observe(box);\n  } else if (!reduce) introT = performance.now();\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (destroyed) return; H = Math.max(1, box.clientHeight); shadeTitle(); render(); }); ro.observe(box); ro.observe(title); }\n  if (document.fonts && document.fonts.ready) document.fonts.ready.then(function () { if (!destroyed) shadeTitle(); });\n  kick();\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf); tweens = [];\n      offs.forEach(function (f) { f(); }); offs = [];\n      linkOffs.forEach(function (f) { f(); }); linkOffs = [];\n      if (io) io.disconnect(); if (ro) ro.disconnect();\n    }\n  };\n}"
  }
}