{"version":3,"file":"NotesWithin.omeIjicM.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/yod6HLJGkW5DpcLtBqMZ/SJ5yFuI9IXlgz3KRkyjF/NotesWithin.js"],"sourcesContent":["// Profumo di Vero: \"The notes within\" for the product pages.\n// Request: \"I especially love how it's got the notes within, with the different types of things that are included.\n// That's really important for us.\" Four ingredient studies with their names, as on the Arum product page.\n// The ingredient photos sit on white; mix-blend-mode multiply melts the white into the paper background.\n// When a scent's notes are still under wraps (Westmere), it shows a short line instead.\n// 16 Oct (evening): text now fades up softly and comes into focus instead of sliding up from behind an edge\n// (Ryan: \"a lot of the text is still snapping into place\").\n// 16 Oct (late): Ryan: the notes images showed \"a white background originally, and then they remove it ... the white\n// background should just never be there.\" The fade on each image's frame cut the image off from the page while it\n// ran, so the multiply blend only reached the paper once the fade ended. The blend now sits on the fading frame\n// itself, so the white melts into the paper from the first frame.\n// 18 Oct: speed. The ingredient images are shown at 300px at most, so they are now asked for at that size\n// (with a srcset for sharp screens) instead of the full upload, which was up to 122KB each.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const SERIF='\"Newsreader\", \"Newsreader Placeholder\", Georgia, serif';const SANS='\"Instrument Sans\", \"Instrument Sans Placeholder\", system-ui, sans-serif';const EASE=\"cubic-bezier(0.16, 1, 0.3, 1)\";const SOFT=\"cubic-bezier(0.25, 0.6, 0.3, 1)\";// Framer-hosted images can be resized on the fly; anything else is left as it is.\nfunction sized(src,px){if(!src||!/framerusercontent\\.com\\/(images|assets)\\//.test(src)||/scale-down-to=/.test(src))return src;return src+(src.includes(\"?\")?\"&\":\"?\")+\"scale-down-to=\"+px;}function srcSetFor(src,sizes){if(!src||!/framerusercontent\\.com\\/(images|assets)\\//.test(src)||/scale-down-to=/.test(src))return undefined;return sizes.map(n=>`${sized(src,n)} ${n}w`).join(\", \");}/**\n * Notes within\n *\n * @framerIntrinsicWidth 1440\n * @framerIntrinsicHeight 760\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function NotesWithin(props){const{heading,imageUrls,names,roles,emptyText,ink,muted}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const[width,setWidth]=useState(1440);const[mounted,setMounted]=useState(false);const[seen,setSeen]=useState(false);useEffect(()=>{const el=ref.current;if(!el)return;const update=()=>{const w=el.getBoundingClientRect().width;if(w>0)startTransition(()=>setWidth(w));};update();startTransition(()=>setMounted(true));let ro=null;if(typeof ResizeObserver!==\"undefined\"){ro=new ResizeObserver(update);ro.observe(el);}let io=null;if(typeof IntersectionObserver!==\"undefined\"&&!isCanvas){io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){startTransition(()=>setSeen(true));if(io)io.disconnect();}},{rootMargin:\"0px 0px -15% 0px\",threshold:.05});io.observe(el);}else startTransition(()=>setSeen(true));return()=>{if(ro)ro.disconnect();if(io)io.disconnect();};},[isCanvas]);const items=useMemo(()=>{const n=(names||\"\").split(\"|\").map(s=>s.trim());const r=(roles||\"\").split(\"|\").map(s=>s.trim());return(imageUrls||\"\").split(/\\s+/).filter(Boolean).map((src,i)=>({src,name:n[i]||\"\",role:r[i]||\"\"}));},[imageUrls,names,roles]);const[reduce,setReduce]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"&&window.matchMedia)startTransition(()=>setReduce(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches));},[]);const hidden=mounted&&!seen&&!isCanvas&&!reduce;const animate=mounted&&!isCanvas&&!reduce;const cols=width>=900?4:2;const isPhone=width<600;const side=width>=1200?32:isPhone?20:24;const t=(delay,extra={})=>({opacity:hidden?0:1,transform:hidden?\"translate3d(0, 20px, 0)\":\"none\",transition:animate?`opacity 1.2s ${SOFT} ${delay}s, transform 1.6s ${SOFT} ${delay}s`:\"none\",...extra});return /*#__PURE__*/_jsxs(\"section\",{ref:ref,style:{...props.style,width:props.style&&props.style.width?props.style.width:\"100%\",boxSizing:\"border-box\",padding:`${width>=900?140:96}px ${side}px ${width>=900?120:80}px`,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:width>=900?88:56},children:[/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",paddingBottom:\"0.12em\"},children:/*#__PURE__*/_jsx(\"h2\",{style:{fontFamily:SERIF,fontWeight:400,fontSize:isPhone?34:44,lineHeight:1.1,letterSpacing:\"-0.012em\",color:ink,margin:0,textAlign:\"center\",opacity:hidden?0:1,transform:hidden?\"translate3d(0, 16px, 0)\":\"none\",filter:hidden?\"blur(6px)\":\"none\",transition:animate?`opacity 1.2s ${SOFT}, transform 1.6s ${SOFT}, filter 1.3s ${SOFT}`:\"none\"},children:heading})}),items.length?/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",display:\"grid\",gridTemplateColumns:`repeat(${cols}, minmax(0, 1fr))`,columnGap:isPhone?12:24,rowGap:isPhone?40:56},children:items.map((it,i)=>/*#__PURE__*/_jsxs(\"figure\",{style:{margin:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:18},children:[/*#__PURE__*/_jsx(\"div\",{style:t(.15+i*.12,{width:\"100%\",maxWidth:300,aspectRatio:\"1 / 1\",position:\"relative\",mixBlendMode:\"multiply\"}),children:/*#__PURE__*/_jsx(\"img\",{src:sized(it.src,600),srcSet:srcSetFor(it.src,[300,450,600,900]),sizes:\"(min-width: 900px) 300px, 50vw\",alt:it.name,loading:\"lazy\",decoding:\"async\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"contain\",transform:hidden?\"scale(0.9)\":\"none\",transition:animate?`transform 1.8s ${EASE} ${.15+i*.12}s`:\"none\"}})}),/*#__PURE__*/_jsxs(\"figcaption\",{style:t(.35+i*.12,{textAlign:\"center\",display:\"flex\",flexDirection:\"column\",gap:4}),children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:SANS,fontSize:isPhone?14:15,color:ink},children:it.name}),it.role?/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:SANS,fontSize:13,color:muted},children:it.role}):null]})]},it.src+i))}):/*#__PURE__*/_jsx(\"p\",{style:t(.25,{fontFamily:SANS,fontSize:15,lineHeight:1.5,color:muted,textAlign:\"center\",maxWidth:460,margin:0}),children:emptyText})]});}addPropertyControls(NotesWithin,{heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"The notes within\"},imageUrls:{type:ControlType.String,title:\"Image URLs\",displayTextArea:true,defaultValue:\"\"},names:{type:ControlType.String,title:\"Names\",description:\"Separate with |\",defaultValue:\"\"},roles:{type:ControlType.String,title:\"Roles\",description:\"Separate with |, e.g. Opens|Settles\",defaultValue:\"\"},emptyText:{type:ControlType.String,title:\"No notes text\",displayTextArea:true,defaultValue:\"The full notes are kept close for now. Try it on in store and judge for yourself.\"},ink:{type:ControlType.Color,title:\"Ink\",defaultValue:\"#1E1A17\"},muted:{type:ControlType.Color,title:\"Muted\",defaultValue:\"#7A7068\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NotesWithin\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"1440\",\"framerIntrinsicHeight\":\"760\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NotesWithin.map"],"mappings":"kOAcA,SAAS,EAAM,EAAI,EAAG,CAAwG,MAApG,CAAC,GAAK,CAAC,4CAA4C,KAAK,CAAG,GAAG,iBAAiB,KAAK,CAAG,EAAS,EAAW,GAAK,EAAI,SAAS,GAAG,EAAE,IAAI,KAAK,iBAAiB,CAAG,CAAC,SAAS,EAAU,EAAI,EAAM,CAAI,MAAC,GAAK,CAAC,4CAA4C,KAAK,CAAG,GAAG,iBAAiB,KAAK,CAAG,GAAmB,OAA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