From 585d647974b08f89832fe2d51c4b33f5b5184f81 Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 13 Jul 2024 13:35:33 +0530 Subject: [PATCH 1/2] Update Footer.jsx --- src/components/Footer.jsx | 49 +++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 12f85b5..8ef00a2 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -13,10 +13,11 @@ const quotes = [ ]; const Footer = () => { - const [footerStyle, setFooterStyle] = useState({ - color: 'black' - }); + const [footerStyle, setFooterStyle] = useState({ color: 'black' }); const [quote, setQuote] = useState(quotes[Math.floor(Math.random() * quotes.length)]); + const [isModalOpen, setIsModalOpen] = useState(false); + const [email, setEmail] = useState(''); + const [error, setError] = useState(''); useEffect(() => { let savedTheme = localStorage.getItem('theme') || 'light'; @@ -52,6 +53,19 @@ const Footer = () => { return () => clearInterval(intervalId); // cleanup interval on component unmount }, []); + const handleSubscribe = () => { + if (!email) { + setError('Please enter your email ⚠️.'); + return; + } + setIsModalOpen(true); + setTimeout(() => { + setIsModalOpen(false); + }, 9000); + setEmail(''); + setError(''); + }; + return ( ); }; -export default Footer; \ No newline at end of file +export default Footer; From f640cbe3c5b5811fddcfc53183436b33fd99f740 Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 13 Jul 2024 13:35:43 +0530 Subject: [PATCH 2/2] Update Footer.css --- src/components/Footer.css | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/components/Footer.css b/src/components/Footer.css index ae8ec54..c92214f 100644 --- a/src/components/Footer.css +++ b/src/components/Footer.css @@ -290,3 +290,67 @@ a:hover { } + .modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + animation: fadeIn 0.5s; + } + + .modal-content { + background: rgb(255, 255, 255); + padding: 20px; + border-radius: 8px; + text-align: center; + animation: fadeIn 0.5s; + } + + .modal-content h2 { + margin-top: 0; + color: #072183; + font-weight: bold; + } + + .modal-content p { + color: #000000; + } + + + .modal-content button { + background: #093eba; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + margin-top: 20px; + } + + .modal-content button:hover { + background: #05286f; + } + + @keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } + } + \ No newline at end of file