(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19962],{19962:(s,t,e)=>{"use strict";e.r(t),e.d(t,{default:()=>B});var n=e(67841),a=e(79477),r=e(64833),p=e(17034),i=e(69804),l=e(52142),c=e(74631);e(39666);var o=e(95207);let d="/images/a-friendly-introduction-to-spring-physics",u={birds:"".concat(d,"/birds.png"),cloud1:"".concat(d,"/cloud-1.png"),cloud2:"".concat(d,"/cloud-2.png")},h=s=>{let{initialX:t,y:e,baseSpeed:r,friction:p,src:i,width:d}=s,[u,h]=a.useState(t),m=(0,c.Fv)(p,l.ev,l.Ip,10*r,r);return(0,o.Z)(()=>{h(s=>s>l.p0+200?-d:s+m)}),(0,n.jsx)(g,{src:i,style:{width:d,transform:"translate(".concat(u,"px, ").concat(e,"px)")}})},m=(0,r.z)("div")({name:"Wrapper",class:"wto4ngm",propsAsIs:!1}),g=(0,r.z)("img")({name:"CloudImg",class:"cuu4xl",propsAsIs:!1}),x=(0,r.z)("img")({name:"Birds",class:"b1ltth29",propsAsIs:!1}),y=s=>{let{friction:t}=s;return(0,n.jsxs)(m,{children:[(0,n.jsx)(h,{friction:t,initialX:.6*l.p0,y:.35*l.oh,baseSpeed:.1,src:u.cloud1,width:150}),(0,n.jsx)(h,{friction:t,initialX:-.2*l.p0,y:.7*l.oh,baseSpeed:.14,src:u.cloud2,width:160}),(0,n.jsx)(x,{src:u.birds})]})};e(49431);let C="/images/a-friendly-introduction-to-spring-physics",f={planet1:"".concat(C,"/gaseous-planet.png"),planet2:"".concat(C,"/shard-planet.png")},j=s=>{let{x:t,y:e,motionPath:a,src:r,width:p,duration:i}=s;return(0,n.jsx)(I,{src:r,style:{width:p,top:e,offsetPath:"path('".concat(a,"')"),animationDuration:i+"ms"}})},w=()=>(0,n.jsx)("svg",{viewBox:"0 0 491 145",style:{width:"100%"},children:(0,n.jsx)("path",{d:"M0 144.5V0.5H490.5V39C490.5 39 463.251 32.066 445.5 32.5C393.509 33.7712 378.985 120.551 331 100.5C313.099 93.02 311.386 74.6931 293 68.5C245.5 52.5 214.348 62.0443 165.5 68.5C92.0652 78.205 0 144.5 0 144.5Z",fill:"var(--color-background)"})}),v=(0,r.z)("div")({name:"Wrapper",class:"w1n953hj",propsAsIs:!1}),I=(0,r.z)("img")({name:"PlanetImg",class:"puerl17",propsAsIs:!1}),k=(0,r.z)("div")({name:"CoverWrapper",class:"ctx6yy2",propsAsIs:!1}),A=()=>(0,n.jsxs)(v,{children:[(0,n.jsx)(k,{children:(0,n.jsx)(w,{})}),(0,n.jsx)(j,{x:.6*l.p0,y:0,motionPath:"M191.297 60.4795C193.069 76.9426 184.449 93.0142 168.942 105.688C153.44 118.358 131.102 127.583 105.601 130.329C80.1004 133.074 56.3109 128.814 38.4667 119.734C20.6176 110.652 8.77468 96.783 7.00233 80.3198C5.22998 63.8567 13.8497 47.7851 29.3566 35.1117C44.8593 22.4416 67.197 13.2161 92.6977 10.4708C118.198 7.72551 141.988 11.9852 159.832 21.0652C177.681 30.1477 189.524 44.0164 191.297 60.4795Z",src:f.planet1,duration:6e4,width:100}),(0,n.jsx)(j,{x:.1*l.p0,y:.5*l.oh,motionPath:"M83.5 8.5C53.7174 28.4021 111.152 63.9236 144.5 77C171.404 87.5497 199.812 54.9569 218.5 77C238.224 100.265 221.881 131.248 200.5 153C180.755 173.087 146.428 150.115 131.5 174C109.161 209.743 198.724 206.677 211 247C234.919 325.566 24.9436 357.14 3 278C-18.6315 199.985 189.468 263.421 187 182.5C186.109 153.284 180.553 133.767 160.5 112.5C136.268 86.8012 84.1261 117.122 75 83C65.3292 46.8411 169.592 44.7735 144.5 17C128.376 -0.847078 103.498 -4.86358 83.5 8.5Z",src:f.planet2,duration:18e4,width:100})]});e(63865);let z=s=>{let{colorMode:t,type:e,flipped:a}=s;return"space"===e?(0,n.jsx)(W,{src:"/images/a-friendly-introduction-to-spring-physics/top-clamp.png"}):(0,n.jsxs)(M,{"data-flipped":String(a),children:[(0,n.jsx)(P,{src:"/images/a-friendly-introduction-to-spring-physics/plank-and-clamp.png"}),"earth"!==e&&"dark"===t&&(0,n.jsx)(S,{src:"/images/a-friendly-introduction-to-spring-physics/plank-and-clamp-outline.png"})]})},b=s=>{let{type:t,friction:e}=s;switch(t){case"earth":return(0,n.jsx)(y,{friction:e});case"space":return(0,n.jsx)(A,{});case"clear":return null;default:return(0,n.jsx)(_,{})}},q=(0,r.z)("div")({name:"Wrapper",class:"w3ksfmi",propsAsIs:!1}),P=(0,r.z)("img")({name:"PlankAndClampImg",class:"pdi0tvu",propsAsIs:!1}),W=(0,r.z)("img")({name:"ClampImg",class:"cwf3qya",propsAsIs:!1}),M=(0,r.z)("div")({name:"PlankWrapper",class:"pikuq59",propsAsIs:!1}),S=(0,r.z)(P)({name:"PlankAndClampOutline",class:"p28gbfn",propsAsIs:!0}),Z=(0,r.z)("div")({name:"Children",class:"c1tzyw2y",propsAsIs:!1}),_=(0,r.z)("div")({name:"DefaultBackground",class:"d1qno442",propsAsIs:!1}),B=s=>{let{type:t,friction:e,flipped:r,children:c}=s,{colorMode:o}=a.useContext(p.vJ);return(0,n.jsx)(i.default,{height:l.oh,children:(0,n.jsxs)(q,{style:{width:l.p0,height:l.oh},children:[(0,n.jsx)(z,{colorMode:o,type:t,flipped:r}),(0,n.jsx)(Z,{children:c}),(0,n.jsx)(b,{type:t,friction:e})]})})};e(2628)},52142:(s,t,e)=>{"use strict";e.d(t,{A5:()=>o,Hu:()=>n,Ip:()=>y,Wj:()=>d,Y1:()=>m,Y5:()=>C,cW:()=>a,dy:()=>r,ev:()=>x,hH:()=>u,oh:()=>i,p0:()=>l,rN:()=>h,wn:()=>p,xz:()=>g,yK:()=>c});let n=40,a=220,r=10,p=420,i=540,l=245,c=.5,o=1.25,d=1.75,u=3,h=30,m=400,g=200,x=0,y=35,C=12},49431:s=>{s.exports={wto4ngm:"wto4ngm",cuu4xl:"cuu4xl",b1ltth29:"b1ltth29"}},2628:s=>{s.exports={w3ksfmi:"w3ksfmi",pdi0tvu:"pdi0tvu",cwf3qya:"cwf3qya",pikuq59:"pikuq59",p28gbfn:"p28gbfn",c1tzyw2y:"c1tzyw2y",d1qno442:"d1qno442"}},63865:s=>{s.exports={w1n953hj:"w1n953hj",puerl17:"puerl17","moveAlongPath-puerl17":"moveAlongPath-puerl17",ctx6yy2:"ctx6yy2"}}}]); //# sourceMappingURL=19962.d9309ce20b61c3ad.js.map