|
1 | | -import { useState, useMemo, useEffect } from 'react' |
| 1 | +import { useState, useMemo } from 'react' |
2 | 2 | import Header from './components/Header' |
3 | 3 | import Sidebar from './components/Sidebar' |
4 | 4 | import ProductGrid from './components/ProductGrid' |
5 | 5 | import ProductDetail from './components/ProductDetail' |
6 | 6 | import { ALL_PRODUCTS } from './data/products' |
7 | 7 | import { motion, AnimatePresence } from 'framer-motion' |
8 | | -import { X, ShoppingBag, Heart, User, Trash2 } from 'lucide-react' |
| 8 | +import { X, ShoppingBag, Heart, Trash2 } from 'lucide-react' |
9 | 9 | import { useGoogleLogin } from '@react-oauth/google' |
10 | 10 | import Checkout from './components/Checkout' |
11 | 11 | import AccountModal from './components/AccountModal' |
12 | 12 |
|
13 | 13 | function App() { |
14 | | - const [showSplash, setShowSplash] = useState(true); |
15 | 14 | const [selectedCategories, setSelectedCategories] = useState([]); |
16 | 15 | const [selectedProduct, setSelectedProduct] = useState(null); |
17 | 16 | const [activeOverlay, setActiveOverlay] = useState(null); |
@@ -42,13 +41,6 @@ function App() { |
42 | 41 | } catch { return []; } |
43 | 42 | }); |
44 | 43 |
|
45 | | - useEffect(() => { |
46 | | - const timer = setTimeout(() => { |
47 | | - setShowSplash(false); |
48 | | - }, 2500); |
49 | | - return () => clearTimeout(timer); |
50 | | - }, []); |
51 | | - |
52 | 44 | const userOrdersKey = (user) => `zappify_orders_${user?.email}`; |
53 | 45 |
|
54 | 46 | const handleLogin = (user) => { |
@@ -152,10 +144,7 @@ function App() { |
152 | 144 |
|
153 | 145 | return ( |
154 | 146 | <AnimatePresence mode="wait"> |
155 | | - {showSplash ? ( |
156 | | - <SplashScreen key="splash" /> |
157 | | - ) : ( |
158 | | - <motion.div |
| 147 | + <motion.div |
159 | 148 | key="app-content" |
160 | 149 | className="zappify-app" |
161 | 150 | initial={{ opacity: 0 }} |
@@ -311,42 +300,10 @@ function App() { |
311 | 300 | /> |
312 | 301 | )} |
313 | 302 | </motion.div> |
314 | | - )} |
315 | 303 | </AnimatePresence> |
316 | 304 | ); |
317 | 305 | } |
318 | 306 |
|
319 | | -const SplashScreen = () => ( |
320 | | - <motion.div |
321 | | - className="splash-container" |
322 | | - initial={{ opacity: 1 }} |
323 | | - exit={{ opacity: 0 }} |
324 | | - transition={{ duration: 0.8, ease: "easeInOut" }} |
325 | | - > |
326 | | - <motion.div |
327 | | - className="splash-content" |
328 | | - initial={{ scale: 0.85, opacity: 0, y: 10 }} |
329 | | - animate={{ scale: 1, opacity: 1, y: 0 }} |
330 | | - transition={{ |
331 | | - duration: 1, |
332 | | - ease: [0.22, 1, 0.36, 1], |
333 | | - opacity: { duration: 0.6 } |
334 | | - }} |
335 | | - > |
336 | | - <div className="splash-logo"> |
337 | | - <img src="/logo.png" alt="Zappify" className="splash-logo-img" /> |
338 | | - </div> |
339 | | - <div className="splash-subtitle">Premium Shoe Store</div> |
340 | | - <motion.div |
341 | | - className="splash-loader" |
342 | | - initial={{ opacity: 0 }} |
343 | | - animate={{ opacity: 1 }} |
344 | | - transition={{ delay: 0.8 }} |
345 | | - /> |
346 | | - </motion.div> |
347 | | - </motion.div> |
348 | | -); |
349 | | - |
350 | 307 | const Overlay = ({ type, onClose, cartItems, wishlistItems, onRemoveFromCart, onToggleWishlist, onLoginSuccess, onCheckout, loggedInUser, onSwitchOverlay }) => { |
351 | 308 | const [isSignUp, setIsSignUp] = useState(false); |
352 | 309 | const [formData, setFormData] = useState({ name: '', email: '', password: '', confirm: '' }); |
@@ -475,29 +432,32 @@ const Overlay = ({ type, onClose, cartItems, wishlistItems, onRemoveFromCart, on |
475 | 432 | </div> |
476 | 433 | </motion.div> |
477 | 434 | ) : ( |
478 | | - <motion.div className="modal" initial={{ opacity: 0, scale: 0.9, y: 20 }} animate={{ opacity: 1, scale: 1, y: 0 }} exit={{ opacity: 0, scale: 0.9, y: 20 }}> |
479 | | - <div className="modal-header"> |
480 | | - <button className="close-btn" onClick={onClose}><X size={24} /></button> |
| 435 | + <motion.div className="modal login-modal-new" initial={{ opacity: 0, scale: 0.9, y: 20 }} animate={{ opacity: 1, scale: 1, y: 0 }} exit={{ opacity: 0, scale: 0.9, y: 20 }}> |
| 436 | + <div className="login-hero-banner"> |
| 437 | + <img src="/hero-nike.png" alt="Nike" className="login-hero-img" /> |
| 438 | + <button className="close-btn login-close-btn" onClick={onClose}><X size={20} /></button> |
| 439 | + <div className="login-hero-overlay"> |
| 440 | + <p className="login-hero-tag">ZAPPIFY</p> |
| 441 | + <h2 className="login-hero-title">Premium<br />Footwear</h2> |
| 442 | + <p className="login-hero-sub">Step into the future</p> |
| 443 | + </div> |
481 | 444 | </div> |
482 | | - <div className="modal-content login-modal"> |
483 | | - <User size={48} className="user-icon-large" /> |
| 445 | + <div className="login-form-card"> |
484 | 446 | <h2>{isSignUp ? 'Create Account' : 'Welcome Back'}</h2> |
485 | 447 | <p>{isSignUp ? 'Join Zappify today' : 'Login to your Zappify account'}</p> |
486 | | - |
487 | 448 | <div className="auth-form"> |
488 | 449 | {isSignUp && <input type="text" placeholder="Full Name" value={formData.name} onChange={e => setFormData({ ...formData, name: e.target.value })} />} |
489 | 450 | <input type="email" placeholder="Email Address" value={formData.email} onChange={e => setFormData({ ...formData, email: e.target.value })} /> |
490 | 451 | <input type="password" placeholder="Password" value={formData.password} onChange={e => setFormData({ ...formData, password: e.target.value })} /> |
491 | 452 | {isSignUp && <input type="password" placeholder="Confirm Password" value={formData.confirm} onChange={e => setFormData({ ...formData, confirm: e.target.value })} />} |
492 | 453 | {error && <p className="auth-error">{error}</p>} |
493 | 454 | <button className="btn-primary auth-btn" onClick={handleAuth}>{isSignUp ? 'CREATE ACCOUNT' : 'SIGN IN'}</button> |
494 | | - <div className="separator"><span>OR CONTINUE WITH</span></div> |
495 | | - <button className="google-custom-btn" onClick={() => googleLogin()}> |
496 | | - <img src="https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg" alt="Google" /> |
497 | | - {isSignUp ? 'Sign up with Google' : 'Sign in with Google'} |
| 455 | + <div className="separator"><span>OR</span></div> |
| 456 | + <button className="google-proper-btn" onClick={() => googleLogin()}> |
| 457 | + <img src="https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg" alt="Google" className="google-icon-large" /> |
| 458 | + <span>{isSignUp ? 'Sign up with Google' : 'Sign in with Google'}</span> |
498 | 459 | </button> |
499 | 460 | </div> |
500 | | - |
501 | 461 | <p className="auth-footer"> |
502 | 462 | {isSignUp ? 'Already have an account? ' : "Don't have an account? "} |
503 | 463 | <span onClick={() => setIsSignUp(!isSignUp)}>{isSignUp ? 'Sign In' : 'Sign Up'}</span> |
|
0 commit comments