FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
counter
/
build
Edit File: index.js
(()=>{"use strict";var e,t={983:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=window.wp.blockEditor,n=window.wp.components,l=window.wp.element,s=window.wp.compose,i=window.ReactJSXRuntime,a=()=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,i.jsx)("p",{children:(0,i.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M0 34.7721L6.88004 38.677V15.8055L20.4542 7.80977L23.9872 9.4833L30.4953 5.57841L20.4542 -7.62939e-06L0 11.9006V34.7721Z",fill:"#38DAC7"}),(0,i.jsx)("path",{d:"M32.9284 6.87939L34.2126 7.61318L12.3825 19.904L12.1991 40.45L20.6376 45.8616L41.0001 33.6625V35.4969L20.6376 47.6043L10.8232 41.2755V18.9868L32.9284 6.87939Z",fill:"#5566CA"}),(0,i.jsx)("path",{d:"M37.6063 9.53936L36.2305 8.71385L14.217 21.3716V38.9824L20.5459 43.5685L41.0001 31.3694V29.5349L20.5459 41.8258L15.5928 38.2486V22.1054L37.6063 9.53936Z",fill:"#5566CA"}),(0,i.jsx)("path",{d:"M41.0001 11.3738L39.5325 10.5483L17.3356 23.2061V37.2397L20.5459 39.6244L41.0001 27.4253V25.6826L20.5459 37.79L18.9866 36.5976V24.1233L41.0001 11.3738Z",fill:"#5566CA"})]})}),(0,i.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,t.__)("Access Without Limits!","cozy-addons")}),(0,i.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,t.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,i.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,i.jsx)("button",{className:"cozy-block-premium-button",style:{backgroundColor:"#5566ca",borderRadius:"20px",padding:"10px",border:"none",color:"#fff",fontFamily:"Inter",fontSize:"10px",fontWeight:"500",cursor:"pointer"},children:(0,i.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,i.jsx)("div",{children:(0,i.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M9.29768 0.0630875L0.24397 5.2847C-0.109583 5.48778 -0.0646564 5.97987 0.286944 6.12828L2.36334 6.99919L7.97527 2.05487C8.0827 1.95919 8.23506 2.10565 8.14325 2.21695L3.43767 7.94822V9.52017C3.43767 9.98102 3.99437 10.1626 4.26784 9.8287L5.50821 8.31924L7.94206 9.33857C8.21943 9.45573 8.53588 9.28194 8.58666 8.98317L9.99306 0.547365C10.0595 0.152913 9.6356 -0.132186 9.29768 0.0630875Z",fill:"white"})})}),(0,i.jsx)("div",{children:(0,t.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),r=(0,l.memo)((({clientId:e,attributes:t,blockId:o})=>{const n=(0,l.useRef)(0),a=(0,s.useRefEffect)((e=>{const o=t.animationDuration&&Math.floor(Math.abs(t.animationDuration))>499?Math.floor(Math.abs(t.animationDuration))-200:300,l=t.endNumber?Math.floor(Math.abs(t.endNumber)):0;let s=0;const i=(l-s)/o*53;let a;const r=setTimeout((()=>{!function e(){s+=i,n.current.innerText=Math.floor(s).toLocaleString(),s<l?a=setTimeout((()=>{e()}),53):n.current.innerText=Math.floor(l).toLocaleString()}()}),200);return()=>{clearTimeout(r),clearTimeout(a)}})),r=`\n #${o} {\n text-align: ${t.textAlign};\n font-size: ${t.styles.fontSize};\n font-weight: ${t.styles.fontWeight};\n font-family: ${t.styles.fontFamily};\n color: ${t.styles.color};\n }\n `;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:r}}),""!=t.styles.fontFamily&&null!=t.styles.fontFamily&&(0,i.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${t.styles.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),(0,i.jsx)("div",{className:"cozy-block-counter",id:o,ref:a,children:(0,i.jsx)("span",{ref:n,children:"0"})})]})})),c=JSON.parse('{"UU":"cozy-block/counter","DD":"Counter"}'),d=(0,i.jsxs)("svg",{width:"27",height:"22",viewBox:"0 0 27 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{fill:"none",x:"1",y:"1",width:"25",height:"20",stroke:"#0C50FF",strokeWidth:"2"}),(0,i.jsx)("path",{d:"M15.3636 17.9773C14.9053 17.9773 14.4981 17.8987 14.142 17.7415C13.7879 17.5824 13.5095 17.3636 13.3068 17.0852C13.1042 16.8068 13.0019 16.4867 13 16.125H14.5909C14.5928 16.2367 14.6269 16.3371 14.6932 16.4261C14.7614 16.5133 14.8542 16.5814 14.9716 16.6307C15.089 16.6799 15.2235 16.7045 15.375 16.7045C15.5208 16.7045 15.6496 16.679 15.7614 16.6278C15.8731 16.5748 15.9602 16.5019 16.0227 16.4091C16.0852 16.3163 16.1155 16.2102 16.1136 16.0909C16.1155 15.9735 16.0795 15.8693 16.0057 15.7784C15.9337 15.6875 15.8324 15.6165 15.7017 15.5653C15.571 15.5142 15.4205 15.4886 15.25 15.4886H14.6591V14.3977H15.25C15.4072 14.3977 15.5455 14.3722 15.6648 14.321C15.786 14.2699 15.8797 14.1989 15.946 14.108C16.0142 14.017 16.0473 13.9129 16.0455 13.7955C16.0473 13.6818 16.0199 13.5814 15.9631 13.4943C15.9062 13.4072 15.8267 13.339 15.7244 13.2898C15.6241 13.2405 15.5076 13.2159 15.375 13.2159C15.2311 13.2159 15.1023 13.2415 14.9886 13.2926C14.8769 13.3438 14.7888 13.4148 14.7244 13.5057C14.66 13.5966 14.6269 13.7008 14.625 13.8182H13.1136C13.1155 13.4621 13.2131 13.1477 13.4062 12.875C13.6013 12.6023 13.8684 12.3883 14.2074 12.233C14.5464 12.0777 14.9356 12 15.375 12C15.8049 12 16.1847 12.0729 16.5142 12.2188C16.8456 12.3646 17.1042 12.5653 17.2898 12.821C17.4773 13.0748 17.5701 13.3655 17.5682 13.6932C17.572 14.0189 17.4602 14.286 17.233 14.4943C17.0076 14.7027 16.7216 14.8258 16.375 14.8636V14.9091C16.8447 14.9602 17.1979 15.1042 17.4347 15.3409C17.6714 15.5758 17.7879 15.8712 17.7841 16.2273C17.786 16.5682 17.6837 16.8703 17.4773 17.1335C17.2727 17.3968 16.9877 17.6032 16.6222 17.7528C16.2585 17.9025 15.839 17.9773 15.3636 17.9773Z",fill:"#2A65FE"}),(0,i.jsx)("path",{d:"M8.08092 18V16.8636L10.2514 15.0682C10.3953 14.9489 10.5184 14.8371 10.6207 14.7329C10.7249 14.6269 10.8044 14.518 10.8593 14.4062C10.9161 14.2945 10.9446 14.1704 10.9446 14.0341C10.9446 13.8845 10.9124 13.7566 10.848 13.6506C10.7855 13.5445 10.6983 13.4631 10.5866 13.4062C10.4749 13.3475 10.3461 13.3182 10.2002 13.3182C10.0544 13.3182 9.92562 13.3475 9.81388 13.4062C9.70403 13.465 9.6188 13.5511 9.55819 13.6648C9.49759 13.7784 9.46729 13.9167 9.46729 14.0795H7.96729C7.96729 13.6704 8.05914 13.3182 8.24285 13.0227C8.42657 12.7273 8.68603 12.5 9.02126 12.3409C9.35649 12.1818 9.74948 12.1023 10.2002 12.1023C10.6661 12.1023 11.0696 12.1771 11.4105 12.3267C11.7533 12.4744 12.0175 12.6828 12.2031 12.9517C12.3906 13.2206 12.4843 13.536 12.4843 13.8977C12.4843 14.1212 12.4379 14.3437 12.3451 14.5653C12.2523 14.785 12.0857 15.0284 11.8451 15.2954C11.6046 15.5625 11.2627 15.8807 10.8196 16.25L10.2741 16.7045V16.7386H12.5468V18H8.08092Z",fill:"#2A65FE"}),(0,i.jsx)("path",{d:"M6.88636 12.1818V18H5.30682V13.6364H5.27273L4 14.3977V13.0568L5.43182 12.1818H6.88636Z",fill:"#2A65FE"}),(0,i.jsx)("path",{d:"M24 8.07647L22.8574 9.24094L20.8081 7.15247V18H19.1919V7.15247L17.1442 9.24094L16 8.07647L20 4L24 8.07647Z",fill:"#0C50FF"})]});(0,e.registerBlockType)(c.UU,{title:(0,t.__)(c.DD,"cozy-addons"),description:(0,t.__)("Highlight achievements and statistics with our 'Counter' block, a sleek number counter that elegantly displays numbers and stats to captivate your audience.","cozy-addons"),icon:{src:d},edit:function({attributes:e,setAttributes:l,clientId:s}){if(e.cover)return(0,i.jsx)("img",{src:e.cover});e.blockClientId=s;const c=(0,o.useBlockProps)({className:"cozy-block-wrapper"}),d=`cozyBlock_${s.replace(/-/gi,"_")}`,h=function(){let e=[{label:"Default",value:""}];if("object"==typeof cozyBlockAssets.googleFonts)for(let t in cozyBlockAssets.googleFonts)e.push({label:cozyBlockAssets.googleFonts[t],value:t});return e}();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{...c,children:[(0,i.jsx)(o.BlockControls,{children:(0,i.jsx)(o.AlignmentToolbar,{value:e.textAlign,onChange:t=>l({...e,textAlign:t})})}),(0,i.jsx)(r,{clientId:s,attributes:e,blockId:d})]}),(0,i.jsxs)(o.InspectorControls,{group:"settings",children:[(0,i.jsxs)(n.PanelBody,{title:(0,t.__)("General","cozy-addons"),children:[(0,i.jsx)(n.TextControl,{label:(0,t.__)("End Number","cozy-addons"),type:"number",value:e.endNumber,onChange:t=>l({...e,endNumber:t})}),(0,i.jsx)(n.RangeControl,{label:(0,t.__)("Animation Duration(ms)","cozy-addons"),min:500,max:9999,value:e.animationDuration,onChange:t=>l({...e,animationDuration:Math.abs(t)})})]}),!cozyBlockAssets.isPremium&&(0,i.jsx)(a,{})]},"setting"),(0,i.jsx)(o.InspectorControls,{group:"styles",children:(0,i.jsxs)(n.PanelBody,{title:(0,t.__)("Typography","cozy-addons"),children:[(0,i.jsx)(n.SelectControl,{label:(0,t.__)("Font Family","cozy-addons"),options:h,value:e.styles.fontFamily,onChange:t=>l({...e,styles:{...e.styles,fontFamily:t}})}),(0,i.jsxs)("div",{className:"cozy-block-styles__div-separator",style:{margin:"16px 0"},children:[(0,i.jsx)("div",{style:{width:"100%"},children:(0,i.jsx)(n.__experimentalUnitControl,{label:(0,t.__)("Font Size","cozy-addons"),value:e.styles.fontSize,onChange:t=>l({...e,styles:{...e.styles,fontSize:t}})})}),(0,i.jsx)("div",{style:{width:"100%"},children:(0,i.jsx)(n.SelectControl,{label:(0,t.__)("Font Weight","cozy-addons"),options:[{label:(0,t.__)("Thin","cozy-addons"),value:100},{label:(0,t.__)("Extra Light","cozy-addons"),value:200},{label:(0,t.__)("Light","cozy-addons"),value:300},{label:(0,t.__)("Normal","cozy-addons"),value:400},{label:(0,t.__)("Medium","cozy-addons"),value:500},{label:(0,t.__)("Semi Bold","cozy-addons"),value:600},{label:(0,t.__)("Bold","cozy-addons"),value:700},{label:(0,t.__)("Extra Bold","cozy-addons"),value:800}],value:e.styles.fontWeight,onChange:t=>l({...e,styles:{...e.styles,fontWeight:t}})})})]}),(0,i.jsx)(o.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,t.__)("Color","cozy-addons"),colorSettings:[{label:(0,t.__)("Default","cozy-addons"),value:e.styles.color,onChange:t=>l({...e,styles:{...e.styles,color:t}})}]})]})},"style")]})},save:function({attributes:e}){const t=`cozyBlock_${(o=e.blockClientId,o.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var o;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"cozy-block-counter",id:t,children:(0,i.jsx)("span",{children:"0"})})})}})}},o={};function n(e){var l=o[e];if(void 0!==l)return l.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,o,l,s)=>{if(!o){var i=1/0;for(d=0;d<e.length;d++){for(var[o,l,s]=e[d],a=!0,r=0;r<o.length;r++)(!1&s||i>=s)&&Object.keys(n.O).every((e=>n.O[e](o[r])))?o.splice(r--,1):(a=!1,s<i&&(i=s));if(a){e.splice(d--,1);var c=l();void 0!==c&&(t=c)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[o,l,s]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var l,s,[i,a,r]=o,c=0;if(i.some((t=>0!==e[t]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(r)var d=r(n)}for(t&&t(o);c<i.length;c++)s=i[c],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(d)},o=globalThis.webpackChunkcount_down=globalThis.webpackChunkcount_down||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var l=n.O(void 0,[350],(()=>n(983)));l=n.O(l)})();
Save
Back