{"version":3,"file":"SelectionHighlight.CS39SHUn.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/OewqPh01vXKp6QxXogge/NPDale3mVF8xzKksWUvE/InvertCursor.js","https:/framerusercontent.com/modules/DVd9bwila6RtsyMN6Clp/GaGlJmcAzRSeiqwV8MG4/SelectionHighlight.js"],"sourcesContent":["// Custom cursor for /v2. User requests: \"create small white dot with inverted color as blend\n// for custom cursor\", then \"cursor gets huge on elements on hover, can we make this super\n// subtle instead\".\n// A small white dot with mix-blend-mode: difference, so it shows as the inverse of whatever\n// is under it. The dot is portaled to <body> so no parent layer's stacking context blocks the\n// blend. Hides the native cursor on mouse/trackpad devices only. Over links and buttons it\n// grows only slightly (Hover Scale, default 1.3) with a soft ease; set 1 to disable.\n// Later: \"home page on portfolio is kinda laggy\" — the animation loop used to run every frame\n// forever, even with the mouse still. It now runs only while the dot is catching up to the\n// pointer or easing its scale, then stops until the next move. The hover-target lookup runs\n// only when the element under the pointer changes. Same look.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const HIDE_ID=\"wa-invert-cursor-hide\";const INTERACTIVE=\"a, button, [role='button'], [role='switch'], input, textarea, select, label\";/**\n * Invert Cursor\n *\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function InvertCursor(props){const{size,hoverScale,hideNative,smoothing,style}=props;const isStatic=useIsStaticRenderer();const dotRef=React.useRef(null);const[mounted,setMounted]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\")return;if(!window.matchMedia?.(\"(pointer: fine)\").matches)return;React.startTransition(()=>setMounted(true));},[]);React.useEffect(()=>{if(!mounted||isStatic||typeof document===\"undefined\")return;const dot=dotRef.current;if(!dot)return;let hide=null;if(hideNative){hide=document.createElement(\"style\");hide.id=HIDE_ID;hide.textContent=\"*, *::before, *::after { cursor: none !important; }\";document.head.appendChild(hide);}let tx=-100;let ty=-100;let x=-100;let y=-100;let scale=1;let targetScale=1;let raf=0;let lastTarget=null;let shown=false;const k=Math.min(1,Math.max(.05,1-smoothing));const tick=()=>{x+=(tx-x)*k;y+=(ty-y)*k;scale+=(targetScale-scale)*.12;const settled=Math.abs(tx-x)<.1&&Math.abs(ty-y)<.1&&Math.abs(targetScale-scale)<.002;if(settled){x=tx;y=ty;scale=targetScale;}dot.style.transform=`translate3d(${x-size/2}px, ${y-size/2}px, 0) scale(${scale.toFixed(3)})`;raf=settled?0:requestAnimationFrame(tick);};const onMove=e=>{if(e.pointerType!==\"mouse\")return;tx=e.clientX;ty=e.clientY;if(!shown){shown=true;dot.style.opacity=\"1\";}if(e.target!==lastTarget){lastTarget=e.target;const t=e.target;targetScale=t&&t.closest&&t.closest(INTERACTIVE)?hoverScale:1;}if(!raf)raf=requestAnimationFrame(tick);};const onLeave=()=>{shown=false;dot.style.opacity=\"0\";};window.addEventListener(\"pointermove\",onMove,{passive:true});document.documentElement.addEventListener(\"pointerleave\",onLeave);return()=>{cancelAnimationFrame(raf);window.removeEventListener(\"pointermove\",onMove);document.documentElement.removeEventListener(\"pointerleave\",onLeave);hide?.remove();};},[mounted,isStatic,size,hoverScale,hideNative,smoothing]);const dot=mounted&&!isStatic&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{ref:dotRef,\"aria-hidden\":\"true\",style:{position:\"fixed\",left:0,top:0,width:size,height:size,borderRadius:\"50%\",background:\"#FFFFFF\",mixBlendMode:\"difference\",pointerEvents:\"none\",zIndex:2147483647,opacity:0,transition:\"opacity 0.15s ease\",willChange:\"transform\"}}),document.body):null;return /*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{...style,position:\"relative\",display:\"block\",width:0,height:0},children:dot});}addPropertyControls(InvertCursor,{size:{type:ControlType.Number,title:\"Size\",defaultValue:10,min:4,max:40,step:1,unit:\"px\"},hoverScale:{type:ControlType.Number,title:\"Hover Scale\",defaultValue:1.3,min:1,max:3,step:.05,description:\"Size over links and buttons (1 = no change)\"},smoothing:{type:ControlType.Number,title:\"Lag\",defaultValue:0,min:0,max:.9,step:.05,description:\"0 = locked to the pointer\"},hideNative:{type:ControlType.Boolean,title:\"Hide Native\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InvertCursor\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InvertCursor.map","// Text selection for /v2. Earlier request: \"i wanna test an orange highlight feature...\n// instead of traditional blue highlight\". Current request: \"change highlight color as just an\n// inverse filter no color, just the inverse of everything\".\n// ::selection can't take CSS filters, so \"Invert\" mode reads the selected text's real colors\n// on every selection change and paints the highlight as their exact inverse: background =\n// inverse of the backdrop, text = inverse of the text. Follows the theme toggle automatically.\n// \"Custom\" mode keeps the fixed-color option. Images inside a selection can't be inverted\n// by the browser's selection layer.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const STYLE_ID=\"wa-selection-style\";function parseRGB(c){const m=c.match(/rgba?\\(([^)]+)\\)/);if(!m)return null;const p=m[1].split(/[,\\s/]+/).filter(Boolean).map(Number);return[p[0],p[1],p[2],p.length>3?p[3]:1];}function invert(c){return`rgb(${255-c[0]}, ${255-c[1]}, ${255-c[2]})`;}function backdropOf(el){let node=el;while(node){const bg=parseRGB(getComputedStyle(node).backgroundColor);if(bg&&bg[3]>.5)return bg;node=node.parentElement;}return[255,255,255,1];}function css(bg,fg){return`::selection, *::selection { background-color: ${bg} !important; color: ${fg} !important; -webkit-text-fill-color: ${fg} !important; }`;}/**\n * Selection Highlight\n *\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function SelectionHighlight(props){const{enabled,mode,highlight,text,style}=props;const isStatic=useIsStaticRenderer();React.useEffect(()=>{if(isStatic||!enabled||typeof document===\"undefined\")return;let tag=document.getElementById(STYLE_ID);if(!tag){tag=document.createElement(\"style\");tag.id=STYLE_ID;document.head.appendChild(tag);}const el=tag;if(mode===\"custom\"){el.textContent=css(highlight,text);return()=>el.remove();}let last=\"\";const update=()=>{const sel=document.getSelection();const node=sel&&sel.rangeCount?sel.anchorNode:null;const host=node&&node.nodeType===3?node.parentElement:node;if(!host)return;const fg=parseRGB(getComputedStyle(host).color)||[0,0,0,1];const next=css(invert(backdropOf(host)),invert(fg));if(next!==last){last=next;el.textContent=next;}};update();document.addEventListener(\"selectionchange\",update);return()=>{document.removeEventListener(\"selectionchange\",update);el.remove();};},[isStatic,enabled,mode,highlight,text]);return /*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{...style,position:\"relative\",display:\"block\",width:0,height:0}});}addPropertyControls(SelectionHighlight,{enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"invert\",\"custom\"],optionTitles:[\"Invert\",\"Custom\"],displaySegmentedControl:true,defaultValue:\"invert\"},highlight:{type:ControlType.Color,title:\"Highlight\",defaultValue:\"rgb(255, 122, 26)\",hidden:p=>p.mode!==\"custom\"},text:{type:ControlType.Color,title:\"Selected Text\",defaultValue:\"rgb(28, 27, 27)\",hidden:p=>p.mode!==\"custom\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SelectionHighlight\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"1\",\"framerIntrinsicWidth\":\"1\",\"framerSupportedLayoutHeight\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