{"version":3,"file":"WithMobileFullscreen.B-fxr2ch.mjs","names":["React.useState","React.useRef","useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/emwgMGraoEmLXepobklE/CFb8nPuWFTiZ2sOofVAW/Cinematicvideo.js","https:/framerusercontent.com/modules/XbCa0BmyUDp964zNvMMW/WMFoZpT2JKpUTP2c6YNG/WithMobileFullscreen.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 900\n * @framerIntrinsicHeight 400\n * @framerDisableUnlink\n *\n * @framerComponentTitle Cinematic Video\n */export default function CinematicVideo(props){const[isPlaying,setIsPlaying]=React.useState(false);const videoRef=React.useRef(null);const togglePlay=()=>{const video=videoRef.current;if(!video)return;if(isPlaying){video.pause();setIsPlaying(false);}else{video.play();setIsPlaying(true);}};const videoSource=props.videoFile||props.videoUrl;const defaultThumbnail=\"https://images.unsplash.com/photo-1462331940025-496dfbfc7564?q=80&w=2048&auto=format&fit=crop\";const posterSrc=props.thumbnail?.src||defaultThumbnail;const currentText=isPlaying?props.pauseText:props.playText;const shouldHideText=isPlaying&&props.hideTextOnPlay;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",...containerStyle,...props.style,borderRadius:props.radius},onClick:togglePlay,children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoSource,poster:posterSrc,style:videoStyle,playsInline:true,loop:props.loop,muted:props.muted}),/*#__PURE__*/_jsxs(motion.div,{style:overlayContainerStyle,animate:{opacity:shouldHideText?0:1},transition:{duration:props.fadeDuration,delay:shouldHideText?props.fadeDelay:0,ease:\"easeInOut\"},children:[/*#__PURE__*/_jsx(\"div\",{style:gradientStyle}),/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.h1,{initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.3},style:{...props.font,...textStyle,color:props.textColor},children:currentText},currentText)})]})]});}// --- Styles ---\nconst containerStyle={position:\"relative\",overflow:\"hidden\",backgroundColor:\"#000\",cursor:\"pointer\",transform:\"translateZ(0)\"};const videoStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"};const overlayContainerStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"flex-end\",zIndex:10,pointerEvents:\"none\"};const gradientStyle={position:\"absolute\",bottom:0,left:0,width:\"100%\",height:\"60%\",background:\"linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%)\",zIndex:-1};const textStyle={margin:0,padding:\"20px 30px\",fontSize:\"clamp(40px, 12vw, 120px)\",lineHeight:1};// --- Framer Controls ---\naddPropertyControls(CinematicVideo,{videoFile:{type:ControlType.File,title:\"Upload\",allowedFileTypes:[\"mp4\",\"webm\"]},videoUrl:{type:ControlType.String,title:\"URL\",defaultValue:\"https://assets.mixkit.co/videos/preview/mixkit-stars-in-space-background-1610-large.mp4\",placeholder:\"https://example.com/video.mp4\"},thumbnail:{type:ControlType.ResponsiveImage,title:\"Thumbnail\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:80,variant:\"Medium\"},defaultFontType:\"sans-serif\",controls:\"extended\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},playText:{type:ControlType.String,title:\"Play Text\",defaultValue:\"Play\"},pauseText:{type:ControlType.String,title:\"Pause Text\",defaultValue:\"Pause\"},hideTextOnPlay:{type:ControlType.Boolean,title:\"Hide on Play\",defaultValue:true},fadeDelay:{type:ControlType.Number,title:\"Fade Delay (s)\",defaultValue:1.5,min:0,max:5,step:.1,displayStepper:true},fadeDuration:{type:ControlType.Number,title:\"Fade Duration (s)\",defaultValue:.8,min:.1,max:3,step:.1},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:30,min:0,max:100},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CinematicVideo\",\"slots\":[],\"annotations\":{\"framerComponentTitle\":\"Cinematic Video\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"900\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Cinematicvideo.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useRef,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";/**\n * User request:\n * Create a Framer code override export named withMobileFullscreen that wraps a canvas video element,\n * adds a mobile-only fullscreen overlay button, and triggers native fullscreen safely.\n */export function withMobileFullscreen(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const wrapperRef=useRef(null);const isStaticRenderer=useIsStaticRenderer();const[mounted,setMounted]=useState(false);const[isMobile,setIsMobile]=useState(false);const evaluateIsMobile=useCallback(()=>{if(typeof window===\"undefined\")return false;const maxWidthMatch=window.matchMedia(\"(max-width: 809px)\").matches;const coarsePointerMatch=window.matchMedia(\"(pointer: coarse)\").matches;const touchCapable=\"ontouchstart\"in window||typeof navigator!==\"undefined\"&&(navigator.maxTouchPoints||0)>0;return maxWidthMatch||coarsePointerMatch||touchCapable;},[]);useEffect(()=>{if(typeof window===\"undefined\")return;startTransition(()=>setMounted(true));startTransition(()=>setIsMobile(evaluateIsMobile()));const handleChange=()=>{startTransition(()=>setIsMobile(evaluateIsMobile()));};const widthQuery=window.matchMedia(\"(max-width: 809px)\");const coarseQuery=window.matchMedia(\"(pointer: coarse)\");window.addEventListener(\"resize\",handleChange);widthQuery.addEventListener(\"change\",handleChange);coarseQuery.addEventListener(\"change\",handleChange);return()=>{window.removeEventListener(\"resize\",handleChange);widthQuery.removeEventListener(\"change\",handleChange);coarseQuery.removeEventListener(\"change\",handleChange);};},[evaluateIsMobile]);const onEnterFullscreen=useCallback(()=>{const wrapper=wrapperRef.current;if(!wrapper)return;const video=wrapper.querySelector(\"video\");if(!video)return;try{if(typeof video.requestFullscreen===\"function\"){void video.requestFullscreen();return;}if(typeof video.webkitEnterFullscreen===\"function\"){video.webkitEnterFullscreen();return;}if(typeof video.webkitRequestFullscreen===\"function\"){void video.webkitRequestFullscreen();return;}const wrapperWithWebkit=wrapper;if(typeof wrapperWithWebkit.webkitRequestFullscreen===\"function\"){void wrapperWithWebkit.webkitRequestFullscreen();}}catch(_error){// Fail gracefully to avoid interrupting playback.\n}},[]);return /*#__PURE__*/_jsxs(\"div\",{ref:wrapperRef,style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(Component,{ref:ref,...props}),mounted&&!isStaticRenderer&&isMobile?/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Enter fullscreen\",onClick:onEnterFullscreen,style:{position:\"absolute\",right:12,bottom:12,width:44,height:44,minWidth:40,minHeight:40,borderRadius:999,border:\"none\",background:\"rgba(0,0,0,0.55)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:0,cursor:\"pointer\",zIndex:20,WebkitTapHighlightColor:\"transparent\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 3H5a2 2 0 0 0-2 2v4M15 3h4a2 2 0 0 1 2 2v4M3 15v4a2 2 0 0 0 2 2h4M21 15v4a2 2 0 0 1-2 2h-4\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}):null]});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withMobileFullscreen\":{\"type\":\"reactHoc\",\"name\":\"withMobileFullscreen\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithMobileFullscreen.map"],"mappings":"oSAQG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAe,GAAM,CAAO,EAASC,EAAa,KAAK,CAAO,MAAe,CAAC,IAAM,EAAM,EAAS,QAAY,IAAgB,GAAW,EAAM,OAAO,CAAC,EAAa,GAAM,GAAO,EAAM,MAAM,CAAC,EAAa,GAAK,IAAU,EAAY,EAAM,WAAW,EAAM,SAAsI,EAAU,EAAM,WAAW,KAAjI,gGAA6J,EAAY,EAAU,EAAM,UAAU,EAAM,SAAe,EAAe,GAAW,EAAM,eAAe,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,GAAG,EAAe,GAAG,EAAM,MAAM,aAAa,EAAM,OAAO,CAAC,QAAQ,EAAW,SAAS,CAAc,EAAK,QAAQ,CAAC,IAAI,EAAS,IAAI,EAAY,OAAO,EAAU,MAAM,EAAW,YAAY,GAAK,KAAK,EAAM,KAAK,MAAM,EAAM,MAAM,CAAC,CAAc,EAAM,EAAO,IAAI,CAAC,MAAM,EAAsB,QAAQ,CAAC,QAAQ,EAAe,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,EAAM,aAAa,MAAM,EAAe,EAAM,UAAU,EAAE,KAAK,YAAY,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,EAAc,CAAC,CAAc,EAAK,EAAgB,CAAC,KAAK,OAAO,SAAsB,EAAK,EAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,QAAQ,CAAC,EA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