import{r,q as y,c as N,bs as k,bt as n,j as e,m as d}from"./index-CxGMQRP8.js";import{T as z,R}from"./turtle-DSilfOTO.js";const T="https://cdn.storysparkle.org/landing_assets/flicker-torso-surprised.webp",$="https://cdn.storysparkle.org/landing_assets/green-tablet-frame.webp",E="https://cdn.storysparkle.org/landing_assets/orange-tablet-frame.webp",F="https://cdn.storysparkle.org/landing_assets/pace-slow-reduced-size.mp4",Y="https://cdn.storysparkle.org/landing_assets/pace-normal-reduced-size.mp4",S=()=>{const c=r.useRef(null),o=r.useRef(null),a=r.useRef(null),t=y(),{t:m}=N("landing"),[x,f]=r.useState(!1),[p,h]=r.useState(!1),{scrollYProgress:l}=k({target:c,offset:["start start","end end"]});n(l,[0,.15],[0,1]),n(l,[0,.15],[30,0]);const b=n(l,[0,.2,.8,1],t?["80%","0%","0%","0%"]:["100%","0%","0%","0%"]),w=n(l,[.3,.6,.8,1],[400,0,0,0]),v=n(l,[.3,.6,.8,1],[400,0,0,0]),i=s=>{f(s),o.current&&(o.current.muted=!s)},u=s=>{h(s),a.current&&(a.current.muted=!s)};return r.useEffect(()=>{(()=>{o.current?.play().catch(()=>{}),a.current?.play().catch(()=>{})})()},[]),r.useEffect(()=>{if(!t)return;const s=c.current;if(!s)return;const g=new IntersectionObserver(([j])=>{j.isIntersecting||(o.current&&(o.current.muted=!0),a.current&&(a.current.muted=!0),f(!1),h(!1))},{threshold:0});return g.observe(s),()=>g.disconnect()},[t]),e.jsx("section",{ref:c,className:"relative h-[300vh]",style:{background:"#E0F5F0"},children:e.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] flex items-end justify-center relative",style:{background:"#E0F5F0"},children:[e.jsx("h2",{className:`absolute z-30 section-header text-[22px] lg:text-[32px] ${t?"top-[6%] left-0 right-0 text-center px-4":"top-[15%] left-[5%] max-w-[200px] lg:max-w-[280px] max-[1366px]:lg:max-w-[200px] max-[1366px]:lg:text-[26px] max-[1366px]:lg:leading-tight text-left"}`,children:m("chooseYourPace.heading")}),e.jsx("p",{className:`absolute z-30 section-subtext text-sm lg:text-xl ${t?"top-[14%] left-0 right-0 text-center px-4 ipad-portrait:!max-w-xs ipad-portrait:!mx-auto":"top-[15%] right-[5%] max-w-[280px] lg:max-w-[320px] max-[1366px]:lg:max-w-[240px] max-[1366px]:lg:text-lg text-right"}`,children:m("chooseYourPace.subtext")}),e.jsx(d.div,{style:{y:b},className:"absolute bottom-0 left-0 right-0 flex justify-center z-10",children:e.jsx("img",{src:T,alt:"Flicker the owl mascot looking surprised",className:`${t?"h-[70vh]":"h-[120vh]"} w-auto object-contain object-bottom`})}),e.jsxs(d.div,{style:{y:w},animate:{rotate:x?0:10},transition:{type:"spring",stiffness:300,damping:20},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onTouchStart:()=>i(!x),className:`absolute cursor-pointer z-20 ${t?"bottom-[-1%] left-[-4%]":"bottom-[-5%] left-[5%]"}`,children:[e.jsx("img",{src:$,alt:"Green tablet held by hand",className:"w-[13rem] md:w-[22.5rem] lg:w-[30rem] xl:w-[37.5rem] h-auto relative z-10"}),e.jsx("div",{className:"absolute top-[15%] left-[15%] right-[15%] bottom-[20%] overflow-hidden rounded-xl z-20 flex items-center justify-center",children:e.jsx("div",{className:"w-full relative rounded-xl overflow-hidden",style:{aspectRatio:"2.5 / 1"},children:e.jsx("video",{ref:o,src:F,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover object-center rounded-xl"})})}),e.jsx("div",{className:`absolute left-1/2 -translate-x-1/2 z-30 ${t?"bottom-[10%]":"bottom-[12%]"}`,children:e.jsx(z,{className:`${t?"w-8 h-8":"w-12 h-12 lg:w-14 lg:h-14"} text-green-700`})})]}),e.jsxs(d.div,{style:{y:v},animate:{rotate:p?0:-10},transition:{type:"spring",stiffness:300,damping:20},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onTouchStart:()=>u(!p),className:`absolute cursor-pointer z-20 ${t?"bottom-[-1%] right-[-4%]":"bottom-[-5%] right-[5%]"}`,children:[e.jsx("img",{src:E,alt:"Orange tablet held by hand",className:"w-[13rem] md:w-[22.5rem] lg:w-[30rem] xl:w-[37.5rem] h-auto relative z-10"}),e.jsx("div",{className:"absolute top-[15%] left-[15%] right-[15%] bottom-[20%] overflow-hidden rounded-xl z-20 flex items-center justify-center",children:e.jsx("div",{className:"w-full relative rounded-xl overflow-hidden",style:{aspectRatio:"2.5 / 1"},children:e.jsx("video",{ref:a,src:Y,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover object-center rounded-xl"})})}),e.jsx("div",{className:`absolute left-1/2 -translate-x-1/2 z-30 ${t?"bottom-[10%]":"bottom-[12%]"}`,children:e.jsx(R,{className:`${t?"w-8 h-8":"w-12 h-12 lg:w-14 lg:h-14"} text-orange-700`})})]})]})})};export{S as default};
//# sourceMappingURL=ChooseYourPaceSection-CN0badvS.js.map