-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-templates-services-tsx-e4d2d12096012ba30740.js
2 lines (2 loc) · 4.39 KB
/
component---src-pages-templates-services-tsx-e4d2d12096012ba30740.js
1
2
"use strict";(self.webpackChunkcode_cave=self.webpackChunkcode_cave||[]).push([[417],{8686:function(e,t,s){s.r(t),s.d(t,{Head:function(){return v},default:function(){return x}});var l=s(7294),a=s(8032),n=s(4471),i=s.n(n),r=s(1929),c=s(1164),o=s(9165),m=s(5081),d=s(1312),p=s(917);var u=e=>{let{service:t,className:s}=e;const{html:l,frontmatter:{title:a,keywords:n,image:{publicURL:i}}}=t;return(0,p.tZ)("div",{className:`service-preview origin-[5%_50%] break-inside-avoid flex flex-col gap-5 sm:px-8 py-8 text-secondary-100 cursor-pointer ${s}`,itemScope:!0,itemType:"https://schema.org/Service"},(0,p.tZ)("div",{className:"flex items-center gap-5"},(0,p.tZ)("img",{src:i,alt:`${a} logo`,className:"invert h-10 w-10"}),(0,p.tZ)("h2",{className:"font-bold text-2xl",itemProp:"serviceType"},a)),(0,p.tZ)("div",{className:"text-base text-secondary-70",dangerouslySetInnerHTML:{__html:l},itemProp:"description"}),n?(0,p.tZ)("div",{className:"flex gap-2 flex-wrap w-full"},n.map((e=>(0,p.tZ)("p",{key:e,className:"h-8 flex items-center whitespace-nowrap px-4 bg-main-70 text-secondary-70 rounded-lg"},e)))):null)},g=s(7462);const h=e=>{let{service:t,className:s,...l}=e;const{frontmatter:{title:a,image:{publicURL:n}}}=t;return(0,p.tZ)("button",(0,g.Z)({"aria-label":"view service",className:`flex gap-5 min-h-10 items-center ${s}`,type:"button"},l),(0,p.tZ)("div",{className:"py-1.5"},(0,p.tZ)("img",{src:n,alt:`${a} logo`,className:"invert h-7 w-7"})),(0,p.tZ)("h2",{className:"hidden lg:block font-semibold text-lg text-secondary-100 text-start"},a))};var f=e=>{let{services:t}=e;const[s,a]=(0,d.Z)({axis:"y",loop:!0,skipSnaps:!0,align:"center"}),n=(0,l.useRef)(0),i=(0,l.useRef)([]),{selectedIndex:r,onServiceButtonClick:c}=((e,t)=>{const{0:s,1:a}=(0,l.useState)(0),n=(0,l.useCallback)((s=>{e&&(e.scrollTo(s),t&&t(e))}),[e,t]),i=(0,l.useCallback)((e=>{a(e.selectedScrollSnap())}),[]);return(0,l.useEffect)((()=>{e&&(i(e),e.on("reInit",i).on("select",i))}),[e,i]),{selectedIndex:s,onServiceButtonClick:n}})(a),o=(0,l.useCallback)((e=>{i.current=e.slideNodes().map((e=>e.querySelector(".service-preview")))}),[]),m=(0,l.useCallback)((e=>{n.current=.2*e.scrollSnapList().length}),[]),g=(0,l.useCallback)(((e,t)=>{const s=e.internalEngine(),l=e.scrollProgress(),a=e.slidesInView(),r="scroll"===t;e.scrollSnapList().forEach(((e,t)=>{let c=e-l;s.slideRegistry[t].forEach((t=>{if(r&&!a.includes(t))return;s.options.loop&&s.slideLooper.loopPoints.forEach((s=>{const a=s.target();if(t===s.index&&0!==a){const t=Math.sign(a);-1===t&&(c=e-(1+l)),1===t&&(c=e+(1-l))}}));const o=1-Math.abs(c*n.current),m=(d=o,p=0,u=1,Math.min(Math.max(d,p),u));var d,p,u;i.current[t].style.transform=`scale(${m})`}))}))}),[]);return(0,l.useEffect)((()=>{a&&(o(a),m(a),g(a),a.on("reInit",o).on("reInit",m).on("reInit",g).on("scroll",g).on("slideFocus",g))}),[a,g]),(0,p.tZ)(l.Fragment,null,(0,p.tZ)("div",{className:"hidden sm:flex flex-col gap-5 p-8 lg:basis-[410px] shrink-0"},t?t.map(((e,t)=>(0,p.tZ)(h,{key:`dot-${e.id}`,service:e,onClick:()=>c(t),className:""+(t===r?"":"brightness-[0.4] hover:brightness-100")}))):null),(0,p.tZ)("div",{ref:s,className:"hidden sm:block overflow-hidden basis-full"},(0,p.tZ)("div",{style:{backfaceVisibility:"hidden"},className:"flex flex-col touch-pan-x h-[1000px] sm:h-[900px] md:h-[750px]"},t?t.map(((e,t)=>(0,p.tZ)("div",{key:e.id,onClick:()=>c(t),className:"grow-0 shrink-0 basis-1/3 min-h-0 select-none flex items-center"},(0,p.tZ)(u,{service:e,className:"select-none "+(t===r?"":"brightness-[0.4]")})))):null)))};var x=e=>{var t;let{data:s,pageContext:{markupData:n,lang:o}}=e;const d=null===(t=s.allMarkdownRemark)||void 0===t?void 0:t.nodes,g=(0,a.c)(n.image);return(0,p.tZ)(l.Fragment,null,(0,p.tZ)(r.Z,{heightClass:"lg:h-99",title:n.bannerTitle,image:g}),(0,p.tZ)("div",{className:"bg-main-100"},(0,p.tZ)(c.Z,{maxWidthClass:"max-w-[1280px]",className:"flex flex-col sm:flex-row items-start sm:justify-end py-6 sm:py-10 lg:!px-20 gap-0 sm:gap-5 lg:gap-[48px]"},d?(0,p.tZ)(f,{services:d}):null,d?d.map(((e,t)=>(0,p.tZ)(u,{key:e.id,service:e,className:"sm:hidden select-none"}))):null)),(0,p.tZ)(i(),{className:"w-full"}),(0,p.tZ)(m.Z,{lang:o}))};const v=e=>{let{pageContext:{markupData:t,site:s,lang:a},location:n}=e;return(0,p.tZ)(l.Fragment,null,(0,p.tZ)(o.Ag,{title:`${t.head} | ${t.bannerTitle.toUpperCase()}`,description:s.description,siteUrl:s.siteUrl,path:n.pathname,lang:a}))}}}]);
//# sourceMappingURL=component---src-pages-templates-services-tsx-e4d2d12096012ba30740.js.map