{"version":3,"file":"Preloader_1.BYPbOWos.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/2SG2Wjlc5y4EHCroLWQf/fiLAInoGPdP7PyPi4Zhg/Preloader_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useAnimate}from\"framer-motion\";import{useEffect,useState}from\"react\";/**\n * MINIMAL STUDIO PRELOADER\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Preloader(props){const{text,showText,font,backgroundColor,textColor,showInCanvas,animationSpeed,textAnimationDuration,images,cardSize,cardOffset,imageInterval=.15}=props;const[scope,animate]=useAnimate();const[currentImageIndex,setCurrentImageIndex]=useState(0);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[animationComplete,setAnimationComplete]=useState(false);useEffect(()=>{if(!images||images.length===0)return;const intervalTime=imageInterval*1e3;const interval=setInterval(()=>{setCurrentImageIndex(prev=>(prev+1)%images.length);},intervalTime);return()=>clearInterval(interval);},[images,imageInterval]);useEffect(()=>{// Skip animation in canvas unless enabled\nif(isCanvas&&!showInCanvas){animate(\".preloader-overlay\",{opacity:0,display:\"none\"},{duration:0});setAnimationComplete(true);return;}const playSequence=async()=>{// Speed multiplier (animationSpeed > 1 = plus rapide)\nconst speed=1/animationSpeed;// Sélecteur des éléments à animer.\n// Si pas de texte, on n'anime que la card.\nconst elements=showText?\".loader-text, .loader-card\":\".loader-card\";// Initial states\nanimate(\".preloader-overlay\",{opacity:1,filter:\"blur(0px)\",display:\"block\"},{duration:0});animate(elements,{opacity:0,filter:\"blur(10px)\"},{duration:0});// Step 1: Fade In\n// Durée contrôlée par textAnimationDuration (en sec).\n// Le multiplicateur `speed` (animationSpeed) reste un global.\nawait animate(elements,{opacity:1,filter:\"blur(0px)\"},{duration:textAnimationDuration*speed,ease:\"easeOut\",delay:.2*speed});// Step 2: Hold (Static moment)\nawait new Promise(resolve=>setTimeout(resolve,800*speed));// Step 3: Fade Out\nawait animate(elements,{opacity:0,filter:\"blur(10px)\"},{duration:.5*speed,ease:\"easeIn\"});// Step 4: Overlay Fade Out\nawait animate(\".preloader-overlay\",{opacity:0,filter:\"blur(20px)\"},{duration:1*speed,ease:\"easeInOut\"});animate(\".preloader-overlay\",{display:\"none\"},{duration:0});setAnimationComplete(true);};playSequence();},[isCanvas,showInCanvas,animationSpeed,textAnimationDuration,showText]);// Style de la card :\n//  - Texte affiché → en bas à droite (cardOffset)\n//  - Texte caché   → centrée dans la frame parent\nconst cardStyle=showText?{position:\"absolute\",bottom:cardOffset,right:cardOffset,width:cardSize,height:cardSize,zIndex:75,opacity:0,filter:\"blur(10px)\",overflow:\"hidden\"}:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",width:cardSize,height:cardSize,zIndex:75,opacity:0,filter:\"blur(10px)\",overflow:\"hidden\"};return /*#__PURE__*/_jsx(\"div\",{ref:scope,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsxs(\"div\",{className:\"preloader-overlay\",style:{position:\"absolute\",inset:0,zIndex:60,display:isCanvas&&!showInCanvas?\"none\":\"block\",pointerEvents:animationComplete?\"none\":\"auto\"},children:[/*#__PURE__*/_jsx(\"div\",{className:\"preloader-bg\",style:{position:\"absolute\",inset:0,backgroundColor:backgroundColor,width:\"100%\",height:\"100%\"}}),showText&&/*#__PURE__*/_jsx(\"div\",{className:\"preloader-text-wrap\",style:{position:\"absolute\",inset:0,zIndex:70,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{className:\"loader-text\",style:{...font,color:textColor,opacity:0,filter:\"blur(10px)\"},children:text})}),images&&images.length>0&&/*#__PURE__*/_jsx(\"div\",{className:\"loader-card\",style:cardStyle,children:/*#__PURE__*/_jsx(\"img\",{src:images[currentImageIndex]?.src,// srcSet + sizes : laisse le navigateur choisir\n// la version d'image adaptée à la taille\n// affichée (cardSize × DPR) plutôt que de\n// télécharger l'original pleine résolution.\n// Framer ResponsiveImage fournit srcSet auto-\n// matiquement quand tu uploades une image via\n// le control. Si srcSet est absent (image\n// externe par URL brute), le navigateur\n// retombe sur src.\nsrcSet:images[currentImageIndex]?.srcSet,sizes:`${cardSize}px`,alt:\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}})})]})});}addPropertyControls(Preloader,{showText:{type:ControlType.Boolean,title:\"Show Text\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\",description:\"Affiche ou masque le texte. Si masqu\\xe9, la card est centr\\xe9e dans la frame.\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"EMILIA KHOVANSKI — Creative Studio\",hidden:props=>!props.showText},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\"},hidden:props=>!props.showText},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\",hidden:props=>!props.showText},textAnimationDuration:{type:ControlType.Number,title:\"Fade In Duration\",defaultValue:1.5,min:.1,max:10,step:.1,unit:\"s\",displayStepper:true,description:\"Dur\\xe9e du fade-in du texte (et de la card). Le Speed global s'applique en plus.\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\"},{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"}]},cardSize:{type:ControlType.Number,title:\"Card Size\",defaultValue:160,min:50,max:500},cardOffset:{type:ControlType.Number,title:\"Card Offset\",defaultValue:20,min:0,max:100,hidden:props=>!props.showText,description:\"Distance depuis le bord (bottom-right). Inutilis\\xe9 si Show Text est off (card centr\\xe9e).\"},imageInterval:{type:ControlType.Number,title:\"Image Speed\",defaultValue:.15,min:.05,max:2,step:.05,unit:\"s\",displayStepper:true},animationSpeed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:5,step:.1,displayStepper:true,description:\"Multiplicateur global de vitesse (s'applique \\xe0 tout).\"},showInCanvas:{type:ControlType.Boolean,title:\"Preview\",defaultValue:false,enabledTitle:\"Play\",disabledTitle:\"Hide\",description:\"Enable to see the animation in the canvas.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Preloader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Preloader_1.map"],"mappings":"2OAOG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,OAAK,kBAAgB,YAAU,eAAa,iBAAe,wBAAsB,SAAO,WAAS,aAAW,gBAAc,KAAK,EAAW,CAAC,EAAM,GAAS,GAAY,CAAM,CAAC,EAAkB,GAAsBA,EAAS,EAAE,CAAO,EAAS,EAAa,SAAS,GAAG,EAAa,O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