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 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;