From f309ac09a09953e8591e81a5d287ff6eec26ec3f Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Mon, 3 Jan 2022 20:39:29 +0330 Subject: [PATCH] signup added --- src/components/Button/index.js | 2 +- src/components/Input/index.js | 44 ++++--- src/components/Timer/index.js | 2 +- src/router.js | 2 +- src/utils/onInput.js | 18 +-- src/views/Auth/SignUp/index.js | 204 ++++++++++++++++++++++++++---- src/views/Home/Landscape/index.js | 199 ++++++++++++++--------------- 7 files changed, 320 insertions(+), 151 deletions(-) diff --git a/src/components/Button/index.js b/src/components/Button/index.js index ac65d92..6d11234 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -11,7 +11,7 @@ export default function Button({ }) { return ( + + + + ); } export default connect( (state) => ({ - loginFlag: state.user.setLogin, + loginFlag: state.user.status, }), { sendOtp: user.otp_login, diff --git a/src/views/Home/Landscape/index.js b/src/views/Home/Landscape/index.js index a238d68..21998a8 100644 --- a/src/views/Home/Landscape/index.js +++ b/src/views/Home/Landscape/index.js @@ -28,108 +28,109 @@ function Home({ // initialState useEffect(() => { - window.addEventListener("scroll", () => { - const scrollY = window.scrollY; - localStorage.setItem("prevScroll", scrollY); - if ( - !JSON.parse(localStorage.getItem("joiRect")) && - window.scrollY > 1000 && - window.scrollY < 2000 - ) { - localStorage.setItem( - "joiRect", - JSON.stringify( - document.getElementById("video-joi").getBoundingClientRect() - ) - ); - } - // Dotes - if (scrollY < 1.5 * height) { - if (scrollY > height) { - floatMouseToggle(false); - } else { - floatMouseToggle(true); + if (window.innerWidth > 1024) { + const scrollY = window.scrollY; + localStorage.setItem("prevScroll", scrollY); + if ( + !JSON.parse(localStorage.getItem("joiRect")) && + window.scrollY > 1000 && + window.scrollY < 2000 + ) { + localStorage.setItem( + "joiRect", + JSON.stringify( + document.getElementById("video-joi").getBoundingClientRect() + ) + ); + } + // Dotes + if (scrollY < 1.5 * height) { + if (scrollY > height) { + floatMouseToggle(false); + } else { + floatMouseToggle(true); + } } - } - // Page_1 - if (scrollY >= 0 && scrollY <= height) { - handlePage1TopPosition(); - } - // Page_2 - if (scrollY >= 0 && scrollY <= height) { - handlePage2TopPosition(); - } - if (scrollY >= 0 && scrollY <= height) { - handlePage2RotateX(window.scrollY); - } - if (scrollY >= height && scrollY <= 2 * height) { - handlePage2BoxPosition({ - scrollY, - translateX: { - pos1: -5, - pos2: 32, - }, - translateY: { - pos1: -5, - pos2: 10, - }, - rotate: { - pos1: 5, - pos2: 0, - }, - start: height, - end: 2 * height, - }); - } - if (scrollY > 2.5 * height && scrollY <= 3 * height) { - handlePage2BoxPosition({ - scrollY, - translateX: { - pos1: 32, - pos2: 32, - }, - translateY: { - pos1: 10, - pos2: -30, - }, - rotate: { - pos1: 0, - pos2: 0, - }, - start: 2.5 * height, - end: 3 * height, - }); - } - if (scrollY > 2 * height && scrollY <= 2.5 * height) { - handlePage2MobilePosition(); - } - if (scrollY > 2.8 * height && scrollY <= 3 * height) { - handlePage2VideoTopPosition(); - } - if (scrollY > 3.5 * height && scrollY <= 4 * height) { - handlePage2VideoPosition(); - } - if (scrollY > 2 * height && scrollY < 3.5 * height) { - handlePage2MobileUnit(); - } - // Page_3 - if (scrollY > 3.5 * height && scrollY < 4 * height) { - handleVideoTubeTopPosition(); - } - // Test - if (scrollY >= 4.5 * height && scrollY <= 5 * height) { - handleTestTranslateY(); - } - if(scrollY > 5 * height && scrollY <= 6 * height){ - handlePage3TopPosition(); - } - if(scrollY >= 6.3 * height && scrollY <= 7 * height){ - handlePage3TestTranslateY(); - } - if(scrollY >= 7.3 * height && scrollY <= 8.3 * height){ - handlePage4TopPosition(); + // Page_1 + if (scrollY >= 0 && scrollY <= height) { + handlePage1TopPosition(); + } + // Page_2 + if (scrollY >= 0 && scrollY <= height) { + handlePage2TopPosition(); + } + if (scrollY >= 0 && scrollY <= height) { + handlePage2RotateX(window.scrollY); + } + if (scrollY >= height && scrollY <= 2 * height) { + handlePage2BoxPosition({ + scrollY, + translateX: { + pos1: -5, + pos2: 32, + }, + translateY: { + pos1: -5, + pos2: 10, + }, + rotate: { + pos1: 5, + pos2: 0, + }, + start: height, + end: 2 * height, + }); + } + if (scrollY > 2.5 * height && scrollY <= 3 * height) { + handlePage2BoxPosition({ + scrollY, + translateX: { + pos1: 32, + pos2: 32, + }, + translateY: { + pos1: 10, + pos2: -30, + }, + rotate: { + pos1: 0, + pos2: 0, + }, + start: 2.5 * height, + end: 3 * height, + }); + } + if (scrollY > 2 * height && scrollY <= 2.5 * height) { + handlePage2MobilePosition(); + } + if (scrollY > 2.8 * height && scrollY <= 3 * height) { + handlePage2VideoTopPosition(); + } + if (scrollY > 3.5 * height && scrollY <= 4 * height) { + handlePage2VideoPosition(); + } + if (scrollY > 2 * height && scrollY < 3.5 * height) { + handlePage2MobileUnit(); + } + // Page_3 + if (scrollY > 3.5 * height && scrollY < 4 * height) { + handleVideoTubeTopPosition(); + } + // Test + if (scrollY >= 4.5 * height && scrollY <= 5 * height) { + handleTestTranslateY(); + } + if (scrollY > 5 * height && scrollY <= 6 * height) { + handlePage3TopPosition(); + } + if (scrollY >= 6.3 * height && scrollY <= 7 * height) { + handlePage3TestTranslateY(); + } + if (scrollY >= 7.3 * height && scrollY <= 8.3 * height) { + handlePage4TopPosition(); + } } }); }, []);