File size: 10,377 Bytes
d8b1d97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - WebBag Wonders</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
</head>
<body class="bg-gray-50">
    <div id="root"></div>

    <script type="text/babel">
        const { useState } = React;

        function Navbar() {
            return (
                <nav className="bg-white shadow-sm py-4 px-6 flex items-center justify-between sticky top-0 z-50">
                    <div className="flex items-center space-x-2">
                        <i className="fas fa-briefcase text-blue-500 text-2xl"></i>
                        <span className="text-xl font-semibold text-gray-800">WebBag Wonders</span>
                    </div>
                    <div className="flex items-center space-x-4">
                        <a href="index.html" className="text-gray-600 hover:text-blue-500">Back to Home</a>
                    </div>
                </nav>
            );
        }

        function LoginForm() {
            const [email, setEmail] = useState("");
            const [password, setPassword] = useState("");
            const [rememberMe, setRememberMe] = useState(false);
            const [isLoading, setIsLoading] = useState(false);
            
            const handleSubmit = (e) => {
                e.preventDefault();
                setIsLoading(true);
                // Simulate API call
                setTimeout(() => {
                    setIsLoading(false);
                    window.location.href = "index.html"; // Redirect after login
                }, 1500);
            };

            return (
                <div className="max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden p-8 mt-12">
                    <div className="text-center mb-8">
                        <h2 className="text-2xl font-bold text-gray-800 mb-2">Welcome back!</h2>
                        <p className="text-gray-500">Sign in to access your collection</p>
                    </div>
                    
                    <form onSubmit={handleSubmit}>
                        <div className="mb-4">
                            <label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">Email</label>
                            <input
                                type="email"
                                id="email"
                                value={email}
                                onChange={(e) => setEmail(e.target.value)}
                                className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-300"
                                required
                            />
                        </div>
                        
                        <div className="mb-4">
                            <label htmlFor="password" className="block text-sm font-medium text-gray-700 mb-1">Password</label>
                            <input
                                type="password"
                                id="password"
                                value={password}
                                onChange={(e) => setPassword(e.target.value)}
                                className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-300"
                                required
                            />
                        </div>
                        
                        <div className="flex items-center justify-between mb-6">
                            <div className="flex items-center">
                                <input
                                    type="checkbox"
                                    id="remember"
                                    checked={rememberMe}
                                    onChange={(e) => setRememberMe(e.target.checked)}
                                    className="h-4 w-4 text-blue-500 focus:ring-blue-300 border-gray-300 rounded"
                                />
                                <label htmlFor="remember" className="ml-2 block text-sm text-gray-700">
                                    Remember me
                                </label>
                            </div>
                            <a href="#" className="text-sm text-blue-500 hover:text-blue-600">
                                Forgot password?
                            </a>
                        </div>
                        
                        <button
                            type="submit"
                            disabled={isLoading}
                            className={`w-full py-2 px-4 rounded-lg text-white font-medium ${isLoading ? 'bg-blue-400' : 'bg-blue-500 hover:bg-blue-600'}`}
                        >
                            {isLoading ? (
                                <span className="flex items-center justify-center">
                                    <svg className="animate-spin -ml-1 mr-2 h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
                                        <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
                                        <path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
                                    </svg>
                                    Signing in...
                                </span>
                            ) : 'Sign In'}
                        </button>
                    </form>
                    
                    <div className="mt-6 text-center">
                        <p className="text-gray-500 text-sm">
                            Don't have an account? <a href="signup.html" className="text-blue-500 hover:text-blue-600">Sign up</a>
                        </p>
                    </div>
                    
                    <div className="mt-6">
                        <div className="relative">
                            <div className="absolute inset-0 flex items-center">
                                <div className="w-full border-t border-gray-300"></div>
                            </div>
                            <div className="relative flex justify-center text-sm">
                                <span className="px-2 bg-white text-gray-500">Or continue with</span>
                            </div>
                        </div>
                        
                        <div className="mt-6 grid grid-cols-2 gap-3">
                            <button className="w-full py-2 px-4 border border-gray-300 rounded-lg flex items-center justify-center hover:bg-gray-50">
                                <i className="fab fa-google text-red-500 mr-2"></i>
                                <span className="text-sm font-medium text-gray-700">Google</span>
                            </button>
                            <button className="w-full py-2 px-4 border border-gray-300 rounded-lg flex items-center justify-center hover:bg-gray-50">
                                <i className="fab fa-github text-gray-700 mr-2"></i>
                                <span className="text-sm font-medium text-gray-700">GitHub</span>
                            </button>
                        </div>
                    </div>
                </div>
            );
        }

        function Footer() {
            return (
                <footer className="bg-white border-t border-gray-200 py-8 mt-12">
                    <div className="container mx-auto px-4">
                        <div className="flex flex-col md:flex-row justify-between items-center">
                            <div className="mb-4 md:mb-0">
                                <div className="flex items-center space-x-2">
                                    <i className="fas fa-briefcase text-blue-500 text-xl"></i>
                                    <span className="text-lg font-semibold text-gray-800">WebBag Wonders</span>
                                </div>
                                <p className="text-gray-500 text-sm mt-2">Your digital companion for all things web</p>
                            </div>
                            <div className="flex space-x-6">
                                <a href="#" className="text-gray-500 hover:text-blue-500">
                                    <i className="fab fa-twitter"></i>
                                </a>
                                <a href="#" className="text-gray-500 hover:text-blue-500">
                                    <i className="fab fa-facebook"></i>
                                </a>
                                <a href="#" className="text-gray-500 hover:text-blue-500">
                                    <i className="fab fa-instagram"></i>
                                </a>
                                <a href="#" className="text-gray-500 hover:text-blue-500">
                                    <i className="fab fa-github"></i>
                                </a>
                            </div>
                        </div>
                        <div className="border-t border-gray-200 mt-6 pt-6 text-center text-gray-500 text-sm">
                            <p>© 2023 WebBag Wonders. All rights reserved.</p>
                        </div>
                    </div>
                </footer>
            );
        }

        function App() {
            return (
                <div className="min-h-screen flex flex-col">
                    <Navbar />
                    <LoginForm />
                    <Footer />
                </div>
            );
        }

        ReactDOM.render(<App />, document.getElementById('root'));
    </script>
</body>
</html>