From cfab8162bb01bddfd4139c5a9cb20d44796fd805 Mon Sep 17 00:00:00 2001 From: Ayushmaanagarwal1121 Date: Wed, 26 Jun 2024 17:34:06 +0530 Subject: [PATCH 1/6] Reduced gaps in social links in cards --- website3.0/stylesheets/teams.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website3.0/stylesheets/teams.css b/website3.0/stylesheets/teams.css index bc28acee..8fce6c52 100644 --- a/website3.0/stylesheets/teams.css +++ b/website3.0/stylesheets/teams.css @@ -152,6 +152,7 @@ body { background-size: cover; background-repeat: no-repeat; transition: 0.5s; + padding-right: 0px !important; } .team-member:hover { transform: scale(1.03); @@ -223,9 +224,10 @@ body { height: 100%; } .social-links { - width: 20%; - margin-left: 5px; + width: 16%; padding: 10px; + padding-left: 0px !important; + padding-right: 0px !important; } .social-links-items { display: flex; From c9ffd750df878b31f9c63336a32ffbe50adf004b Mon Sep 17 00:00:00 2001 From: Ayushmaanagarwal1121 Date: Thu, 27 Jun 2024 13:16:45 +0530 Subject: [PATCH 2/6] Added Proper validation for the newsletter with proper functionning --- website3.0/components/Loadernewletter.jsx | 16 +++++ website3.0/components/Popup.js | 23 +++++++ website3.0/pages/HomePage.js | 35 +++++++++-- website3.0/stylesheets/Loadernewsletter.css | 68 +++++++++++++++++++++ website3.0/stylesheets/Popup.css | 48 +++++++++++++++ website3.0/stylesheets/homepage.css | 15 +++++ 6 files changed, 200 insertions(+), 5 deletions(-) create mode 100644 website3.0/components/Loadernewletter.jsx create mode 100644 website3.0/components/Popup.js create mode 100644 website3.0/stylesheets/Loadernewsletter.css create mode 100644 website3.0/stylesheets/Popup.css diff --git a/website3.0/components/Loadernewletter.jsx b/website3.0/components/Loadernewletter.jsx new file mode 100644 index 00000000..c65767f3 --- /dev/null +++ b/website3.0/components/Loadernewletter.jsx @@ -0,0 +1,16 @@ +import React from 'react' +import "@stylesheets/Loadernewsletter.css"; + +export default function Lodaernewletter() { + console.log('sdsdsds') + return ( + <> +
+ +
+
+ +
+ + ) +} diff --git a/website3.0/components/Popup.js b/website3.0/components/Popup.js new file mode 100644 index 00000000..20053ddf --- /dev/null +++ b/website3.0/components/Popup.js @@ -0,0 +1,23 @@ +import React, { useEffect, useState } from 'react' +import "@stylesheets/Popup.css"; + +export default function Popup(props) { + const { error, msg } = props; + let [none, setNone] = useState(false); + + + useEffect(() => { + const timer = setTimeout(() => { + setNone(true); + }, 2000); + + return () => clearTimeout(timer); + }, []); + + return ( +
+ {msg} +
+
+ ); +} diff --git a/website3.0/pages/HomePage.js b/website3.0/pages/HomePage.js index 22cd5e3c..fb935357 100644 --- a/website3.0/pages/HomePage.js +++ b/website3.0/pages/HomePage.js @@ -23,7 +23,12 @@ import Splide from "@splidejs/splide"; import "@splidejs/splide/dist/css/splide.min.css"; import { ContainerScroll } from "@components/Scrolltab"; import ParticlesComponent from "@components/ParticleBackground"; +import Lodaernewletter from "../components/Loadernewletter"; +import Popup from "@components/Popup"; function HomePage() { + + // to loading the loader + const [loading , setLoading ]=useState(false) //to add body bg color useEffect(() => { document.body.style.background = @@ -133,14 +138,19 @@ function HomePage() { // Function to handle subscription process const subscribe = async () => { // Validate email format + if (!validateEmail(email)) { setError("Please enter a valid email address."); + setTimeout(() => { + setError('') +}, 2000); return; } setError(""); // Clear any previous error messages try { + setLoading(true) // Verify email using Hunter API const response = await fetch(`https://api.hunter.io/v2/email-verifier?email=${email}&api_key=939aedf77faf87bdef2cf493eb797f2e2fce2c37`); const result = await response.json(); @@ -148,6 +158,10 @@ function HomePage() { // Check if email is valid according to Hunter API response if (!result.data || result.data.status !== 'valid') { setError("Email Address Not Found!"); + setTimeout(() => { + setError('') + }, 2000); + setLoading(false) return; } @@ -165,10 +179,18 @@ function HomePage() { // Display success or failure message based on subscription result if (subscribeData.success) { - alert("Subscribed Successfully"); + setError("Subscribed Successfully"); + setTimeout(() => { + setError('') + }, 2000); } else { - alert("Subscription failed"); + setError("Subscription failed"); + setTimeout(() => { + setError('') + }, 2000); } + setLoading(false) + } catch (error) { // Handle any errors that occur during the process alert("An error occurred. Please try again."); @@ -177,7 +199,9 @@ function HomePage() { return (
+ {error&& } + {loading&&}
{/* Section: Main */} @@ -482,12 +506,13 @@ function HomePage() { setEmail(e.target.value)} placeholder="example@gmail.com" - className="input-field" + className="input-field changedesign" /> - {error &&

{error}

} +
+ {/* {error &&

{error}

} */}
- {error &&

{error}

} + {/* {error &&

{error}

} */} diff --git a/website3.0/stylesheets/Loadernewsletter.css b/website3.0/stylesheets/Loadernewsletter.css new file mode 100644 index 00000000..52127b37 --- /dev/null +++ b/website3.0/stylesheets/Loadernewsletter.css @@ -0,0 +1,68 @@ +.loader1 { + position: fixed; + top: 46%; + left: 46%; + z-index: 1000 !important; + + width: 100px; + height: 100px; + border: 4px solid #282828; + overflow: hidden; + border-radius: 50%; + box-shadow: -5px -5px 5px rgba(255, 255, 255, 0.1), + 10px 10px 10px rgba(0, 0, 0, 0.4), + inset -5px -5px 5px rgba(255, 255, 255, 0.2), + inset 10px 10px 10px rgba(0, 0, 0, 0.4); + } + .backgroundset{ + height: 100vh; + width: 100vw; + position: fixed; + top: 0px; + left: 0px; + background-color: rgba(0,0,0,0.4); + z-index: 999 !important; + } + .loader1:before { + content: ""; + position: absolute; + top: 25px; + left: 25px; + right: 25px; + bottom: 25px; + z-index: 10; + background: #212121; + border-radius: 50%; + border: 2px solid #292929; + box-shadow: inset -2px -2px 5px rgba(255, 255, 255, 0.2), + inset 3px 3px 5px rgba(0, 0, 0, 0.5); + } + + .loader1 span { + position: absolute; + width: 100%; + height: 100%; + border-radius: 50%; + background-image: linear-gradient( + -225deg, + #ff7402 0%, + #ffe700 50%, + #fff55e 100% + ); + filter: blur(20px); + z-index: -1; + animation: animate 0.5s linear infinite; + } + + @keyframes animate { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } + + + \ No newline at end of file diff --git a/website3.0/stylesheets/Popup.css b/website3.0/stylesheets/Popup.css new file mode 100644 index 00000000..0c0801f0 --- /dev/null +++ b/website3.0/stylesheets/Popup.css @@ -0,0 +1,48 @@ +.red1{ + background-color: red; +} + +.green1 { + background-color: rgb(28, 201, 28) !important; +} + +.popup{ + width: 40%; + height: 60px; + border-radius: 10px; + position: fixed; + bottom: 100px; + display: flex; + justify-content: center; + align-items: center; + left: 30%; + right: 30%; + color: white; + animation: animate1 1s forwards; + +} +.none1{ + display: none; +} +.line{ + width: 100px; + background-color: white; + height: 2px; + position: absolute; + bottom: 0px ; + animation: animate 2s forwards; +} +@keyframes animate { + from{ + width: 0px; + }to{ + width: 100%; + } +} +@keyframes animate1 { + from{ + opacity: 0; + }to{ + opacity: 1; + } +} \ No newline at end of file diff --git a/website3.0/stylesheets/homepage.css b/website3.0/stylesheets/homepage.css index 40b7259a..0ee21c36 100644 --- a/website3.0/stylesheets/homepage.css +++ b/website3.0/stylesheets/homepage.css @@ -901,3 +901,18 @@ body.dark-mode { height: 46px !important; } } + +.changedesign{ + background:none; + border-bottom: solid 2px white; + border-radius: 0px !important; +} +.changedesign::placeholder{ + left: 0px !important; + margin-left: 0px !important; + color: black; + padding-left: 0px !important; +} +.changedesign:focus{ + outline: none; +} From 04e1894f9ae7f2d78f5153a194d996642804a36f Mon Sep 17 00:00:00 2001 From: Ayushmaanagarwal1121 Date: Thu, 27 Jun 2024 13:40:09 +0530 Subject: [PATCH 3/6] Resolve conflict --- website3.0/pages/HomePage.js | 55 +++++++++++++++--------------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/website3.0/pages/HomePage.js b/website3.0/pages/HomePage.js index fb935357..bdd45e4e 100644 --- a/website3.0/pages/HomePage.js +++ b/website3.0/pages/HomePage.js @@ -23,12 +23,7 @@ import Splide from "@splidejs/splide"; import "@splidejs/splide/dist/css/splide.min.css"; import { ContainerScroll } from "@components/Scrolltab"; import ParticlesComponent from "@components/ParticleBackground"; -import Lodaernewletter from "../components/Loadernewletter"; -import Popup from "@components/Popup"; function HomePage() { - - // to loading the loader - const [loading , setLoading ]=useState(false) //to add body bg color useEffect(() => { document.body.style.background = @@ -138,19 +133,28 @@ function HomePage() { // Function to handle subscription process const subscribe = async () => { // Validate email format - if (!validateEmail(email)) { setError("Please enter a valid email address."); - setTimeout(() => { - setError('') -}, 2000); return; } setError(""); // Clear any previous error messages try { - setLoading(true) + // Check if email already exists + const checkResponse = await fetch('/api/checkEmail', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ email }) + }); + const checkResult = await checkResponse.json(); + if (checkResult.exists) { + setError("You are already subscribed to our newsletter."); + return; + } + // Verify email using Hunter API const response = await fetch(`https://api.hunter.io/v2/email-verifier?email=${email}&api_key=939aedf77faf87bdef2cf493eb797f2e2fce2c37`); const result = await response.json(); @@ -158,10 +162,6 @@ function HomePage() { // Check if email is valid according to Hunter API response if (!result.data || result.data.status !== 'valid') { setError("Email Address Not Found!"); - setTimeout(() => { - setError('') - }, 2000); - setLoading(false) return; } @@ -179,18 +179,10 @@ function HomePage() { // Display success or failure message based on subscription result if (subscribeData.success) { - setError("Subscribed Successfully"); - setTimeout(() => { - setError('') - }, 2000); + alert("Subscribed Successfully"); } else { - setError("Subscription failed"); - setTimeout(() => { - setError('') - }, 2000); + alert("Subscription failed"); } - setLoading(false) - } catch (error) { // Handle any errors that occur during the process alert("An error occurred. Please try again."); @@ -199,9 +191,7 @@ function HomePage() { return (
- {error&& } - {loading&&}
{/* Section: Main */} @@ -212,7 +202,7 @@ function HomePage() { {" "} Star Us @@ -269,7 +259,7 @@ function HomePage() { Whether you're troubleshooting a complex issue or seeking advice on best practices, find the solutions you need right here.

- +
setEmail(e.target.value)} placeholder="example@gmail.com" - className="input-field changedesign" + className="input-field" /> -
- {/* {error &&

{error}

} */} + {error &&

{error}

}
- {/* {error &&

{error}

} */} + {error &&

{error}

} @@ -521,4 +510,4 @@ function HomePage() { ); } -export default HomePage; +export default HomePage; \ No newline at end of file From 58ac80445d3874e109828c4ca123079cae744cf0 Mon Sep 17 00:00:00 2001 From: Ayushmaanagarwal1121 Date: Thu, 27 Jun 2024 13:48:00 +0530 Subject: [PATCH 4/6] Resolved the conflict and added proper validation for newsletter --- website3.0/pages/HomePage.js | 49 +++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/website3.0/pages/HomePage.js b/website3.0/pages/HomePage.js index bdd45e4e..50ce0d73 100644 --- a/website3.0/pages/HomePage.js +++ b/website3.0/pages/HomePage.js @@ -2,6 +2,8 @@ import React, { useEffect, useState } from "react"; import "@stylesheets/homepage.css"; import { useRouter } from "next/navigation"; import "@stylesheets/homepage.css"; +import Lodaernewletter from "../components/Loadernewletter"; +import Popup from "@components/Popup"; //Importing FontAwesome for Icons import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -24,7 +26,10 @@ import "@splidejs/splide/dist/css/splide.min.css"; import { ContainerScroll } from "@components/Scrolltab"; import ParticlesComponent from "@components/ParticleBackground"; function HomePage() { + const [loading , setLoading ]=useState(false) + //to add body bg color + useEffect(() => { document.body.style.background = "linear-gradient(to bottom,#f5d471 2%,#ec904f 15%,#eb9a60 25%,#e99960 35%,#e89357 45%,#e99559 55%,#e78d4d 65%, #eb904f 75%,#e97a2a 85%,#ea670a 95%) "; @@ -133,8 +138,14 @@ function HomePage() { // Function to handle subscription process const subscribe = async () => { // Validate email format + setLoading(true) if (!validateEmail(email)) { setError("Please enter a valid email address."); + setTimeout(() => { + setError('') +}, 2000); +setLoading(false) + return; } @@ -152,6 +163,11 @@ function HomePage() { const checkResult = await checkResponse.json(); if (checkResult.exists) { setError("You are already subscribed to our newsletter."); + setTimeout(() => { + setError('') + }, 2000); + setLoading(false) + return; } @@ -162,6 +178,11 @@ function HomePage() { // Check if email is valid according to Hunter API response if (!result.data || result.data.status !== 'valid') { setError("Email Address Not Found!"); + setTimeout(() => { + setError('') + }, 2000); + setLoading(false) + return; } @@ -179,19 +200,35 @@ function HomePage() { // Display success or failure message based on subscription result if (subscribeData.success) { - alert("Subscribed Successfully"); + setError("Subscribed Successfully"); + setTimeout(() => { + setError("Subscription failed"); + setTimeout(() => { + setError('') + }, 2000); + }, 2000); } else { - alert("Subscription failed"); + setError("Subscription failed"); + setTimeout(() => { + setError('') + }, 2000); } } catch (error) { // Handle any errors that occur during the process - alert("An error occurred. Please try again."); + setError("An error occurred. Please try again."); + setTimeout(() => { + setError('') + }, 2000); } + setLoading(false) + }; return (
+ {loading && } + {error&& }
{/* Section: Main */} @@ -496,12 +533,12 @@ function HomePage() { setEmail(e.target.value)} placeholder="example@gmail.com" - className="input-field" + className="input-field changedesign" /> - {error &&

{error}

} + {/* {error &&

{error}

} */}
- {error &&

{error}

} + {/* {error &&

{error}

} */} From f96efb30689d14f94390ae2b2e97412c156698a2 Mon Sep 17 00:00:00 2001 From: Ayushmaan Agarwal <118350936+Ayushmaanagarwal1211@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:02:41 +0530 Subject: [PATCH 5/6] Removed the design of input box --- website3.0/pages/HomePage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website3.0/pages/HomePage.js b/website3.0/pages/HomePage.js index 547b38de..eeb63afc 100644 --- a/website3.0/pages/HomePage.js +++ b/website3.0/pages/HomePage.js @@ -528,7 +528,7 @@ setLoading(false) setEmail(e.target.value)} placeholder="example@gmail.com" - className="input-field changedesign" + className="input-field " /> {/* {error &&

{error}

} */} @@ -542,4 +542,4 @@ setLoading(false) ); } -export default HomePage; \ No newline at end of file +export default HomePage; From 1b49ecd454994dc4d4dfca6aa3dd8098996516f8 Mon Sep 17 00:00:00 2001 From: Ayushmaan Agarwal <118350936+Ayushmaanagarwal1211@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:23:34 +0530 Subject: [PATCH 6/6] Update HomePage.js --- website3.0/pages/HomePage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website3.0/pages/HomePage.js b/website3.0/pages/HomePage.js index eeb63afc..41cd4675 100644 --- a/website3.0/pages/HomePage.js +++ b/website3.0/pages/HomePage.js @@ -137,6 +137,9 @@ function HomePage() { // Function to handle subscription process const subscribe = async () => { + setTimeout(() => { + setEmail('') + }, 2000); // Validate email format setLoading(true) if (!validateEmail(email)) {