diff --git a/index.html b/index.html index 78359a8..3b36bbc 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,19 @@ + + +
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index a48d3e0..3abdf60 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -2,31 +2,24 @@ import { useEffect, useState } from 'react'; import React from 'react'; import './Footer.css'; - const quotes = [ "Innovation distinguishes between a leader and a follower.", - "Simplicity is the ultimate sophistication. ", + "Simplicity is the ultimate sophistication.", "The secret of getting ahead is getting started.", "All limitations are self-imposed.", - "Tough times never last but tough people do. ", + "Tough times never last but tough people do.", "Strive for greatness.", // Add more quotes as needed ]; - const Footer = () => { - - - const [footerStyle, setFooterStyle] = useState({ - color: 'black' + color: 'black' }); - const [quote, setQuote] = useState(quotes[Math.floor(Math.random() * quotes.length)]); - - let savedTheme; - + const [quote, setQuote] = useState(quotes[Math.floor(Math.random() * quotes.length)]); + useEffect(() => { - savedTheme = localStorage.getItem('theme') || 'light'; + let savedTheme = localStorage.getItem('theme') || 'light'; setFooterStyle({ color: savedTheme === 'light' ? 'white' : 'white', backgroundColor: savedTheme === 'light' ? '#0ea5e9' : '', @@ -39,8 +32,25 @@ const Footer = () => { }); }, 10000); // changes every 10 seconds + // Add Google Translate script + const addGoogleTranslateScript = () => { + const script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; + document.body.appendChild(script); + }; + + window.googleTranslateElementInit = () => { + new window.google.translate.TranslateElement( + { pageLanguage: 'en' }, + 'google_translate_element' + ); + }; + + addGoogleTranslateScript(); + return () => clearInterval(intervalId); // cleanup interval on component unmount - }, [savedTheme]); + }, []); return ( - ); - }; - - - export default Footer; - +© 2024 TimeWarp. All rights reserved.
+