var popupIsOpen = false; const openPopup = document.querySelectorAll('[popup="open"]'); const closePopup = document.querySelectorAll('[popup="close"]'); openPopup.forEach((el) => { el.addEventListener("click", function () { popupIsOpen = true; }); }); closePopup.forEach((el) => { el.addEventListener("click", function () { popupIsOpen = false; }); }); let tlCounter = gsap.timeline({}); window.onload = () => { lottie_load(), tlCounter.to(counter, { value: 0, duration: 4, ease: Power1.easeOut, onUpdate: counterChange, }); }; let lottie_target = document.querySelector("#target-lottie"), lottie_sensivity = 14e3, lottie_sensivity2 = 2860, scroll_loop_once = !0, a = "https://uploads-ssl.webflow.com/6266eeaffe48d61a4d9852b0/", b = "_redis_team-", progress_path2, imageWidthCurrent = 250, imageHeightCurrent = 3460 / 14.4; window.screen.width <= 479 && ((imageWidthCurrent = 500), (imageHeightCurrent = 3460 / 3.6 / 2)); let counter = { value: 0.5 }; function counterChange() { progress_path2 = Math.abs( (scroller_4.y % lottie_sensivity2) / lottie_sensivity2 + counter.value ); } function lerp(e, r, t) { return e * (1 - t) + r * t; } let lerpProgress = 0, prevFrame = 0; gsap.registerPlugin(ScrollTrigger); const rows = 10, columns = 10, missingImages = 0, frame_count = 99, imageWidth = imageWidthCurrent, imageHeight = imageHeightCurrent, horizDiff = imageWidth / 10, vertDiff = imageHeight / 10; gsap.set(lottie_target, { width: horizDiff + "vw", height: vertDiff + "vw" }); const setPos = gsap.quickSetter(lottie_target, "background-position"), obj = { num: 0 }; let baseTimeLine = gsap.timeline(); baseTimeLine.to(obj, { num: 99, ease: "steps(99)", duration: 2, repeat: 2, onUpdate: () => setPos(` ${-Math.abs((obj.num % 10) * horizDiff)}vw ${-Math.abs(Math.floor(obj.num / 10) * vertDiff)}vw `), }); let rndm_img = [ a + "62ea5ec2eaebaffad18622e4" + b + "22.webp", a + "62ea5ec244e58a9d70fded07" + b + "23.webp", a + "62ea5ec283543e6292b2c21a" + b + "21.webp", a + "62ea5ec18685a9ee6883acb8" + b + "13.webp", a + "62ea5ec1c69f44923f0185fb" + b + "20.webp", a + "62ea5ec101756754295aac08" + b + "17.webp", a + "62ea5ec1eaebaf61e28622e3" + b + "18.webp", a + "62ea5ec130d1076108ad3d41" + b + "16.webp", a + "62ea5ec19bacb82148bf5da3" + b + "19.webp", a + "62ea5ec1dc7075509e1ea5e8" + b + "15.webp", a + "62ea5ec1eaebafe8488622e2" + b + "12.webp", a + "62ea5ec1747ad25d066bc036" + b + "14.webp", a + "62ea5ec130d10733f0ad3d40" + b + "11.webp", a + "62ea5ec17b23f032c0208599" + b + "6.webp", a + "62ea5ec1da8fd04542291bb2" + b + "5.webp", a + "62ea5ec144e58a1a8ffded06" + b + "3.webp", a + "62ea5ec1c8ad8d812f021e57" + b + "4.webp", a + "62ea5ec13733b47292cc613c" + b + "9.webp", a + "62ea5ec14b368500765a5473" + b + "8.webp", a + "62ea5ec0700b63f7ad60d2d7" + b + "10.webp", a + "62ea5ec0dc7075824c1ea5e7" + b + "2.webp", a + "62ea5ec0fb5c9ec5985cb9f6" + b + "1.webp", a + "62ea5ec0131e4289d616fe66" + b + "7.webp", ], rndm_img_hover = [ a + "62ea63c783543e3a0bb2ff24" + b + "22-redis.webp", a + "62ea63c7da8fd07ed8297bed" + b + "23-redis.webp", a + "62ea63c71bc4608bd567b3bf" + b + "21-redis.webp", a + "62ea63c65f58243e7ee1fc91" + b + "13-redis.webp", a + "62ea63c7b102af3246e0f36e" + b + "20-redis.webp", a + "62ea63c67af19a1304ca7636" + b + "17-redis.webp", a + "62ea63c6f0132341d1be628e" + b + "18-redis.webp", a + "62ea63c6747ad263d86beb96" + b + "16-redis.webp", a + "62ea63c7f84fe427ca4766e3" + b + "19-redis.webp", a + "62ea63c655a4e65071a4121b" + b + "15-redis.webp", a + "62ea63c69b9855ed3941c316" + b + "12-redis.webp", a + "62ea63c667dbd2dcd811d53a" + b + "14-redis.webp", a + "62ea63c6bbc7828e4c64a42a" + b + "11-redis.webp", a + "62ea63c6df96d80892c6d43b" + b + "6-redis.webp", a + "62ea63c6747ad248066beb91" + b + "5-redis.webp", a + "62ea63c6fb5c9e70205d006d" + b + "3-redis.webp", a + "62ea63c6156de87e86b56006" + b + "4-redis.webp", a + "62ea63c6156de86104b56005" + b + "9-redis.webp", a + "62ea63c6130ed4258f4850c5" + b + "8-redis.webp", a + "62ea63c6f84fe4f7a04766dc" + b + "10-redis.webp", a + "62ea63c69c9dd4670727dba2" + b + "2-redis.webp", a + "62ea63c631321ea5373427a3" + b + "1-redis.webp", a + "62ea63c6edb082afd5f140df" + b + "7-redis.webp", ], rndm_count = 0, team_img, team_img_hover; gsap.registerPlugin(MotionPathPlugin); var path_tween = gsap.to(".lottie-wrapper", { ease: "linear", motionPath: { path: "#path", align: "#path", alignOrigin: [0.5, 0.5] }, }); let scroll_wrapper_1 = document.getElementsByClassName("global-wrapper")[0], scroll_wrapper_2 = document.getElementsByClassName("image__container")[0], scroll_wrapper_3 = document.getElementsByClassName("image__container")[0], scroll_wrapper_4 = document.getElementsByClassName( "image__container-redis" )[0], target_1 = document.getElementById("target"), target_2 = document.getElementById("target2"), target_3 = document.getElementById("target3"), target_4 = document.getElementById("target4"), windowHeight_1 = scroll_wrapper_1.clientHeight, windowHeight_2 = scroll_wrapper_2.clientHeight, windowHeight_3 = scroll_wrapper_3.clientHeight, windowHeight_4 = scroll_wrapper_4.clientHeight, windowInnerHeight = window.innerHeight, newScrollY = 0; if (window.screen.width > 479) { window.addEventListener("resize", check_device); var scroller_1 = { wheelMultiplier: getLineHeight(), ease: 0.15, speed: 0, y: 0, }, scroller_2 = { wheelMultiplier: getLineHeight(), ease: 0.12, speed: 0, y: 0, }, scroller_3 = { wheelMultiplier: getLineHeight(), ease: 0.1, speed: 0, y: 0, }, scroller_4 = { wheelMultiplier: getLineHeight(), ease: 0.18, speed: 0, y: 0, }; } else var scroller_1 = { wheelMultiplier: getLineHeight(), ease: 0.04, speed: 0, y: 0, }, scroller_2 = { wheelMultiplier: getLineHeight(), ease: 0.045, speed: 0, y: 0, }, scroller_3 = { wheelMultiplier: getLineHeight(), ease: 0.05, speed: 0, y: 0, }, scroller_4 = { wheelMultiplier: getLineHeight(), ease: 0.055, speed: 0, y: 0, }; let touch_up = 0, touch_down = 0, touch_path = 0, touch_speed = 0.05, touch_inertia = 0, point_click = !1, first_click = !1; function pointer_move(e) { if (popupIsOpen === false) { if (((touch_up = e.touches[0].clientY), !0 == point_click)) { if (!0 == first_click) { let r = 0.07 * Math.pow(Math.abs((touch_path = touch_up - touch_down)), 1.05); r > 0.5 ? ((scroller_1.speed -= touch_path * scroller_1.wheelMultiplier * touch_speed * r), (scroller_2.speed -= touch_path * scroller_2.wheelMultiplier * touch_speed * r), (scroller_3.speed -= touch_path * scroller_3.wheelMultiplier * touch_speed * r), (scroller_4.speed -= touch_path * scroller_4.wheelMultiplier * touch_speed * r)) : ((scroller_1.speed -= touch_path * scroller_1.wheelMultiplier * touch_speed), (scroller_2.speed -= touch_path * scroller_2.wheelMultiplier * touch_speed), (scroller_3.speed -= touch_path * scroller_3.wheelMultiplier * touch_speed), (scroller_4.speed -= touch_path * scroller_4.wheelMultiplier * touch_speed)); } first_click = !0; } touch_down = e.touches[0].clientY; } } function point_down() { Math.abs(scroller_1.speed) > 1 && ((scroller_1.speed = 0), (scroller_2.speed = 0), (scroller_3.speed = 0), (scroller_4.speed = 0)), (point_click = !0); } function point_cancel() { (point_click = !1), (first_click = !1); } function onWheel(e) { if (popupIsOpen === false) { var r, t = e.wheelDelta; (r = t ? (t = e.deltaY || e.detail || 0) / 120 : t / 120), (scroller_1.speed += r * scroller_1.wheelMultiplier), (scroller_2.speed += r * scroller_2.wheelMultiplier), (scroller_3.speed += r * scroller_3.wheelMultiplier), (scroller_4.speed += r * scroller_4.wheelMultiplier); } } function getLineHeight() { var e = document.createElement("div"); (e.style["font-size"] = "128ex"), document.body.appendChild(e); var r = getComputedStyle(e).getPropertyValue("font-size"), t = parseFloat(r, 10) / 128; return document.body.removeChild(e), t; } function onFrame() { (scroller_1.speed += -this.scroller_1.speed * this.scroller_1.ease), (scroller_2.speed += -this.scroller_2.speed * this.scroller_2.ease), (scroller_3.speed += -this.scroller_3.speed * this.scroller_3.ease), (scroller_4.speed += -this.scroller_4.speed * this.scroller_4.ease), (scroller_1.y -= Math.round(1e3 * scroller_1.speed) / 1e3), (scroller_2.y -= Math.round(1e3 * scroller_2.speed) / 1e3), (scroller_3.y -= Math.round(1e3 * scroller_3.speed) / 1e3), (scroller_4.y -= Math.round(1e3 * scroller_4.speed) / 1e3); var e = scroller_1.y % windowHeight_1, r = scroller_2.y % windowHeight_2, t = scroller_3.y % windowHeight_3, l = scroller_4.y % windowHeight_4; if ( (e > 0 && (e -= windowHeight_1), r > 0 && (r -= windowHeight_2), t > 0 && (t -= windowHeight_3), l > 0 && (l -= windowHeight_4), 1e3 > Math.abs(e)) ) { if (!0 == scroll_loop_once) { scroll_loop_once = !1; let o = []; for (i = 1; i <= 23; i++) o.push(i); for (countCycles = 1; countCycles <= 11; countCycles++) (rndm_count = o.splice(Math.random() * o.length, 1)[0]), (team_img = document.querySelectorAll(".comands__image")[ countCycles - 1 ]).setAttribute("src", rndm_img[rndm_count - 1]), (team_img_hover = document.querySelectorAll(".comands__image--hover")[ countCycles - 1 ]).setAttribute("src", rndm_img_hover[rndm_count - 1]); } } else scroll_loop_once = !0; e !== newScrollY && (TweenLite.set(target_1, { rotate: 0.01, y: e, force3D: !0 }), (e = scroller_1.y)), r !== newScrollY && (TweenLite.set(target_2, { rotate: 0.01, y: r, force3D: !0 }), (r = scroller_2.y)), t !== newScrollY && (TweenLite.set(target_3, { rotate: 0.01, y: t, force3D: !0 }), (t = scroller_3.y)), l !== newScrollY && (TweenLite.set(target_4, { rotate: 0.01, y: l, force3D: !0 }), (l = scroller_4.y)); let s = Math.abs((scroller_4.y % lottie_sensivity) / lottie_sensivity); (lerpProgress = lerp( prevFrame, (progress_path2 = Math.abs( (scroller_4.y % lottie_sensivity2) / lottie_sensivity2 + counter.value )), 0.01 )), (prevFrame = progress_path2), baseTimeLine.progress(lerpProgress), path_tween.progress(s); let c = Math.cos(5e-4 * scroller_4.y); (lottie_target.style.transform = "rotate(" + 30 * c + "deg)"), window.requestAnimationFrame(onFrame); } onFrame(); let progress_bar = document.querySelector(".preloader-line"), logo_bar = document.querySelector(".logo-bar"), logo_bar_mob = document.querySelector(".logo-bar-mob"), bt_bar_1 = document.querySelector(".bt_bar_1"), bt_bar_2 = document.querySelector(".bt_bar_2"), bt_bar_3 = document.querySelector(".bt_bar_3"), bt_bar_4 = document.querySelector(".bt_bar_4"), header_text = document.querySelector(".animate-header-text"), left_herb = document.querySelector(".animate-left-herb"), right_herb = document.querySelector(".animate-right-herb"), redis_img = document.querySelector(".lottie-container"), redisBG = document.getElementById("target4"), botvaDown = document.querySelector(".conatcts__image-is2"), botvaRightDown = document.querySelector(".about__image"); bt_openmenu = document.querySelector(".menu-new__bt-burger"); function lottie_load() { progress_bar.setAttribute( "style", "transition-duration: 300ms, 300ms !important;" ); progress_bar.style.width = "100%"; progress_bar.style.height = "0px"; redisBG.style.opacity = "100"; botvaDown.style.opacity = "100"; botvaRightDown.style.opacity = "100"; header_text.style.transform = "translate(0vh)"; window.screen.width > 479 ? (logo_bar.style.transform = "translate(0vh) scale(1)") : (logo_bar_mob.style.transform = "translate(0vh) scale(1)"), setTimeout(() => { left_herb.style.transform = "translate(0vh) rotate(0deg)"; right_herb.style.transform = "translate(0vh) rotateX(-180deg) rotateY(-180deg) rotateZ(0deg)"; }, 400), setTimeout(() => { bt_bar_1.style.opacity = "100"; bt_bar_2.style.opacity = "100"; bt_bar_3.style.opacity = "100"; bt_openmenu.style.opacity = "100"; }, 500), setTimeout(() => { (redis_img.style.transform = "translate(0vh) rotate(-33deg)"), window.addEventListener("touchstart", point_down), window.addEventListener("touchend", point_cancel), window.addEventListener("touchmove", pointer_move), window.addEventListener("wheel", onWheel); }, 700); } function check_device() { document.location.reload(); } progress_bar.style.width = "70%"; redisBG.style.opacity = "0"; botvaDown.style.opacity = "0"; botvaRightDown.style.opacity = "0"; // const bt_anchor_1 = document.querySelector(".link-1"); // const bt_anchor_2 = document.querySelector(".link-2"); // const bt_anchor_3 = document.querySelector(".bt-anchor-2"); const bt_anchor_1 = document.querySelector("[link='1']"); const bt_anchor_2 = document.querySelector("[link='2']"); const bt_anchor_3 = document.querySelector("[link='3']"); const pageTransition = document.querySelector(".transition"); bt_anchor_1.addEventListener("click", function (e) { pageTransition.style.opacity = "100"; window.screen.width > 479 ? setTimeout(() => { (scroller_1.y = -1.15 * innerWidth), (scroller_2.y = -1.15 * innerWidth), (scroller_3.y = -1.15 * innerWidth), (scroller_4.y = -1.325 * innerWidth); }, 400) : setTimeout(() => { (scroller_1.y = -2.95 * innerWidth), (scroller_2.y = -2.95 * innerWidth), (scroller_3.y = -2.95 * innerWidth), (scroller_4.y = -10.3 * innerWidth); }, 400), setTimeout(() => { pageTransition.style.opacity = "0"; }, 400); }); bt_anchor_2.addEventListener("click", function (e) { pageTransition.style.opacity = "100"; window.screen.width > 479 ? setTimeout(() => { (scroller_1.y = -2.25 * innerWidth), (scroller_2.y = -2.25 * innerWidth), (scroller_3.y = -2.25 * innerWidth), (scroller_4.y = -2.325 * innerWidth); }, 400) : setTimeout(() => { (scroller_1.y = -4.9 * innerWidth), (scroller_2.y = -4.9 * innerWidth), (scroller_3.y = -4.9 * innerWidth), (scroller_4.y = -20.3 * innerWidth); }, 400), setTimeout(() => { pageTransition.style.opacity = "0"; }, 400); }); bt_anchor_3.addEventListener("click", function (e) { pageTransition.style.opacity = "100"; window.screen.width > 479 ? setTimeout(() => { (scroller_1.y = -3.85 * innerWidth), (scroller_2.y = -3.85 * innerWidth), (scroller_3.y = -3.85 * innerWidth), (scroller_4.y = -2.875 * innerWidth); }, 400) : setTimeout(() => { (scroller_1.y = -8.1 * innerWidth), (scroller_2.y = -8.1 * innerWidth), (scroller_3.y = -8.1 * innerWidth), (scroller_4.y = -31.3 * innerWidth); }, 400), setTimeout(() => { pageTransition.style.opacity = "0"; }, 400); });