{"version":3,"file":"home-circles.js","mappings":"m1BAAA,IAEMA,EAAW,WAUd,O,EATD,SAAAA,K,4FAAcC,CAAA,KAAAD,GACZE,KAAKC,iBACLD,KAAKE,QACHC,SAASC,cAAc,mCAAqCD,SAASE,cAAc,OACrFL,KAAKM,QACHH,SAASC,cAAc,mCAAqCD,SAASE,cAAc,OACrFE,OAAOC,sBAAsBR,KAAKS,MAClCT,KAAKU,SAAW,EAChBV,KAAKW,SAAU,CACjB,G,EAAC,EAAAC,IAAA,iBAAAC,MAED,WACEb,KAAKS,KAAOT,KAAKS,KAAKK,KAAKd,KAC7B,GAAC,CAAAY,IAAA,OAAAC,MAED,WACE,IAAME,EAAeR,OAAOS,YAAc,GACpCC,EAAcjB,KAAKU,SAAWK,EACpCf,KAAKU,WArBgB,IAqBJO,EAEjB,IAAMC,EAAalB,KAAKU,SAClBS,GAAcnB,KAAKU,SAKzBV,KAAKE,QAAQkB,MAAQ,sCAAHC,OAAyCH,EAAU,QACrElB,KAAKM,QAAQc,MAAQ,uCAAHC,OAA0CF,EAAa,GAAE,SACtD,IAAjBnB,KAAKW,SACPJ,OAAOC,sBAAsBR,KAAKS,KAEtC,GAAC,CAAAG,IAAA,SAAAC,MAED,WACEb,KAAKW,SAAU,CACjB,M,6EAAC,CApCc,GAuCjB,W","sources":["webpack://@upstatement/harvard-law-school-wp-theme/./static/js/components/home-circles.js"],"sourcesContent":["const ROTATION_INERTIA = 0.05; // smaller = slower to respond\n\nclass HomeCircles {\n constructor() {\n this.setupListeners();\n this.circle1 =\n document.querySelector('.home-page__circles-svg--1 svg') || document.createElement('div');\n this.circle2 =\n document.querySelector('.home-page__circles-svg--2 svg') || document.createElement('div');\n window.requestAnimationFrame(this.loop);\n this.rotation = 0;\n this.running = true;\n }\n\n setupListeners() {\n this.loop = this.loop.bind(this);\n }\n\n loop() {\n const rotateTarget = window.pageYOffset / 25;\n const rotateDelta = this.rotation - rotateTarget;\n this.rotation += rotateDelta * -ROTATION_INERTIA;\n\n const rotateVal1 = this.rotation;\n const rotateVal2 = -this.rotation;\n\n // rotate in the target direction\n\n // Rotate SVGs in opposite directions\n this.circle1.style = `transform: translateX(20vw) rotate(${rotateVal1}deg)`;\n this.circle2.style = `transform: translateX(-20vw) rotate(${rotateVal2 + 45}deg)`;\n if (this.running === true) {\n window.requestAnimationFrame(this.loop);\n }\n }\n\n deinit() {\n this.running = false;\n }\n}\n\nexport default HomeCircles;\n"],"names":["HomeCircles","_classCallCheck","this","setupListeners","circle1","document","querySelector","createElement","circle2","window","requestAnimationFrame","loop","rotation","running","key","value","bind","rotateTarget","pageYOffset","rotateDelta","rotateVal1","rotateVal2","style","concat"],"sourceRoot":""}