PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.0.40
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.0.40
2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 All 108 releases
b-blocks / build / animated-text / view.js

view.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.0.40, at build/animated-text/view.js

1 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},8744:(t,e,n)=>{var r=n(5795);e.H=r.createRoot,r.hydrateRoot}},e={};const n=window.React;var r=function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}(8744);const o="linear-gradient(135deg, #0040E3, #18D4FD)",a=(t,e,n=!1)=>{return null==(r=e)||""===r||Array.isArray(r)&&0===r.length||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&""===r.trim()||"number"==typeof r&&0===r?"":`${t}: ${e}${n?" !important":""};`;var r},i=(t,e=!0,n=!0,r=!0)=>{const{type:i="solid",color:s="",gradient:l=o,image:c={},position:d="center center",attachment:u="",repeat:p="no-repeat",size:$="",overlayColor:f=""}=t||{};return"gradient"===i&&n?a("background",l):"image"===i&&r?`background: url(${c?.url});\n\t\t\t\t${a("background-color",f)}\n\t\t\t\t${a("background-position",d)}\n\t\t\t\t${a("background-size",$)}\n\t\t\t\t${a("background-repeat",p)}\n\t\t\t\t${a("background-attachment",u)}\n\t\t\t\t${a("background-repeat",p)}\n\t\t\t\tbackground-blend-mode: overlay;`:e&&a("background",s)},s=t=>{const{width:e="",style:n="solid",color:r="",side:o="all",radius:i=""}=t||{},s=t=>{const e=o?.toLowerCase();return e?.includes("all")||e?.includes(t)},l=`${e} ${n} ${r}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>s(t)?`border-${t}: ${l};`:"")).join(""):""}\n\t\t${a("border-radius",i)}\n\t`;return c},l=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:a="0px",bottom:i="0px",left:s="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${a} ${i} ${s}`},c=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:o="sans-serif",fontVariant:i=400,fontWeight:s,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:u,textDecoration:p,lineHeight:$,letterSpace:f}=e||{},g=!n||!r||"Default"===r,m=c?.desktop||c,y=c?.tablet||m,b=c?.mobile||y,h=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},x=`\n\t\t${g?"":`font-family: '${r}', ${o};`}\n\t\t${a("font-weight",s)}\n\t\t${a("font-size",h(m))}\n\t\t${a("font-style",d)}\n\t\t${a("text-transform",u)}\n\t\t${a("text-decoration",p)}\n\t\t${a("line-height",$)}\n\t\t${a("letter-spacing",f)}\n\t`,v=i&&400!==i?"400i"===i?":ital@1":i?.includes("00i")?`: ital, wght@1, ${i?.replace("00i","00")} `:`: wght@${i} `:"",k=g?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${v.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||g?"":`@import url(${k});`,styles:`${t}{\n\t\t\t${x}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${a("font-size",h(y))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${t}{\n\t\t\t\t${a("font-size",h(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},d="bBlocksAnimatedText",u=({attributes:t,id:e})=>{const{textAlign:r,background:o,typography:a,color:u,padding:p,border:$}=t,f=`#${e} .${d}`;return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${c("",a)?.googleFontLink}\n\t\t${c(`${f} .content`,a)?.styles}\n\n\t\t${f}{\n\t\t\ttext-align: ${r};\n\t\t\t${i(o)}\n\t\t\tpadding: ${l(p)};\n\t\t\t${s($)}\n\t\t}\n\t\t${f} .content{\n\t\t\tcolor: ${u};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},p=jQuery;document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-animated-text").forEach((t=>{const e=JSON.parse(t.dataset.attributes);(0,r.H)(t).render((0,n.createElement)(n.Fragment,null,(0,n.createElement)(u,{attributes:e,id:t.id}),(0,n.createElement)($,{attributes:e,id:t.id}))),t?.removeAttribute("data-attributes")}))}));const $=({attributes:t,id:e})=>{const{loop:r,animateIn:o,inEffect:a,inSequence:i,outEffect:s,outSequence:l,content:c}=t,u=`#${e} .content`;return(0,n.useEffect)((()=>{const e=new IntersectionObserver((n=>{n[0].intersectionRatio<=0||(p(u).textillate((t=>{const{loop:e,animateIn:n,inEffect:r,inSequence:o,outEffect:a,outSequence:i}=t;return{loop:e,minDisplayTime:2e3,initialDelay:0,autoStart:!0,inEffects:[],outEffects:["hinge"],in:{effect:r,delayScale:1.5,delay:50,sync:"sync"===o,shuffle:"shuffle"===o,reverse:"reverse"===o},out:{effect:a,delayScale:1.5,delay:50,sync:"sync"===i,shuffle:"shuffle"===i,reverse:"reverse"===i},type:n}})(t)),e.unobserve(n[0].target))}));e.observe(document.querySelector(u))}),[r,o,a,i,s,l]),(0,n.createElement)("div",{className:d},(0,n.createElement)("p",{className:"content"},c))}})();