{"version":3,"file":"ObsHeader.DP78-ClS.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","window","_e","de","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","init_framer_D1IzEvwH","useRouter","init_SiteWords","ROLLING_WORDS","themeFade","apply","w","toLight","swapped","gone","lift","nofx","swap","b","ObsHeader","router","routerRef","light","setLight","menu","setMenu","word","setWord","clock","setClock","font","FONT_HREF","sync","isLight","mo","tick","ti","words","wi","t2","wv","s","close","toggle","n","nav","r","routes","id","k","href","PAL","CSS","m","back","LINKS","label","here","init_ObsHeader","v"],"sources":["https:/framerusercontent.com/modules/VeyghFdK00quF5MOxWKw/BUbEViVdEU1ffFMT7u0x/ObsHeader.js"],"sourcesContent":["// The site header for the obsessions pages that draw their own full-screen scene (music, running):\n// \"Sameer Dixit's\" + the menu, the rolling word, the Delhi clock and the dark / light switch, the same as on the hub.\n// The switch saves the choice as sd-theme and sets html[data-theme] (and body[data-framer-theme]); the pages listen.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{useRouter}from\"framer\";import{ROLLING_WORDS}from\"https://framerusercontent.com/modules/XzvP9pElgrITsediKx4q/fxAdFDJRo6w2y6wJlAdO/SiteWords.js\";const LINKS=[[\"Home\",\"/\"],[\"Journey\",\"/journey\"],[\"Creations\",\"/creations\"],[\"Obsessions\",\"/obsessions\"],[\"Say hi\",\"/say-hi\"]];const FONT_HREF=\"https://fonts.googleapis.com/css2?family=Inter:wght@500&display=swap\";const CSS=`\n.obh { position: fixed; left: 24px; right: 24px; top: 18px; z-index: 2147483000; display: flex; justify-content: space-between; font: 500 15px/1.4 Inter, system-ui, sans-serif; letter-spacing: -0.02em; color: var(--obh-fg); pointer-events: none; -webkit-font-smoothing: antialiased }\n.obh > div { pointer-events: auto }\n.obh .l { display: flex; flex-direction: column; gap: 2px }\n.obh a:focus-visible, .obh button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px }\n.obh .nm { color: inherit; text-decoration: none; font-size: 1.2em; pointer-events: auto; vertical-align: middle }\n@media (pointer: coarse) { .obh .plus, .obh .tog { position: relative; touch-action: manipulation } .obh .plus::after { content: \"\"; position: absolute; inset: -10px } .obh .tog::after { content: \"\"; position: absolute; inset: -14px -8px } } .obh .r { display: flex; flex-direction: column; gap: 10px; align-items: flex-end }\n.obh .word { color: var(--obh-muted); height: 20px; position: relative; overflow: hidden; width: 220px }\n.obh .word span { position: absolute; left: 0; white-space: nowrap; transition: opacity .35s, transform .35s, filter .35s } .obh .word span.out { opacity: 0; transform: translateY(-8px); filter: blur(4px) }\n.obh .plus { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--obh-chip); margin: -4px 0 -4px 10px; font-size: 18px; vertical-align: middle; transition: transform .35s cubic-bezier(.34,1.56,.64,1) } .obh .plus.on { transform: rotate(45deg) }\n.obh .clock { color: var(--obh-muted) }\n.obh .tog { all: unset; cursor: pointer; width: 34px; height: 18px; border-radius: 999px; background: var(--obh-chip); position: relative }\n.obh .tog i { position: absolute; top: 3px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--obh-fg); transform: translateX(17px); transition: transform .35s } .obh.light .tog i { transform: translateX(3px) }\n.obh .menu { position: fixed; left: 24px; top: 64px; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 20px; min-width: 220px; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: 0 0; pointer-events: none; transition: opacity .25s, transform .35s cubic-bezier(.22,1,.36,1);\n  background: color-mix(in srgb, var(--obh-bg) 72%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--obh-faint) }\n.obh .menu.on { opacity: 1; transform: none; pointer-events: auto }\n.obh .menu a { color: var(--obh-fg); text-decoration: none; font-size: 22px; letter-spacing: -0.03em; padding: 8px 12px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center }\n.obh .menu a span { font-size: 13px; color: var(--obh-muted); letter-spacing: 0 } .obh .menu a:hover { background: var(--obh-chip) } .obh .menu a.here { color: var(--obh-muted) }\n/* the way back to the hub: a round arrow chip like the \"+\", then where you are */\n.obh .back { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--obh-fg); text-decoration: none; font-size: 14px; width: fit-content }\n.obh .back .ar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--obh-chip); font-size: 14px; transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .25s }\n.obh .back:hover .ar { transform: translateX(-4px); background: var(--obh-faint) }\n.obh .back .cur { color: var(--obh-muted) }\n@media (max-width: 560px) { .obh { left: 16px; right: 16px } .obh .word { width: 150px } .obh .menu { left: 16px; top: 58px } .obh .back { margin-top: 10px; font-size: 13px } }\n`;const PAL={dark:{\"--obh-fg\":\"#fff\",\"--obh-muted\":\"rgba(255,255,255,.62)\",\"--obh-chip\":\"rgba(255,255,255,.08)\",\"--obh-faint\":\"rgba(255,255,255,.18)\",\"--obh-bg\":\"#0A0A0A\"},light:{\"--obh-fg\":\"#0A0A0A\",\"--obh-muted\":\"rgba(0,0,0,.6)\",\"--obh-chip\":\"rgba(0,0,0,.06)\",\"--obh-faint\":\"rgba(0,0,0,.16)\",\"--obh-bg\":\"#F3F2EF\"}};export const isLight=()=>{try{const v=localStorage.getItem(\"sd-theme\");if(v)return v===\"light\";}catch{}return document.documentElement.dataset.theme===\"light\";};// the switch: a quick wash on every device. The screen dips to the new background, everything swaps underneath\n// at once, then the wash lifts (the full-page blur dissolve was too heavy over the 3D scenes)\nfunction themeFade(apply,toLight){if(matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return apply();const w=document.createElement(\"div\");w.style.cssText=\"position:fixed;inset:0;z-index:2147483647;pointer-events:none;opacity:0;background:\"+(toLight?\"#F3F2EF\":\"#0A0A0A\");document.body.appendChild(w);let swapped=false,gone=false;const lift=()=>{if(gone)return;gone=true;w.remove();};const nofx=document.createElement(\"style\");nofx.textContent=\"*,*::before,*::after{transition:none!important}\";const swap=()=>{if(swapped)return;swapped=true;document.head.appendChild(nofx);apply();requestAnimationFrame(()=>{nofx.remove();const b=w.animate([{opacity:1},{opacity:0}],{duration:260,easing:\"ease-out\",fill:\"forwards\"});b.onfinish=lift;});setTimeout(lift,500);};w.animate([{opacity:0},{opacity:1}],{duration:140,easing:\"ease-in\",fill:\"forwards\"}).onfinish=swap;setTimeout(swap,160);}export function ObsHeader({here=\"/obsessions\",back}){const router=useRouter();const routerRef=useRef(router);routerRef.current=router;const[light,setLight]=useState(false);const[menu,setMenu]=useState(false);const[word,setWord]=useState({w:\"Obsessive\",out:false});const[clock,setClock]=useState(\"Delhi\");useEffect(()=>{const font=document.createElement(\"link\");font.rel=\"stylesheet\";font.href=FONT_HREF;document.head.appendChild(font);const sync=()=>setLight(isLight());sync();const mo=new MutationObserver(sync);mo.observe(document.documentElement,{attributes:true,attributeFilter:[\"data-theme\"]});window.addEventListener(\"storage\",sync);const tick=()=>setClock(\"Delhi \\xb7 \"+new Intl.DateTimeFormat(\"en-US\",{hour:\"numeric\",minute:\"2-digit\",hour12:true,timeZone:\"Asia/Kolkata\"}).format(new Date));tick();const ti=window.setInterval(tick,3e4);const words=ROLLING_WORDS&&ROLLING_WORDS.length?ROLLING_WORDS:[\"Obsessive\"];let wi=Math.max(0,words.indexOf(\"Obsessive\")),t2=0;const wv=window.setInterval(()=>{setWord(s=>({...s,out:true}));t2=window.setTimeout(()=>{wi=(wi+1)%words.length;setWord({w:words[wi],out:false});},300);},2200);const close=e=>{if(e.key===\"Escape\")setMenu(false);};window.addEventListener(\"keydown\",close);return()=>{font.remove();mo.disconnect();window.removeEventListener(\"storage\",sync);window.removeEventListener(\"keydown\",close);clearInterval(ti);clearInterval(wv);clearTimeout(t2);};},[]);const toggle=()=>{const n=isLight()?\"dark\":\"light\";themeFade(()=>{document.documentElement.dataset.theme=n;document.body.setAttribute(\"data-framer-theme\",n);try{localStorage.setItem(\"sd-theme\",n);}catch{}setLight(n===\"light\");},n===\"light\");};const nav=(e,href)=>{const r=routerRef.current,routes=r?.routes||{};const id=Object.keys(routes).find(k=>routes[k]?.path===href);if(id&&r.navigate){e.preventDefault();setMenu(false);r.navigate(id,\"\");}};return /*#__PURE__*/_jsxs(\"div\",{className:\"obh\"+(light?\" light\":\"\"),style:PAL[light?\"light\":\"dark\"],children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsxs(\"div\",{className:\"l\",children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"a\",{className:\"nm\",href:\"/\",onClick:e=>nav(e,\"/\"),children:\"Sameer Dixit's\"}),/*#__PURE__*/_jsx(\"button\",{className:\"plus\"+(menu?\" on\":\"\"),\"aria-label\":\"Menu\",title:\"Menu\",onClick:()=>setMenu(m=>!m),children:\"+\"})]}),/*#__PURE__*/_jsx(\"div\",{className:\"word\",children:/*#__PURE__*/_jsx(\"span\",{className:word.out?\"out\":\"\",children:word.w})}),back&&/*#__PURE__*/_jsxs(\"a\",{className:\"back\",href:back.href,onClick:e=>nav(e,back.href),children:[/*#__PURE__*/_jsx(\"span\",{className:\"ar\",\"aria-hidden\":\"true\",children:\"←\"}),/*#__PURE__*/_jsx(\"span\",{children:back.label}),/*#__PURE__*/_jsxs(\"span\",{className:\"cur\",children:[\"/ \",back.current]})]})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"r\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"clock\",children:clock}),/*#__PURE__*/_jsx(\"button\",{className:\"tog\",\"aria-label\":\"Toggle theme\",title:\"Light / dark\",onClick:toggle,children:/*#__PURE__*/_jsx(\"i\",{})})]}),/*#__PURE__*/_jsx(\"nav\",{className:\"menu\"+(menu?\" on\":\"\"),children:LINKS.map(([label,href])=>/*#__PURE__*/_jsxs(\"a\",{href:href,className:href===here?\"here\":\"\",onClick:e=>nav(e,href),children:[label,\" \",/*#__PURE__*/_jsx(\"span\",{children:href===here?\"you're here\":\"↗\"})]},href))})]});}export default ObsHeader;\nexport const __FramerMetadata__ = {\"exports\":{\"isLight\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ObsHeader\":{\"type\":\"reactComponent\",\"name\":\"ObsHeader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"ObsHeader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ObsHeader.map"],"mappings":"A,0PA6BA,SAASgB,EAAU,EAAM,EAAQ,CAAC,GAAG,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAOC,EAAM,EAAE,IAAMC,EAAE,SAAS,cAAc,KAAK,EAAE,EAAE,MAAM,QAAQ,uFAAuFC,EAAQ,UAAU,WAAW,SAAS,KAAK,YAAYD,CAAC,EAAE,IAAIE,EAAQ,GAAMC,EAAK,GAAYC,MAAS,CAAID,IAAY,EAAK,GAAKH,EAAE,OAAO,EAAE,EAAQK,EAAK,SAAS,cAAc,OAAO,EAAE,EAAK,YAAY,kDAAkD,IAAMC,MAAS,CAAIJ,IAAe,EAAQ,GAAK,SAAS,KAAK,YAAYG,CAAI,EAAEN,EAAM,EAAE,0BAA0B,CAACM,EAAK,OAAO,EAAE,IAAME,EAAEP,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,OAAO,WAAW,KAAK,UAAU,CAAC,EAAE,EAAE,SAASI,CAAK,CAAC,EAAE,WAAWA,EAAK,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,OAAO,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,SAASE,EAAK,WAAWA,EAAK,GAAG,CAAE,CAAC,SAAgBE,EAAU,CAAC,OAAK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