{"version":3,"file":"JJNotebook.BdTjXnZF.mjs","names":["React.useRef","React.useState","__esmMin","window","init_npm_react_18_3_1","init_ssg_sandbox_shims","_e","de","p","c","init_jsx_runtime","ce","RenderTarget","addPropertyControls","init_framer_BpuvUAiZ","ControlType","init_JJSound","jjSfx","JJNotebook","props","canvas","smooth","me","ref","box","frameName","armed","shown","locked","endT","raf","seen","visibleCards","cardClass","natural","top","bottom","k","cs","css","outer","release","check","live","vis","fresh","vh","r","d","step","target","kick","ro","watch","mo","arm","h","setH","w","setW","el","n","narrow","line","margin","style","CSS","PHONE","holes","init_JJNotebook","frame"],"sources":["https:/framerusercontent.com/modules/QjRncMumKSOLzdYVX2n9/a2ifDm5esxK6jzv02MUC/JJNotebook.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{jjSfx}from\"https://framerusercontent.com/modules/lPSm1wyhyclo9tp2yS83/t5mSxIjJMHL0lVikerVy/JJSound.js\";// The paper of JJ's notebook, drawn behind the blog: warm ruled lines, a red margin line, ring holes down the left\n// edge with little rings through them, and two pages peeking out underneath. Put it inside the notebook frame,\n// absolute and filling it, behind the content.\n// It also smooths the notebook when a tab, search or page changes what's in it: the frame eases to its new height\n// instead of snapping (so the page below glides), and cards that newly appear pop in one after another.\n// Only after someone touches the notebook, so loading images on first visit don't animate. Reduced motion: off.\nconst CSS=[\".jjnb{position:absolute;inset:0;pointer-events:none}\",\".jjnb-under{position:absolute;inset:0;border-radius:30px;background:#F6EEDD;box-shadow:0 0 0 1px #EADBC1}\",\".jjnb-under.a{transform:translate(10px,12px) rotate(.6deg)}.jjnb-under.b{transform:translate(18px,22px) rotate(1.2deg);background:#EFE3CB}\",\".jjnb-page{position:absolute;inset:0;border-radius:30px;overflow:hidden;background:#FFFDF6;box-shadow:0 0 0 1px #EADBC1,0 40px 60px -40px rgba(57,20,44,.45)}\",\".jjnb-lines{position:absolute;inset:0;background-image:repeating-linear-gradient(180deg,transparent 0,transparent 35px,rgba(120,170,210,.22) 35px,rgba(120,170,210,.22) 36px);background-position:0 70px}\",\".jjnb-margin{position:absolute;top:0;bottom:0;width:2px;background:rgba(237,102,89,.45)}\",\".jjnb-hole{position:absolute;width:16px;height:16px;border-radius:50%;background:#EEF6FC;box-shadow:inset 0 2px 3px rgba(57,20,44,.25)}\",\".jjnb-ring{position:absolute;width:22px;height:12px;border:3px solid #C9C2CE;border-right:0;border-radius:12px 0 0 12px;box-shadow:-1px 1px 0 rgba(255,255,255,.7) inset}\"].join(\"\\n\");// PHONE: the notebook frame's padding on phones (pages have one Desktop breakpoint, so it's set from here)\nconst PHONE=frame=>'\\n@media (max-width:640px){[data-framer-name=\"'+frame+'\"]{padding:50px 18px 50px 42px !important}}';/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any */export default function JJNotebook(props){const{margin=34,holes=true,smooth=true,frameName=\"Pages\",cardClass=\"jjnc\",style}=props;const canvas=RenderTarget.current()===RenderTarget.canvas;React.useEffect(()=>{if(canvas||!smooth||typeof ResizeObserver===\"undefined\")return;if(window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const me=ref.current;const box=me&&me.closest('[data-framer-name=\"'+frameName+'\"]')||me&&me.parentElement&&me.parentElement.parentElement;if(!box)return;const EASE=\"cubic-bezier(.22,1,.36,1)\",MS=520;let armed=0,shown=box.offsetHeight,locked=false,endT=0,raf=0;let seen=new WeakSet;const visibleCards=()=>Array.from(box.querySelectorAll(\".\"+cardClass)).filter(c=>c.offsetParent!==null);visibleCards().forEach(c=>seen.add(c));// the natural height: bottom of the last in-flow child plus the bottom padding\nconst natural=()=>{const top=box.getBoundingClientRect().top;let bottom=0;for(const k of Array.from(box.children)){const cs=getComputedStyle(k);if(cs.position===\"absolute\"||cs.position===\"fixed\"||cs.display===\"none\")continue;bottom=Math.max(bottom,k.getBoundingClientRect().bottom-top+(parseFloat(cs.marginBottom)||0));}return Math.round(bottom+(parseFloat(getComputedStyle(box).paddingBottom)||0));};// heights here are outer heights; convert if the frame sizes its content box\nconst css=outer=>{const cs=getComputedStyle(box);if(cs.boxSizing!==\"content-box\")return outer+\"px\";return Math.max(0,outer-(parseFloat(cs.paddingTop)||0)-(parseFloat(cs.paddingBottom)||0)-(parseFloat(cs.borderTopWidth)||0)-(parseFloat(cs.borderBottomWidth)||0))+\"px\";};const release=()=>{box.style.transition=\"\";box.style.height=\"\";locked=false;shown=box.offsetHeight;};const check=()=>{const now=performance.now(),live=now<armed;// cards that just appeared pop in, one after another\nconst vis=visibleCards(),fresh=vis.filter(c=>!seen.has(c));vis.forEach(c=>seen.add(c));if(live&&fresh.length){const vh=window.innerHeight;let k=0;for(const c of fresh){const r=c.getBoundingClientRect();if(r.top>vh+40||r.bottom<-40)continue;const d=Math.min(k,8)*70;c.animate([{opacity:0,transform:\"translateY(28px) scale(.95)\"},{opacity:1,transform:\"none\"}],{duration:560,delay:d,easing:\"cubic-bezier(.34,1.4,.64,1)\",fill:\"backwards\"});const step=k;if(step<6)window.setTimeout(()=>jjSfx(\"pip\",step),d+120);k++;}}const target=natural();if(!live){if(!locked)shown=target;return;}if(Math.abs(target-shown)<2&&!locked)return;if(!locked){// hold the old height for this frame, then ease to the new one\nbox.style.transition=\"none\";box.style.height=css(shown);void box.offsetHeight;locked=true;}box.style.transition=\"height \"+MS+\"ms \"+EASE;box.style.height=css(target);shown=target;window.clearTimeout(endT);endT=window.setTimeout(release,MS+60);};const kick=()=>{cancelAnimationFrame(raf);check();raf=requestAnimationFrame(check);};const ro=new ResizeObserver(kick);const watch=()=>{ro.disconnect();Array.from(box.children).forEach(k=>{if(getComputedStyle(k).position!==\"absolute\")ro.observe(k);});};watch();const mo=new MutationObserver(()=>{watch();kick();});mo.observe(box,{childList:true,subtree:true,attributes:true,attributeFilter:[\"data-jjpg-off\"]});const arm=()=>{armed=performance.now()+1600;};box.addEventListener(\"pointerdown\",arm,true);box.addEventListener(\"keydown\",arm,true);box.addEventListener(\"input\",arm,true);return()=>{ro.disconnect();mo.disconnect();cancelAnimationFrame(raf);window.clearTimeout(endT);box.removeEventListener(\"pointerdown\",arm,true);box.removeEventListener(\"keydown\",arm,true);box.removeEventListener(\"input\",arm,true);release();};},[canvas,smooth,frameName,cardClass]);const ref=React.useRef(null);const[h,setH]=React.useState(1200);const[w,setW]=React.useState(1e3);React.useEffect(()=>{const el=ref.current;if(!el||typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(()=>{setH(el.offsetHeight);setW(el.offsetWidth);});ro.observe(el);setH(el.offsetHeight);setW(el.offsetWidth);return()=>ro.disconnect();},[]);const n=Math.max(1,Math.floor((h-100)/120)+1);// on phones the margin line moves in, so the words get the room (the frame's padding follows, see PHONE)\nconst narrow=w<600;const line=narrow?Math.min(margin,28):margin;return /*#__PURE__*/_jsxs(\"div\",{ref:ref,className:\"jjnb\",\"aria-hidden\":\"true\",style:{...style},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:(CSS+PHONE(frameName)).replace(/</g,\"\\\\3c \")}}),/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-under b\"}),/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-under a\"}),/*#__PURE__*/_jsxs(\"div\",{className:\"jjnb-page\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-lines\"}),/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-margin\",style:{left:line}}),holes&&Array.from({length:n},(_,k)=>/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-hole\",style:{left:narrow?6:10,top:60+k*120}},k))]}),holes&&Array.from({length:n},(_,k)=>/*#__PURE__*/_jsx(\"div\",{className:\"jjnb-ring\",style:{left:-6,top:62+k*120}},\"r\"+k))]});}addPropertyControls(JJNotebook,{margin:{type:ControlType.Number,title:\"Margin line\",defaultValue:34,min:0,max:200,unit:\"px\"},holes:{type:ControlType.Boolean,title:\"Ring holes\",defaultValue:true},smooth:{type:ControlType.Boolean,title:\"Smooth changes\",defaultValue:true},frameName:{type:ControlType.String,title:\"Frame layer\",defaultValue:\"Pages\",hidden:p=>!p.smooth},cardClass:{type:ControlType.String,title:\"Card class\",defaultValue:\"jjnc\",hidden:p=>!p.smooth}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"JJNotebook\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./JJNotebook.map"],"mappings":"A,6QAQsC,SAAwBkB,EAAW,EAAM,CAAC,GAAK,CAAC,SAAO,GAAG,QAAM,GAAK,SAAO,GAAK,YAAU,QAAQ,YAAU,OAAO,SAAOC,EAAYC,EAAOR,EAAa,QAAQ,IAAIA,EAAa,OAAOD,MAAoB,CAAgE,GAA5DS,GAAQ,CAACC,GAAQ,OAAO,eAAiB,KAAsBlB,EAAO,YAAYA,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAO,IAAMmB,EAAGC,EAAI,QAAcC,EAAIF,GAAIA,EAAG,QAAQ,sBAAsBG,EAAU,IAAI,GAAGH,GAAIA,EAAG,eAAeA,EAAG,cAAc,cAAc,GAAG,CAACE,EAAI,OAAqD,IAAIE,EAAM,EAAEC,EAAMH,EAAI,aAAaI,EAAO,GAAMC,EAAK,EAAEC,EAAI,EAAMC,kBAAK,IAAI,QAAcC,MAAiB,MAAM,KAAKR,EAAI,iBAAiB,IAAIS,CAAS,CAAC,CAAC,CAAC,OAAO,GAAGxB,EAAE,eAAe,IAAI,EAAEuB,EAAa,CAAC,CAAC,QAAQ,GAAGD,EAAK,IAAItB,CAAC,CAAC,EACtzB,IAAMyB,MAAY,CAAC,IAAMC,EAAIX,EAAI,sBAAsB,CAAC,CAAC,IAAQY,EAAO,EAAE,IAAI,IAAMC,KAAK,MAAM,KAAKb,EAAI,QAAQ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