{"version":3,"file":"VideoIntroLoader.C9YqCOI3.mjs","names":["useRef","useState","useCallback","useMemo","p"],"sources":["https:/framerusercontent.com/modules/8ORfhx6WsG7wcgYKu2UZ/AFbm4bz7dBzewHSmtn75/VideoIntroLoader.js"],"sourcesContent":["// Create a full-screen video intro loader before the page loads.\n// IMPORTANT: Do not redesign the page, do not change layout or styles, only add a video intro before the site appears.\n// LOADER: full screen overlay (100vh, 100vw), black background, video centered covering screen.\n// VIDEO: autoplay, muted, plays once, cover (object-fit: cover).\n// NO TEXT / UI.\n// EXIT: when video ends, fade out loader (opacity 1 → 0) duration ~0.6–0.8s and reveal page underneath.\n// INTERACTION: disable scroll during video, no user interaction allowed during intro.\n// STYLE: clean, minimal, no overlays, no distractions.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoIntroLoader(props){const{videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",fadeDuration,backgroundColor,zIndex,maxWaitSeconds,rememberOnce,storage,storageKey,videoOffsetY,mobileObjectFit,mobileBreakpoint,mobileContainScale}=props;const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const videoRef=useRef(null);const[isMobile,setIsMobile]=useState(false);const inView=useInView(containerRef,{amount:.01});const getStore=useCallback(()=>{if(typeof window===\"undefined\")return null;try{return storage===\"session\"?window.sessionStorage:window.localStorage;}catch{return null;}},[storage]);const hasSeen=useMemo(()=>{if(!rememberOnce)return false;const store=getStore();if(!store)return false;try{return store.getItem(storageKey)===\"1\";}catch{return false;}},[rememberOnce,getStore,storageKey]);const[phase,setPhase]=useState(()=>isStatic?\"hidden\":hasSeen?\"hidden\":\"playing\");const showOverlay=phase!==\"hidden\";const canPortal=typeof document!==\"undefined\";const preventDefault=useCallback(e=>{e.preventDefault();},[]);const preventKeyScroll=useCallback(e=>{const keys=new Set([\"ArrowUp\",\"ArrowDown\",\"ArrowLeft\",\"ArrowRight\",\"PageUp\",\"PageDown\",\"Home\",\"End\",\" \",\"Spacebar\"]);if(keys.has(e.key))e.preventDefault();},[]);const lockScroll=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const html=document.documentElement;const body=document.body;html.style.overflow=\"hidden\";body.style.overflow=\"hidden\";body.style.touchAction=\"none\";window.addEventListener(\"wheel\",preventDefault,{passive:false});window.addEventListener(\"touchmove\",preventDefault,{passive:false});window.addEventListener(\"keydown\",preventKeyScroll,{passive:false});},[preventDefault,preventKeyScroll]);const unlockScroll=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const html=document.documentElement;const body=document.body;html.style.overflow=\"\";body.style.overflow=\"\";body.style.touchAction=\"\";window.removeEventListener(\"wheel\",preventDefault);window.removeEventListener(\"touchmove\",preventDefault);window.removeEventListener(\"keydown\",preventKeyScroll);},[preventDefault,preventKeyScroll]);const startFadeOut=useCallback(()=>{startTransition(()=>setPhase(p=>p===\"playing\"?\"fading\":p));},[]);const finishAndHide=useCallback(()=>{if(rememberOnce){const store=getStore();if(store){try{store.setItem(storageKey,\"1\");}catch{}}}unlockScroll();startTransition(()=>setPhase(\"hidden\"));},[unlockScroll,rememberOnce,getStore,storageKey]);useEffect(()=>{if(typeof window===\"undefined\")return;if(isStatic)return;const update=()=>{const next=window.innerWidth<=mobileBreakpoint;startTransition(()=>setIsMobile(next));};update();window.addEventListener(\"resize\",update);return()=>window.removeEventListener(\"resize\",update);},[isStatic,mobileBreakpoint]);useEffect(()=>{if(isStatic)return;if(showOverlay)lockScroll();else unlockScroll();return()=>{unlockScroll();};},[isStatic,showOverlay,lockScroll,unlockScroll]);useEffect(()=>{if(isStatic)return;if(!showOverlay)return;if(!inView)return;if(typeof window===\"undefined\")return;const v=videoRef.current;if(!v)return;// Ensure we start at the beginning if possible\ntry{v.currentTime=0;}catch{}const tryPlay=async()=>{try{await v.play();}catch{// If autoplay is blocked (rare with muted), we still keep overlay and rely on maxWaitSeconds fallback.\n}};tryPlay();},[isStatic,showOverlay,inView,videoFile]);useEffect(()=>{if(isStatic)return;if(!showOverlay)return;if(!(maxWaitSeconds>0))return;if(typeof window===\"undefined\")return;const id=window.setTimeout(()=>{startFadeOut();},Math.max(.5,maxWaitSeconds)*1e3);return()=>window.clearTimeout(id);},[isStatic,showOverlay,maxWaitSeconds,startFadeOut]);const overlayStyle=useMemo(()=>({position:\"fixed\",inset:0,background:backgroundColor,overflow:\"hidden\",pointerEvents:\"auto\",touchAction:\"none\",userSelect:\"none\",zIndex}),[backgroundColor,zIndex]);const videoStyle=useMemo(()=>({position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:isMobile?mobileObjectFit:\"cover\",objectPosition:`50% calc(50% + ${videoOffsetY}px)`,display:\"block\",transform:isMobile&&mobileObjectFit===\"contain\"?`scale(${Math.max(1,mobileContainScale)})`:undefined,transformOrigin:\"50% 50%\",willChange:\"transform\"}),[videoOffsetY,isMobile,mobileObjectFit,mobileContainScale]);if(!showOverlay)return null;const overlay=/*#__PURE__*/_jsx(motion.div,{style:overlayStyle,initial:{opacity:1},animate:{opacity:phase===\"fading\"?0:1},transition:{duration:Math.min(1.2,Math.max(.1,fadeDuration)),ease:[.2,0,0,1]},onAnimationComplete:()=>{if(phase===\"fading\")finishAndHide();},onPointerDown:e=>e.preventDefault(),onPointerMove:e=>e.preventDefault(),onPointerUp:e=>e.preventDefault(),onClick:e=>e.preventDefault(),onContextMenu:e=>e.preventDefault(),\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoFile,muted:true,autoPlay:true,playsInline:true,preload:\"auto\",controls:false,loop:false,style:videoStyle,onEnded:()=>startFadeOut(),onError:()=>startFadeOut()})});if(!canPortal)return null;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:1,height:1,overflow:\"visible\",pointerEvents:\"none\"},children:/*#__PURE__*/createPortal(overlay,document.body)});}addPropertyControls(VideoIntroLoader,{videoFile:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},rememberOnce:{type:ControlType.Boolean,title:\"Once\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},storage:{type:ControlType.Enum,title:\"Store\",options:[\"local\",\"session\"],optionTitles:[\"Local\",\"Session\"],defaultValue:\"local\",hidden:({rememberOnce})=>!rememberOnce},storageKey:{type:ControlType.String,title:\"Key\",defaultValue:\"VideoIntroLoader_shown\",hidden:({rememberOnce})=>!rememberOnce},videoOffsetY:{type:ControlType.Number,title:\"Video Y (px)\",defaultValue:24,min:-200,max:200,step:1},mobileObjectFit:{type:ControlType.Enum,title:\"Mobile Fit\",options:[\"contain\",\"cover\"],optionTitles:[\"Contain (no crop)\",\"Cover (crop)\"],defaultValue:\"contain\",displaySegmentedControl:true},mobileContainScale:{type:ControlType.Number,title:\"Contain Scale\",defaultValue:1.08,min:1,max:1.3,step:.01,hidden:({mobileObjectFit})=>mobileObjectFit!==\"contain\"},mobileBreakpoint:{type:ControlType.Number,title:\"Mobile ≤ (px)\",defaultValue:640,min:320,max:1024,step:1},fadeDuration:{type:ControlType.Number,title:\"Fade (s)\",defaultValue:.7,min:.3,max:1.2,step:.05},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},zIndex:{type:ControlType.Number,title:\"Z-Index\",defaultValue:9999,min:0,max:99999,step:1},maxWaitSeconds:{type:ControlType.Number,title:\"Max Wait (s)\",defaultValue:20,min:0,max:120,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoIntroLoader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}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