{"version":3,"file":"Gradient_Bars_Background.DlKD_7JS.mjs","names":["useMemo","_Fragment"],"sources":["https:/framerusercontent.com/modules/7E5uvshRT8Req5obRgmC/aMS2LIlCqkan3je4E3g0/Gradient_Bars_Background.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Gradient Bars Background by Hamim Reza Shammo\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Gradient_Bars_BG(props){const{numBars=7,gradientColor=\"#ff3c00\",backgroundColor=\"#0a0a0a\",animationDuration=2,direction=\"bottom-to-top\",style}=props;const resolvedGradientColor=useMemo(()=>{if(typeof window===\"undefined\")return gradientColor;const div=document.createElement(\"div\");div.style.color=gradientColor;document.body.appendChild(div);const rgb=getComputedStyle(div).color;document.body.removeChild(div);return rgb;},[gradientColor]);const calculateHeight=(index,total)=>{const position=index/(total-1);const maxHeight=100;const minHeight=30;const center=.5;const distanceFromCenter=Math.abs(position-center);const heightPercentage=Math.pow(distanceFromCenter*2,1.2);return minHeight+(maxHeight-minHeight)*heightPercentage;};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes pulseBar {\n                    0% { transform: scaleY(var(--initial-scale)); }\n                    100% { transform: scaleY(calc(var(--initial-scale) * 0.7)); }\n                }\n            `}),/*#__PURE__*/_jsx(\"section\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,zIndex:0,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",height:\"100%\",width:\"100%\",transform:\"translateZ(0)\",backfaceVisibility:\"hidden\",WebkitFontSmoothing:\"antialiased\",gap:0,flexDirection:direction===\"left-to-right\"?\"row\":direction===\"right-to-left\"?\"row-reverse\":\"row\"},children:Array.from({length:numBars}).map((_,index)=>{const height=calculateHeight(index,numBars);let gradientDir=\"to top\";let transform=`scaleY(${height/100})`;let transformOrigin=\"bottom\";if(direction===\"top-to-bottom\"){gradientDir=\"to bottom\";transformOrigin=\"top\";}else if(direction===\"left-to-right\"){gradientDir=\"to right\";transform=`scaleX(${height/100})`;transformOrigin=\"left\";}else if(direction===\"right-to-left\"){gradientDir=\"to left\";transform=`scaleX(${height/100})`;transformOrigin=\"right\";}return /*#__PURE__*/_jsx(\"div\",{style:{flex:1,height:\"100%\",background:`linear-gradient(${gradientDir}, ${resolvedGradientColor}, transparent)`,transform,transformOrigin,transition:\"transform 0.5s ease-in-out\",animation:`pulseBar ${animationDuration}s ease-in-out infinite alternate`,animationDelay:`${index*.1}s`,boxSizing:\"border-box\",marginLeft:index>0?\"-1px\":\"0\",// @ts-ignore\n\"--initial-scale\":height/100}},index);})})})})]});}addPropertyControls(Gradient_Bars_BG,{numBars:{type:ControlType.Number,title:\"Number of Bars\",defaultValue:9,min:3,max:20,step:1},gradientColor:{type:ControlType.Color,title:\"Gradient Color\",defaultValue:\"#8338EC\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0a0a0a\"},animationDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:2,min:.5,max:10,step:.5,unit:\"s\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"bottom-to-top\",\"top-to-bottom\",\"left-to-right\",\"right-to-left\"],optionTitles:[\"Bottom to Top\",\"Top to Bottom\",\"Left to Right\",\"Right to Left\"],defaultValue:\"bottom-to-top\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Gradient_Bars_BG\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetad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